Create BIOS-based Hard-Disk Partitions by Using Windows SIM
Applies To: Windows 7, Windows Server 2008 R2
Note
This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.
This topic discusses how to create a customized hard disk partition structure for a BIOS-based computer during Windows® Setup.
In this topic:
Plan Your Partition Structure
To prepare the hard disks
To create the partitions
To modify the partitions
To identify the Windows partition
XML Example
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 use 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
Note the differences among these parts of the partition structure:
- An extended partition, which is a container for logical partitions.
- The setting that defines which of the primary or extended partitions fills the remaining space on a hard drive: Microsoft-Windows-Setup
\DiskConfiguration\Disk\CreatePartitions\CreatePartition\Extend
.
- The setting that defines which logical partition fills the remaining space within the extended partition: Microsoft-Windows-Setup
\DiskConfiguration\Disk\ModifyPartitions\ModifyPartition\Extend
.
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 as
Type = 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.
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.
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) |
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
Default Configuration
The following diagram and XML output show Autounattend.xml Disk Configuration settings for the standard configuration: a system partition and a Windows partition.
<DiskConfiguration>
<Disk wcm:action="add">
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
<CreatePartitions>
<!-- System partition -->
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
<Size>300</Size>
</CreatePartition>
<!-- Windows partition -->
<CreatePartition wcm:action="add">
<Order>2</Order>
<Type>Primary</Type>
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<!-- System partition -->
<ModifyPartition wcm:action="add">
<Order>1</Order>
<PartitionID>1</PartitionID>
<Label>System</Label>
<Letter>S</Letter>
<Format>NTFS</Format>
<Active>true</Active>
</ModifyPartition>
<!-- Windows partition -->
<ModifyPartition wcm:action="add">
<Order>2</Order>
<PartitionID>2</PartitionID>
<Label>Windows</Label>
<Letter>C</Letter>
<Format>NTFS</Format>
</ModifyPartition>
</ModifyPartitions>
</Disk>
<WillShowUI>OnError</WillShowUI>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>2</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
Recommended Configuration: System Recovery
The following diagram and XML output show Autounattend.xml Disk Configuration settings for the recommended configuration: a system partition, a Windows partition, and a recovery image partition:
<DiskConfiguration>
<Disk wcm:action="add">
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
<CreatePartitions>
<!-- System partition -->
<CreatePartition wcm:action="add">
<Order>2</Order>
<Type>Primary</Type>
<Size>350</Size>
</CreatePartition>
<!-- Windows partition -->
<CreatePartition wcm:action="add">
<Order>3</Order>
<Type>Primary</Type>
<Size>75000</Size>
</CreatePartition>
</CreatePartitions>
<!-- Recovery image partition -->
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
<Size>15000</Size>
</CreatePartition>
<ModifyPartitions>
<!-- System partition -->
<ModifyPartition wcm:action="add">
<Order>1</Order>
<PartitionID>1</PartitionID>
<Label>System</Label>
<Letter>S</Letter>
<Format>NTFS</Format>
<Active>true</Active>
</ModifyPartition>
<!-- Windows partition -->
<ModifyPartition wcm:action="add">
<Order>2</Order>
<PartitionID>2</PartitionID>
<Label>Windows</Label>
<Letter>C</Letter>
<Format>NTFS</Format>
</ModifyPartition>
<!-- Recovery image partition -->
<ModifyPartition wcm:action="add">
<Order>3</Order>
<PartitionID>3</PartitionID>
<Label>Recovery</Label>
<Format>NTFS</Format>
<TypeID>0x27</TypeID>
</ModifyPartition>
</ModifyPartitions>
</Disk>
<WillShowUI>OnError</WillShowUI>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>2</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
Using a Single Partition
The following diagram and XML output shows Autounattend.xml Disk Configuration settings for a system with a single Windows partition:
<DiskConfiguration>
<Disk wcm:action="add">
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
<CreatePartitions>
<!-- Windows partition -->
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<!-- Windows partition -->
<ModifyPartition wcm:action="add">
<Order>1</Order>
<PartitionID>1</PartitionID>
<Label>Windows</Label>
<Format>NTFS</Format>
</ModifyPartition>
</ModifyPartitions>
</Disk>
<WillShowUI>OnError</WillShowUI>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
Using More Than Four Partitions
The following diagram and XML output show Autounattend.xml Disk Configuration settings for a system with primary partitions, and an extended partition containing two logical partitions:
<DiskConfiguration>
<Disk wcm:action="add">
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
<CreatePartitions>
<!-- Utility1 partition -->
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
<Size>350</Size>
</CreatePartition>
<!-- Utility2 partition -->
<CreatePartition wcm:action="add">
<Order>2</Order>
<Type>Primary</Type>
<Size>200</Size>
</CreatePartition>
<!-- System partition -->
<CreatePartition wcm:action="add">
<Order>3</Order>
<Type>Primary</Type>
<Size>350</Size>
</CreatePartition>
<!-- Extended partition -->
<CreatePartition wcm:action="add">
<Order>4</Order>
<Type>Extended</Type>
<Extend>true</Extend>
</CreatePartition>
<!-- Windows partition -->
<CreatePartition wcm:action="add">
<Order>5</Order>
<Type>Logical</Type>
<Size>75000</Size>
</CreatePartition>
<!-- Recovery image partition -->
<CreatePartition wcm:action="add">
<Order>6</Order>
<Type>Logical</Type>
<Size>100</Size>
<!-- Note: To create a logical partition that fills
the rest of the extended partition, create the
data partition so that it has an initial size of 100.
This will be changed in the ModifyPartition section. -->
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<!-- Recovery partition -->
<ModifyPartition wcm:action="add">
<Order>1</Order>
<PartitionID>1</PartitionID>
<Label>Utility1</Label>
<Format>NTFS</Format>
<TypeID>0x27</TypeID>
</ModifyPartition>
<!-- Utility partition -->
<ModifyPartition wcm:action="add">
<Order>2</Order>
<PartitionID>2</PartitionID>
<Label>Utility2</Label>
<Format>NTFS</Format>
<TypeID>0x27</TypeID>
</ModifyPartition>
<!-- System partition -->
<ModifyPartition wcm:action="add">
<Order>3</Order>
<PartitionID>3</PartitionID>
<Label>System</Label>
<Format>NTFS</Format>
<Active>true</Active>
</ModifyPartition>
<!-- Extended partition:
This partition does not need to receive a partition number.
It also does not need to be modified. -->
<!-- Windows partition -->
<ModifyPartition wcm:action="add">
<Order>4</Order>
<PartitionID>4</PartitionID>
<Label>Windows</Label>
<Format>NTFS</Format>
</ModifyPartition>
<!-- Recovery image partition -->
<ModifyPartition wcm:action="add">
<Order>5</Order>
<PartitionID>5</PartitionID>
<Label>Recovery image</Label>
<Format>NTFS</Format>
<Extend>true</Extend>
<!-- Note: When you modify a logical partition, setting
"ModifyPartition|Extend=true" sets the partition to
fill the remainder of the extended partition.
This overrides the "CreatePartition|Size" value. -->
<TypeID>0x27</TypeID>
</ModifyPartition>
</ModifyPartitions>
</Disk>
<WillShowUI>OnError</WillShowUI>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>4</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>