承上

經由

Windows Answer File Generator

取得的無人值守自動安裝的描述檔案內

可以看到一個區段內寫著

語法:
<DiskConfiguration>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
<Size>100</Size>
</CreatePartition>
<CreatePartition wcm:action="add">
<Extend>true</Extend>
<Order>2</Order>
<Type>Primary</Type>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Format>NTFS</Format>
<Label>System Reserved</Label>
<Order>1</Order>
<PartitionID>1</PartitionID>
<TypeID>0x27</TypeID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Format>NTFS</Format>
<Label>OS</Label>
<Letter>C</Letter>
<Order>2</Order>
<PartitionID>2</PartitionID>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
</DiskConfiguration>
這個區段描述的是自動幫忙切割硬碟的分區(MBR)

其中會有初始的100MB的多餘分區<---我習慣不要這個 另外我都是手動分割

可是目前已經2015年

很多PC/NB早已不使用傳統的BIOS 

而改用UEFI模式了

雖說UEFI也可以支援MBR的硬碟開機模式

但是  但是  但是

MS很OOXX的做出限制

UEFI

除非你的安裝源是  DVD/ NTFS格式的USB

不然

UEFI 唯一選配 GPT

BIOS 唯一選配 MBR
所以這個區段上

如果要自動安裝

是要做出修改的

而MS有提供一個GPT配置的範例

https://technet.microsoft.com/en-us/.../hh825702.aspx

其中Recommended這個範例有一個叫做Recovery的分區

是很不錯的

下面是MS對於自動分割配置的區段寫法

Default UEFI/GPT drive partitions
ic577711.jpg
語法:
<DiskConfiguration>

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

      <!-- Windows RE Tools partition -->
      <CreatePartition wcm:action="add">
        <Order>1</Order> 
        <Type>Primary</Type> 
        <Size>300</Size> 
      </CreatePartition>

      <!-- System partition (ESP) -->
      <CreatePartition wcm:action="add">
        <Order>2</Order> 
        <Type>EFI</Type> 
        <Size>100</Size> 
        <!-- Note: for Advanced Format Generation One drives, change to size=260 -->
      </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> 
        <Extend>true</Extend> 
      </CreatePartition>
    </CreatePartitions>

    <ModifyPartitions>
      <!-- Windows RE 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>

      <!-- 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>
    </ModifyPartitions>
  </Disk>
  <WillShowUI>OnError</WillShowUI> 
</DiskConfiguration>
或是
Recommended UEFI/GPT drive partitions
ic577712.jpg
語法:
<DiskConfiguration>
  <Disk wcm:action="add">
    <DiskID>0</DiskID> 
    <WillWipeDisk>true</WillWipeDisk> 
    <CreatePartitions>
      <!-- Windows RE Tools partition -->
      <CreatePartition wcm:action="add">
        <Order>1</Order> 
        <Type>Primary</Type> 
        <Size>300</Size> 
      </CreatePartition>

      <!-- 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>
      <!-- Windows RE 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>

      <!-- 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>
如果你比較威

討厭XML的寫法

又想要有點手動

那在UEFI/GPT部分

MS也有提供另外一個PE下的diskpart指令範例

https://technet.microsoft.com/en-us/.../hh825686.aspx

Default UEFI/GPT drive partitions
點選圖片以看大圖

名稱:IC577711.jpg
查看次數:15
檔案大小:22.2 KB
ID:25049

Save the following code as CreatePartitions.txt, and then use the DiskPart tool to run the script that automates the configuration of the System, MSR, and Windows partitions.
語法:
select disk 0
clean
convert gpt
create partition primary size=300
format quick fs=ntfs label="Windows RE tools"
assign letter="T"
create partition efi size=100
rem == Note: for Advanced Format Generation One drives, change to size=260.

format quick fs=fat32 label="System"
assign letter="S"
create partition msr size=128
create partition primary
format quick fs=ntfs label="Windows"
assign letter="W"
Recommended UEFI/GPT drive partitions
點選圖片以看大圖

名稱:IC577712.jpg
查看次數:15
檔案大小:27.3 KB
ID:25050
Save the following code as CreatePartitions.txt, and then use the DiskPart tool to run the script that automates the configuration of the System, MSR, and Windows partitions.
語法:
rem == CreatePartitions-UEFI.txt ==
rem == These commands are used with DiskPart to
rem    create five partitions
rem    for a UEFI/GPT-based PC.
rem    Adjust the partition sizes to fill the drive
rem    as necessary. ==
select disk 0
clean
convert gpt
rem == 1. Windows RE tools partition ===============
create partition primary size=300
format quick fs=ntfs label="Windows RE tools"
assign letter="T"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
rem == 2. System partition =========================
create partition efi size=100
rem    ** NOTE: For Advanced Format 4Kn drives,
rem               change this value to size = 260 ** 
format quick fs=fat32 label="System"
assign letter="S"
rem == 3. Microsoft Reserved (MSR) partition =======
create partition msr size=128
rem == 4. Windows partition ========================
rem ==    a. Create the Windows partition ==========
create partition primary 
rem ==    b. Create space for the recovery image ===
shrink minimum=15000
rem       ** NOTE: Update this size to match the size
rem                of the recovery image           **
rem ==    c. Prepare the Windows partition ========= 
format quick fs=ntfs label="Windows"
assign letter="W"
rem === 5. Recovery image partition ================
create partition primary
format quick fs=ntfs label="Recovery image"
assign letter="R"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
list volume
exit
上述參考

https://technet.microsoft.com/en-us/.../hh825702.aspx



https://technet.microsoft.com/en-us/.../hh825686.aspx