CreatePartitionCreatePartition

CreatePartition 指定要在硬盘上创建的单个分区。CreatePartition specifies a single partition to create on the hard disk.

如果要将 Windows 安装到空白硬盘,则必须使用 CreatePartitionModifyPartition 来创建和格式化磁盘上的分区。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. 还必须将值添加到 InstallToInstallToAvailablePartition 以指定 Windows 的安装位置。You must also add values to either InstallTo or InstallToAvailablePartition to specify where to install Windows.

子元素Child Elements

设置Setting 说明Description
延长Extend 指定是否扩展分区以填充磁盘。Specifies whether to extend the partition to fill the disk.
OrderOrder 指定多个分区的创建顺序。Specifies the creation order for multiple partitions.
大小Size 指定要创建的分区大小,以 mb 为单位。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

windowsPEwindowsPE

父层次结构Parent Hierarchy

Microsoft-Windows-设置 | DiskConfiguration | 磁盘 | CreatePartitions | CreatePartitionMicrosoft-Windows-Setup | DiskConfiguration | Disk | CreatePartitions | CreatePartition

应用于Applies To

有关此组件支持的 Windows 版本和体系结构的列表,请参阅 Microsoft-Windows-设置For a list of the supported Windows editions and architectures that this component supports, see Microsoft-Windows-Setup.

XML 示例XML Example

以下设置的 XML 输出 DiskConfiguration 显示了如何创建驱动器分区。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>

有关完整的 XML 示例和推荐的分区配置,请参阅 如何配置基于 UEFI/GPT 的硬盘分区如何配置基于 BIOS/MBR 的硬盘分区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.

CreatePartitionsCreatePartitions