This topic discusses how to create a customized hard disk partition structure for a BIOS-based computer during Windows® Setup. For instructions on customizing a hard disk partition structure for computers that support the Unified Extended Firmware Interface (UEFI), see Create UEFI-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 BIOS-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 topic.
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.
Important: | |
|
To 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
setting 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 system partition asType = Primary
. Set other partitions asType = Primary
,Extended
, orLogical
.
- 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 of the primary or extended
partitions, use
Extend = true
to instruct Windows Setup to set the partition to fill the remainder of the hard disk.
- If you use logical partitions, you can select
the last logical partition to fill the remainder of the extended
partition. In
Microsoft-Windows-Setup\
DiskConfiguration\Disk\CreatePartitions\CreatePartition\Extend
, setExtend = false
, and setSize = 100
. This size will initially be created as a 100 MB partition, which you will modify in the next section.
- 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.
- If you use only primary partitions, then add
a
ModifyPartition
element for every partition. With this structure, you will be able to use the same values forModifyPartition\Order
, andPartitionID
in the next two steps that you used forCreatePartition\Order
.
- If you use an extended partition, then add a
ModifyPartition
element for every partition but one. Typically the extended partition does not need further modification. With this structure, you can use the same values forModifyPartition\Order
andPartitionID
in the next two steps.
- If you use only primary partitions, then add
a
- In
ModifyPartition
, useOrder
to specify the 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.
- If you use only primary partitions, then the
PartitionID
value will be the same as theOrder
value.
- If you use an extended partition, then the
first primary partitions receive a
PartitionID
value that is the same as theOrder
value. The extended partition itself does not receive aPartitionID
. However, each logical partition inside the extended partition does receive aPartitionID
, starting with theOrder
value of the extended partition, and continuing incrementally from there. Each primary partition following the extended partition continues this sequence.
For example:
Primary (PartitionID 1)
Extended
Logical (PartitionID 2)
Logical (PartitionID 3)
Logical (PartitionID 4)
Primary (PartitionID 5)
Primary (PartitionID 6)
- If you use only primary partitions, then the
- In
ModifyPartition
, specify the system partition asActive = true
. If there is no separate system partition, specify the Windows partition.
- In
ModifyPartition
, useLabel
to label to each primary and logical 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.
- If you use logical partitions, select the last logical
partition, and set
ModifyPartition\Extend = true
to modify this partition to fill the remaining space in the extended partition.
To identify the Windows partition
In this section, you identify a single partition where Windows will be installed.
- In the setting: Microsoft-Windows-Setup
\ImageInstall\OSImage
, either clear the settingInstallToAvailablePartition
, 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 Autounattend.xml Disk Configuration settings for the standard configuration: a system with two primary partitions:
<DiskConfiguration> <Disk wcm:action="add"> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> <CreatePartitions> <CreatePartition wcm:action="add"> <Order>1</Order> <Size>300</Size> <Type>Primary</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Order>2</Order> <Extend>true</Extend> <Type>Primary</Type> </CreatePartition> </CreatePartitions> <ModifyPartitions> <ModifyPartition wcm:action="add"> <Order>1</Order> <PartitionID>1</PartitionID> <Active>true</Active> <Format>NTFS</Format> <Label>System</Label> <Letter>S</Letter> <TypeID>0x27</TypeID> </ModifyPartition> <ModifyPartition wcm:action="add"> <Order>2</Order> <PartitionID>2</PartitionID> <Format>NTFS</Format> <Label>Windows</Label> </ModifyPartition> </ModifyPartitions> </Disk> </DiskConfiguration> <ImageInstall> <OSImage> <InstallTo> <DiskID>0</DiskID> <PartitionID>2</PartitionID> </InstallTo> </OSImage> </ImageInstall>
The following diagram and XML output shows Autounattend.xml Disk Configuration settings for a system with primary, extended, and logical partitions:
<DiskConfiguration> <Disk wcm:action="add"> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> <CreatePartitions> <CreatePartition wcm:action="add"> <Order>1</Order> <Size>1234</Size> <Type>Primary</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Order>2</Order> <Extend>false</Extend> <Type>Primary</Type> <Size>250</Size> </CreatePartition> <CreatePartition wcm:action="add"> <Order>3</Order> <Size>300</Size> <Type>Primary</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Order>4</Order> <Extend>true</Extend> <Type>Extended</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Order>5</Order> <Size>15000</Size> <Type>Logical</Type> </CreatePartition> <CreatePartition wcm:action="add"> <Order>6</Order> <Type>Logical</Type> <Extend>false</Extend> <Size>100</Size> </CreatePartition> </CreatePartitions> <ModifyPartitions> <ModifyPartition wcm:action="add"> <Order>1</Order> <PartitionID>1</PartitionID> <Format>NTFS</Format> <Label>Utility1</Label> <Letter>U</Letter> </ModifyPartition> <ModifyPartition wcm:action="add"> <Order>2</Order> <PartitionID>2</PartitionID> <Format>NTFS</Format> <Label>Utility2</Label> <TypeID>0x27</TypeID> </ModifyPartition> <ModifyPartition wcm:action="add"> <Order>3</Order> <PartitionID>3</PartitionID> <Active>true</Active> <Format>NTFS</Format> <Label>System</Label> <TypeID>0x27</TypeID> </ModifyPartition> <ModifyPartition wcm:action="add"> <Order>4</Order> <PartitionID>4</PartitionID> <Format>NTFS</Format> <Label>Windows</Label> <Letter>C</Letter> </ModifyPartition> <ModifyPartition wcm:action="add"> <Order>5</Order> <PartitionID>5</PartitionID> <Format>NTFS</Format> <Label>Logical2</Label> <Letter>D</Letter> <Extend>true</Extend> </ModifyPartition> </ModifyPartitions> </Disk> </DiskConfiguration> <ImageInstall> <OSImage> <InstallTo> <DiskID>0</DiskID> <PartitionID>4</PartitionID> </InstallTo> </OSImage> </ImageInstall>