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.

  1. Open Windows System Image Manager (Windows SIM), and open an answer file.

  2. Add the setting: Microsoft-Windows-Setup\DiskConfiguration\Disk to the windowsPE configuration pass.

  3. For each additional hard disk, right-click DiskConfiguration, and select Insert New Disk.

  4. 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.

  5. For each disk, set WillWipeDisk to true.

To create the partitions

In this section, you create the partition structure.

  1. Add the setting: Microsoft-Windows-Setup\DiskConfiguration\Disk\CreatePartitions to the windowsPE configuration pass.

  2. Right-click CreatePartitions, and select CreatePartition. Repeat this step for each partition.

  3. In the CreatePartition setting, add an Order value for each partition. The first partition on a disk has the value of 1, the second, 2, and so on.

  4. In CreatePartition, specify the type of each partition.

    1. Set the EFI System Partition (ESP) as Type=EFI.

    2. Set the Microsoft Reserved partition (MSR) as Type=MSR.

    3. Set other partitions as Type=Primary.

  5. In CreatePartition, configure the size of the partitions. Use either Size=<size> or Extend=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.

To modify the partitions

In this section, you modify the partitions.

  1. Add the setting: Microsoft-Windows-Setup\DiskConfiguration\Disk\ModifyPartitions to the windowsPE configuration pass.

  2. 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 for CreatePartition\Order, ModifyPartition\Order, and PartitionID.

  3. In ModifyPartition, use Order to specify a sequence that partition modifications will follow. The first partition modification has the value of 1, the second, 2, and so on.

  4. In ModifyPartition, use PartitionID to identify each partition. The PartitionID value will be the same as the CreatePartition | Order value.

  5. In ModifyPartition, use Label to label to each primary partition.

  6. In ModifyPartition, use Letter to specify drive letters for Windows and data partitions. For the Windows partition, we recommend using Letter = 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.

  1. In the setting: Microsoft-Windows-Setup\ImageInstall\OSImage, either clear the component InstallToAvailablePartition, or set it to False.

  2. Add the setting: Microsoft-Windows-Setup\ImageInstall\OSImage\InstallTo.

  3. In InstallTo, set DiskID to the hard disk where you want to install Windows.

  4. In InstallTo, set PartitionID 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.



Diagram of the default UEFI partition structure
<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>

See Also