The essentials

Quick reference

One focused task per row. Jump to the related section for complete, working examples.

UseSyntaxExamples
Select the destination diskselect disk 3View examples
Inspect destination identitydetail diskView examples
Erase the partition layoutcleanView examples
Initialize GPTconvert gptView examples
Create a 300 MB ESPcreate partition efi size=300View examples
Format the ESPformat quick fs=fat32 label="System"View examples
Mount the ESP in WinPEassign letter=SView examples
Create the MSRcreate partition msr size=16View examples
Create the Windows partitioncreate partition primaryView examples
Reserve 1500 MB for recoveryshrink desired=1500 minimum=1500View examples
Format Windows as NTFSformat quick fs=ntfs label="Windows"View examples
Mount Windows in WinPEassign letter=WView examples
Create the recovery partitioncreate partition primaryView examples
Format recovery as NTFSformat quick fs=ntfs label="Recovery"View examples
Set the Windows RE typeset id=de94bba4-06d1-4d40-a16a-bfd50179d6acView examples
Protect the recovery partitiongpt attributes=0x8000000000000001View examples
List the final partitionslist partitionView examples
List deployment volumeslist volumeView examples

A Windows UEFI deployment disk uses GPT and normally contains an EFI system partition, a Microsoft reserved partition, the Windows partition, and a Windows Recovery Environment partition in that order. The complete example is intended for Windows PE and erases the selected disk. Adapt sizes to the device sector format and recovery image, verify disk identity from hardware information, and never assume the destination is disk 0.

Step by step

Detailed examples

01

Confirm UEFI mode, sector size, and disk identity

Use this layout only for devices that will boot Windows in UEFI mode. Windows requires GPT for UEFI installation. The EFI system partition minimum is 200 MB on 512-byte and 512e drives and 300 MB on 4Kn drives, so the example uses 300 MB. Match the destination by location path, model, serial, size, and existing layout; disk numbers can differ across otherwise identical computers.

Read-only destination check
list disk
select disk 3
detail disk
list partition
rem Stop unless firmware mode, sector format, and physical identity match the deployment record.
Back to quick reference ↑
02

Erase and initialize only the approved destination

Clean irreversibly removes the existing partition layout. Run this from Windows PE only after preserving data, escrowed BitLocker recovery material, and a tested redeployment path. Disconnect non-target disks when practical. Convert gpt then establishes the partition style required by UEFI Windows Setup.

Initialize an approved destination as GPT
select disk 3
detail disk
clean
convert gpt
list disk
Back to quick reference ↑
03

Create the EFI system and Microsoft reserved partitions

The EFI system partition is FAT32 and stores boot files; it is not a general data volume. The MSR is 16 MB and remains unformatted and without a drive letter. S is temporary in Windows PE. Never use X because Windows PE reserves it, and do not expect temporary letters to survive reboot.

Create ESP and MSR
create partition efi size=300
format quick fs=fat32 label="System"
assign letter=S
create partition msr size=16
Back to quick reference ↑
04

Allocate Windows and reserve trailing recovery space

Microsoft recommends placing recovery immediately after Windows so future servicing can replace or grow it. This example creates Windows with the remaining capacity and shrinks it by 1500 MB. Current custom-layout guidance recommends at least 990 MB with at least 250 MB free; increase 1500 MB when your winre.wim, language packs, drivers, or servicing plan require more.

Create the Windows volume and reserve recovery space
create partition primary
shrink desired=1500 minimum=1500
format quick fs=ntfs label="Windows"
assign letter=W
Back to quick reference ↑
05

Type and protect the Windows RE partition

A recovery partition is not identified by its label alone. On GPT, set the Windows recovery type GUID and attributes 0x8000000000000001. The attributes mark the partition required and prevent ordinary automatic drive-letter assignment. R is temporary for applying and configuring Windows RE; remove it after deployment if it remains assigned.

Create and protect Windows RE storage
create partition primary
format quick fs=ntfs label="Recovery"
assign letter=R
set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
gpt attributes=0x8000000000000001
Back to quick reference ↑
06

Verify before applying Windows images

Confirm exact order, sizes, offsets, filesystems, and temporary letters. The expected order is ESP, MSR, Windows, recovery. Apply boot and OS images only after this check. After Windows boots, verify Windows RE with reagentc and ensure the ESP and recovery partition are not exposed with ordinary drive letters.

Complete destructive WinPE layout script
rem WARNING: this script erases disk 3.
select disk 3
clean
convert gpt
create partition efi size=300
format quick fs=fat32 label="System"
assign letter=S
create partition msr size=16
create partition primary
shrink desired=1500 minimum=1500
format quick fs=ntfs label="Windows"
assign letter=W
create partition primary
format quick fs=ntfs label="Recovery"
assign letter=R
set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
gpt attributes=0x8000000000000001
list partition
list volume
exit
Back to quick reference ↑

Sources and further reading

References

Authoritative documentation used to verify and expand this cheat sheet.

  1. MicrosoftUEFI/GPT-based hard drive partitionslearn.microsoft.com
  2. MicrosoftWindows Setup: MBR or GPT partition stylelearn.microsoft.com
  3. MicrosoftCapture and apply Windows partitionslearn.microsoft.com
  4. MicrosoftDeploy Windows RElearn.microsoft.com

Help us improve

Found a typo or missing example?

Tell us what would make this cheat sheet clearer, more complete, or more useful.

Share feedback