This document discusses how to create a customized hard disk partition structure for a UEFI-based computer during Windows® Setup. For instructions on customizing a hard disk partition structure for BIOS-based computers, see Create BIOS-based Hard-Disk Partitions by Using Windows SIM.
Plan your partition structure
Plan your partition structure using information from the topic: Understanding Disk Partitions.
For examples of partition structures, see Recommended UEFI-Based Disk-Partition Configurations.
In your plan, include details such as the Type, Order, and PartitionID of each partition. You will need these details to complete your partition structure, as explained later in this document.
To prepare the hard disks
In this section, you identify each of the hard disks you will be using on your system.
- Open Windows System Image Manager (Windows SIM), and
open an answer file.
- Add the setting:
Microsoft-Windows-Setup\DiskConfiguration\Disk
to the windowsPE configuration pass.
- For each additional hard disk, right-click
DiskConfiguration, and select Insert New Disk.
- For each disk, set
DiskID
. The first hard disk has the value of 0 (zero), the second has the value of 1, and so on.
- For each disk, set
WillWipeDisk
totrue
.
To create the partitions
In this section, you create the partition structure.
- Add the setting:
Microsoft-Windows-Setup
\DiskConfiguration\Disk\CreatePartitions
to the windowsPE configuration pass.
- Right-click CreatePartitions, and select
CreatePartition. Repeat this step for each partition.
- In the
CreatePartition
setting, add anOrder
value for each partition. The first partition on a disk has the value of 1, the second, 2, and so on.
- In
CreatePartition
, specify the type of each partition.
- Set the EFI System Partition (ESP) as
Type=EFI
.
- Set the Microsoft Reserved partition (MSR) as
Type=MSR
.
- Set other partitions as
Type=Primary
.
- Set the EFI System Partition (ESP) as
- In
CreatePartition
, configure the size of the partitions. Use eitherSize=<size>
orExtend=True
for each partition; do not use both.
- Use
Size
to specify the partition size in megabytes. (For example, 15000).
- For the last primary partition, use
Extend = True
to instruct Windows Setup to set the partition to fill the remainder of the hard disk.
- Use
To modify the partitions
In this section, you modify the partitions.
- Add the setting:
Microsoft-Windows-Setup
\DiskConfiguration\Disk\ModifyPartitions
to the windowsPE configuration pass.
- Right-click ModifyPartitions, and select
ModifyPartition. Repeat this step for each partition you
want to modify.
Note: Add a
ModifyPartition
element for every partition. With this structure, you can use the same values forCreatePartition\Order
,ModifyPartition\Order
, andPartitionID
. - In
ModifyPartition
, useOrder
to specify a sequence that partition modifications will follow. The first partition modification has the value of 1, the second, 2, and so on.
- In
ModifyPartition
, usePartitionID
to identify each partition. The PartitionID value will be the same as theCreatePartition | Order
value.
- In
ModifyPartition
, useLabel
to label to each primary partition.
- In
ModifyPartition
, useLetter
to specify drive letters for Windows and data partitions. For the Windows partition, we recommend usingLetter = C
. If you do not specify a letter, the default setting is the first available letter from C through Z.
To identify the Windows partition
In this section, you will identify a single partition where Windows will be installed.
- In the setting:
Microsoft-Windows-Setup
\ImageInstall\OSImage
, either clear the componentInstallToAvailablePartition
, or set it toFalse
.
- Add the setting:
Microsoft-Windows-Setup
\ImageInstall\OSImage\InstallTo
.
- In
InstallTo
, setDiskID
to the hard disk where you want to install Windows.
- In
InstallTo
, setPartitionID
to the partition where you want to install Windows.
XML Example
The following diagram and XML output shows the Autounattend.xml Disk Configuration settings for a system with the default configuration: a system partition, an MSR partition, and a Windows partition.
<DiskConfiguration> <Disk wcm:action="add"> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> <CreatePartitions> <CreatePartition wcm:action="add"> <Order>1</Order> <Size>100</Size> <Type>EFI</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Order>2</Order> <Type>MSR</Type> </CreatePartition> </CreatePartition> <CreatePartition wcm:action="add"> <Order>3</Order> <Extend>true</Extend> <Type>Primary</Type> </CreatePartition> </CreatePartitions> <ModifyPartitions> <ModifyPartition> <Order>1</Order> <PartitionID>1</PartitionID> <Label>System</Label> </ModifyPartition> <ModifyPartition> <Order>2</Order> <PartitionID>2</PartitionID> </ModifyPartition> <ModifyPartition> <Order>3</Order> <PartitionID>3</PartitionID> <Letter>C</Letter> <Label>Windows</Label> <Format>NTFS</Format> </ModifyPartition> </ModifyPartitions> </Disk> </DiskConfiguration> <ImageInstall> <OSImage> <InstallTo> <DiskID>0</DiskID> <PartitionID>3</PartitionID> </InstallTo> </OSImage> </ImageInstall>