Compartir a través de


Create UEFI-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 describes how to configure disk partitions for a Unified Extensible Firmware Interface (UEFI)-based computer.

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

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

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

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

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

Default Configuration

The following diagram and XML output show 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>

      <!-- EFI system partition (ESP) -->
      <CreatePartition wcm:action="add">
        <Order>1</Order> 
        <Type>EFI</Type> 
        <Size>100</Size> 
      </CreatePartition>

      <!-- Microsoft reserved partition (MSR) -->
      <CreatePartition wcm:action="add">
        <Order>2</Order> 
        <Type>MSR</Type> 
        <Size>128</Size> 
      </CreatePartition>

      <!-- Windows partition -->
      <CreatePartition wcm:action="add">
        <Order>3</Order> 
        <Type>Primary</Type> 
        <Extend>true</Extend> 
      </CreatePartition>

    </CreatePartitions>
    <ModifyPartitions>

      <!-- EFI system partition (ESP) -->
      <ModifyPartition wcm:action="add">
        <Order>1</Order> 
        <PartitionID>1</PartitionID> 
        <Label>System</Label> 
        <Format>FAT32</Format> 
      </ModifyPartition>

      <!-- MSR partition does not need to be modified -->

      <!-- Windows partition -->
      <ModifyPartition wcm:action="add">
        <Order>2</Order> 
        <PartitionID>3</PartitionID> 
        <Label>Windows</Label> 
        <Letter>C</Letter> 
        <Format>NTFS</Format> 
      </ModifyPartition>
    </ModifyPartitions>
  </Disk>


  <WillShowUI>OnError</WillShowUI> 
</DiskConfiguration>


<ImageInstall>
  <OSImage>
    <InstallTo>
      <DiskID>0</DiskID> 
      <PartitionID>3</PartitionID> 
    </InstallTo>
  </OSImage>
</ImageInstall>

The following diagram and XML output show the Autounattend.xml disk configuration settings for a system with the recommended configuration: a Windows RE tools partition, a system partition, an MSR partition, and a recovery image partition.

<DiskConfiguration>
  <Disk wcm:action="add">
    <DiskID>0</DiskID> 
    <WillWipeDisk>true</WillWipeDisk> 
    <CreatePartitions>
      <!-- WinRE tools partition -->
      <CreatePartition wcm:action="add">
        <Order>1</Order> 
        <Type>Primary</Type> 
        <Size>300</Size> 
      </CreatePartition>

      <!-- EFI system partition (ESP) -->
      <CreatePartition wcm:action="add">
        <Order>2</Order> 
        <Type>EFI</Type> 
        <Size>100</Size> 
      </CreatePartition>

      <!-- Microsoft reserved partition (MSR) -->
      <CreatePartition wcm:action="add">
        <Order>3</Order> 
        <Type>MSR</Type> 
        <Size>128</Size> 
      </CreatePartition>

      <!-- Windows partition -->
      <CreatePartition wcm:action="add">
        <Order>4</Order> 
        <Type>Primary</Type> 
        <Size>75000</Size> 

      </CreatePartition>

      <!-- Recovery image partition -->
      <CreatePartition wcm:action="add">
        <Order>5</Order> 
        <Type>Primary</Type> 
        <Size>15000</Size> 
      </CreatePartition>

    </CreatePartitions>

    <ModifyPartitions>
      <!-- WinRE tools partition -->
      <ModifyPartition wcm:action="add">
        <Order>1</Order> 
        <PartitionID>1</PartitionID> 
        <Label>WinRE</Label> 

        <Format>NTFS</Format> 
        <TypeID>de94bba4-06d1-4d40-a16a-bfd50179d6ac</TypeID> 
      </ModifyPartition>

      <!-- EFI system partition (ESP) -->
      <ModifyPartition wcm:action="add">
        <Order>2</Order> 
        <PartitionID>2</PartitionID> 
        <Label>System</Label> 
        <Format>FAT32</Format> 
      </ModifyPartition>

      <!-- MSR partition does not need to be modified -->
        <Order>3</Order> 
        <PartitionID>3</PartitionID> 

      <!-- Windows partition -->
      <ModifyPartition wcm:action="add">
        <Order>4</Order> 
        <PartitionID>4</PartitionID> 
        <Label>Windows</Label> 
        <Letter>C</Letter> 
        <Format>NTFS</Format> 
      </ModifyPartition>

      <!—Recovery image partition -->
      <ModifyPartition wcm:action="add">
        <Order>5</Order> 
        <PartitionID>5</PartitionID> 
        <Label>Recovery image</Label> 
        <Format>NTFS</Format> 
        <TypeID>de94bba4-06d1-4d40-a16a-bfd50179d6ac</TypeID> 
      </ModifyPartition>
    </ModifyPartitions>
  </Disk>


  <WillShowUI>OnError</WillShowUI> 
</DiskConfiguration>


<ImageInstall>
  <OSImage>
    <InstallTo>
      <DiskID>0</DiskID> 
      <PartitionID>4</PartitionID> 
    </InstallTo>
  </OSImage>
</ImageInstall>

See Also

Concepts

Understanding Disk Partitions