大小Size

Size 指定要建立之資料分割的大小,以 mb (MB) 。Size specifies the size of the partition to create, in megabytes (MB).

Values

size_in_megabytessize_in_megabytes

指定您建立之磁碟分割的大小(以 mb 為單位)。Specifies the size of the partition that you create, in megabytes.

例如,若要建立 2 gb (GB) 分割區,請設定 Size 為2000。For example, to create a 2 gigabyte (GB) partition, set Size to 2000.

注意Note
請勿建立 Size 完全填滿或超過可用空間的值,因為 Windows 會保留少量的空間來管理磁碟分割。Do not create a value for Size that entirely fills or exceeds the available space, because Windows reserves a small amount of space to manage partitions. 例如,如果您建立具有 2000 MB 的延伸磁碟分割,並且在該資料分割內建立兩個大小為 1000 MB 的邏輯分割區,則不會建立第二個數據分割。For example, if you create an extended partition with 2000 MB, and you create two logical partitions with the size of 1000 MB each inside that partition, the second partition is not created. 系統會記錄錯誤,並結束安裝。An error is logged, and installation is terminated.

  • 若要使用主要磁碟分割填滿磁片磁碟機上的可用空間,請使用 CreatePartition: [擴充 ] 設定。To fill the available space on the drive with a primary partition, use the CreatePartition:Extend setting. 請勿設定 CreatePartition: SizeDo not set CreatePartition:Size.

  • 若要使用邏輯磁碟分割填滿延伸磁碟分割上的可用空間,請將 CreatePartition:設定 Size 為較小的值,例如 100To fill the available space on an extended partition with a logical partition, set CreatePartition:Size to a small value, such as 100. Set ModifyPartition: Extend 設為 trueSet ModifyPartition: Extend to true. 請勿設定 CreatePartition:ExtendDo not set CreatePartition:Extend. 如需詳細資訊,請參閱 如何在 BIOS-Based 硬碟上設定四個以上的磁碟分割For more information, see How to Configure More than Four Partitions on a BIOS-Based Hard Disk.

  • 請勿同時設定 CreatePartition: Size 和 CreatePartition:ExtendDo not set both CreatePartition:Size and CreatePartition:Extend. 如果指定的值 Size ,且 CreatePartition: Extend 設為 true ,則不會建立任何分割區。If a value for Size is specified and CreatePartition:Extend is set to true , no partition is created. 系統會記錄錯誤,並結束安裝。An error is logged, and installation is terminated.

有效的設定階段Valid Configuration Passes

windowsPEwindowsPE

父階層Parent Hierarchy

microsoft-windows-設定- | DiskConfiguration | 磁片 | CreatePartitions | CreatePartition | 大小microsoft-windows-setup- | DiskConfiguration | Disk | CreatePartitions | CreatePartition | Size

套用至Applies To

如需此元件支援的支援 Windows 版本與架構清單,請參閱 microsoft windows 安裝程式For a list of supported Windows editions and architectures that this component supports, see microsoft-windows-setup-.

XML 範例XML Example

設定主要磁碟分割以填滿磁片磁碟機上的可用空間Setting a Primary Partition to Fill the Available Space on a Drive

下列設定的 XML 輸出 DiskConfiguration 顯示如何在 BIOS 型系統上的硬碟上建立兩個磁碟分割。The following XML output for the DiskConfiguration setting shows how to create two partitions on a hard drive on a BIOS-based system. 第一個分割區是 300 MB。The first partition is 300 MB. 第二個磁碟分割會擴充以填滿硬碟的其餘部分。The second partition extends to fill the remainder of the hard disk.

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

設定邏輯資料分割以填滿延伸磁碟分割中的可用空間Setting a Logical Partition to Fill the Available Space in an Extended Partition

下列設定的 XML 輸出 DiskConfiguration 顯示如何建立延伸磁碟分割,以填滿 BIOS 型系統上的其餘磁片磁碟機。The following XML output for the DiskConfiguration setting shows how to create an extended partition that fills the remainder of the drive on a BIOS-based system. 擴展分割區包含兩個邏輯分割區。The extended partition includes two logical partitions. 第一個邏輯分割區是 15 GB。The first logical partition is 15 GB. 第二個邏輯分割區會延伸以填滿延伸磁碟分割的其餘部分。The second logical partition extends to fill the remainder of the extended partition.

<DiskConfiguration>

  <Disk wcm:action="add">
    <DiskID>0</DiskID> 
    <WillWipeDisk>true</WillWipeDisk> 
    <CreatePartitions>

      <!-- Recovery partition -->
      <CreatePartition wcm:action="add">
        <Order>1</Order> 
        <Type>Primary</Type> 
        <Size>3000</Size> 
      </CreatePartition>

      <!-- Utility2 partition -->
      <CreatePartition wcm:action="add">
        <Order>2</Order> 
        <Type>Primary</Type> 
        <Size>250</Size> 
      </CreatePartition>

      <!-- System partition -->
      <CreatePartition wcm:action="add">
        <Order>3</Order> 
        <Type>Primary</Type> 
        <Size>100</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>15000</Size> 
      </CreatePartition>

      <!-- Logical2 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 with an initial size of 100 MB.
                     This will be changed in the ModifyPartition section. -->
      </CreatePartition>

    </CreatePartitions>
    <ModifyPartitions>

      <!-- Recovery partition -->
      <ModifyPartition wcm:action="add">
        <Order>1</Order> 
        <PartitionID>1</PartitionID> 
        <Label>Recovery</Label> 
        <Format>NTFS</Format> 
        <TypeID>0x27</TypeID>
      </ModifyPartition>

      <!-- Utility2 partition -->
      <ModifyPartition wcm:action="add">
        <Order>2</Order> 
        <PartitionID>2</PartitionID> 
        <Label>Utility2</Label> 
        <Letter>U</Letter> 
        <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 receive a partition number, 
           nor does it need to be modified -->

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

      <!-- Logical2 partition -->
      <ModifyPartition wcm:action="add">
        <Order>5</Order> 
        <PartitionID>5</PartitionID> 
        <Label>Logical2</Label> 
        <Letter>L</Letter> 
        <Format>NTFS</Format> 
        <Extend>true</Extend>
          <!-- Note: When modifying a logical partition, setting
                     "ModifyPartition|Extend=true" sets the partition to  
                     fill the remainder of the extended partition.
                     This overrides the "CreatePartition|Size" value. -->
      </ModifyPartition>

    </ModifyPartitions>
  </Disk>
  <WillShowUI>OnError</WillShowUI> 
</DiskConfiguration>


<ImageInstall>
  <OSImage>
    <InstallTo>
      <DiskID>0</DiskID> 
      <PartitionID>4</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.

CreatePartitionCreatePartition

如何在 BIOS-Based 硬碟上設定四個以上的磁碟分割How to Configure More than Four Partitions on a BIOS-Based Hard Disk