Compartilhar via


CreatePartition

Applies To: Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista

CreatePartition specifies a single partition to create on the hard disk.

If you are installing Windows® to a blank hard disk, you must use CreatePartition and ModifyPartition to create and to format partitions on the disk. You must also add values to either InstallTo or InstallToAvailablePartition to specify where to install Windows.

Child Elements

Extend

Specifies whether to extend the partition to fill the disk.

Order

Specifies the creation order for multiple partitions.

Size

Specifies the size of the partition to create, in megabytes.

Type

Specifies the type of partition to create. For example, you can specify a primary partition type or an extended partition type.

Valid Configuration Passes

windowsPE

Parent Hierarchy

Microsoft-Windows-Setup | DiskConfiguration | Disk | CreatePartitions | CreatePartition

Applies To

For a list of the supported Windows editions and architectures that this component supports, see Microsoft-Windows-Setup.

XML Example

The following XML output for the DiskConfiguration setting shows how to create a drive 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>
        <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>

For full XML examples and recommended partition configurations, see How to Configure UEFI/GPT-Based Hard Disk Partitions or How to Configure BIOS/MBR-Based Hard Disk Partitions.

See Also

Concepts

CreatePartitions