Some days ago, i was facing a problem by a client's new server Windows 2012 R2 setup that would absolutely not work with GPT file system. To solve this issue, i has to perform a complete manual setup using DISKPART and DISM and I wanted to describe this on this post.


Altought this could be scripted, if you need it to run only one time I would suggest you to perform all steps manually.
By following this guide, you should follow all steps. This article is provided as is, without warranty of any kind

Followed first part? Go directly to part 2 !

First, boot on yout setup media using UEFI boot mode and start the Windows Server setup. Select the version you would like to install (this is not important since we will set it up manually later) and accept the EULA.

 

Now that you are on the Disk selection step, hit SHIFT + F10 button and you will have a new command prompt window.

First, we'll need to convert the drive to GPT format. This step will be done with Diskpart tool, i'll describe each command and you'll find the result on the next screenshot.

diskpart
list disk
select disk 0
clean
convert gpt

 

 
Command Description
diskpart To start the diskpart tool
list disk Optional step to list disk(s). here we only have one disk identified as Disk 0
select disk 0 Selecting the identified disk to work with
clean This will clean all the disk configuration (partitions and formatting)
convert gpt This command conver the drive format to GPT

Now we converted the drive format to GPT, we'll create a total of 5 partitions:

Partition Name Description
Windows RE Tools Recovery Partition
System Partition EFI System Partition that will contain boot configuration etc.
Microsoft┬« Reserved (MSR) Partition Drive Management partition
Windows Partition The partition where Windows Server will be installed
Recovery Image  Partition We will store the recovery image here

We'll see the step by step partitions creation bellow.

Windows RE Tools

create partition primary size=300
format quick fs=ntfs label "Windows RE Tools"
assign letter="T"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
 
Command Description
create partition primary size=300 We create a primary partition with 300Mb size
format quick fs=ntfs label "Windows RE Tools" Format the new partition as ntfs and name it Windows RE Tools
assign letter="T" Assign it a letter T (this is not the letter you'll see under Windows after setup)
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" The partition ID. This is mandatory for that kind of partition
gpt attributes=0x8000000000000001 that command protect the partition from end-users to avoid deletion

System Partition

create partition efi size=100
format quick fs=fat32 label="System"
assign letter="S"
 
Command Description
create partition efi size=100 Create a EFI partition of 100Mb size (you may set it to 300Mb too)
format quick fs=fat32 label="System" This partition must be formated in FAT32 and we name it System
assign letter="S" Assign it letter (this is not the letter you'll see under Windows after setup)

Microsoft┬« Reserved (MSR) Partition

Create partition msr size=128
 
Command Description
create partition msr size=128 Create a msr partition of 128Mb size

 Windows Partition and Recovery image Partition

In this step, we will use the entire left space on the drive, than crop it from the end to be able to create the latest partition (Recovery Image)

Windows partition:

create partition primary
shrink minimum=15000
format quick fs=ntfs label="Windows"
assign letter="W"

Recovery Image partition:

create partition primary
format quick fs=ntfs label="Recovery image"
assign letter="R"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
 
Command Description
create partition primary We create a primary partition with All the left space on the disk 0
shrink minimum=15000 We shrink the new partition to free around 15Gb of space
format quick fs=ntfs label="Windows" Format this partition as ntfs and name it Windows
assign letter="W" Assign it the letter W (this is not the letter you'll see under Windows after setup)
create partition primary Now, create a primary partition with the freed 15Gb space above
format quick fs=ntfs label="Recovery image" This new partition will be named Recovery Image and is formated in ntfs
assign letter="R" Assign it the letter (this is not the letter you'll see under Windows after setup)
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" This ID is mandatory for windows to recognise this partition as Recovery Image.
gpt attributes=0x8000000000000001 that command protect the partition from end-users to avoid deletion

You are now done with the Disk Partitions !

you may see the final result by doing a list volume from your diskpart

When you're done, you may type exit to quit the diskpart utility and go to the second part of this guide ! 

blog comments powered by Disqus