這篇算是維修 hp storage easy 1650 ,其實是維修到一半才來翻文章惡補的指令。

DiskPart 命令列選項文多參照微軟介紹!!

至於為何要複習這個指令主要是跟開機有關係

# CMD Proccess of Clean and Format

  1. diskpart(執行Diskpart公用程式)
  2. list disk(確認隨身碟的磁碟代碼)
  3. select disk #(指定工作磁碟,#為隨身碟代碼)
  4. clean(清除所選的磁碟內容)
  5. create partition primary(建立主分割區)
  6. format fs=ntfs quick(格式化新磁區)
  7. active(將該磁區設定為使用中)
複製代碼



# GPT & MBR

UEFI: Convert to GPT partition format after clean by DiskPart

  1. diskpart
  2. list disk
  3. select disk <disk number>
  4. clean
  5. convert gpt
  6. exit
複製代碼



Legacy BIOS Compatibility mode: Convert to MBR partition format after clean by DiskPart

  1. diskpart
  2. list disk
  3. select disk <disk number>
  4. clean
  5. exit
複製代碼

新版的BIOS都是UEFI介面才是這次最大的問題因為最主要的是硬碟格是不一樣。

文多參照微軟介紹!!使用 Windows PE 和 DiskPart 設定 UEFI/GPT 型硬碟磁碟分割

undefined

undefined

 

將下列程式碼儲存為 CreatePartitions.txt,然後使用 DiskPart 工具執行自動化設定系統、MSR 及 Windows 磁碟分割的指令碼。

 
 
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"

將下列程式碼儲存為 CreatePartitions.txt,然後使用 DiskPart 工具執行自動化設定 Windows RE 工具磁碟分割、系統、MSR、Windows 以及復原映像磁碟分割的指令碼。

 
 
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

為 Windows RE 工具和復原映像磁碟分割提供額外保護

 

如果使用建議的 DiskPart 指令碼,使用者在檔案總管中就看不到 Windows RE 工具磁碟分割和復原映像磁碟分割。不過,他們使用磁碟管理工具即可看到並移除復原映像磁碟分割。

如果您要防止使用者利用磁碟管理工具來移除磁碟分割,則建立磁碟分割時可以將下列 DiskPart 命令新增至指令碼中。

 
 
gpt attributes=0x8000000000000001

這個 DiskPart 命令會結合 GPT_ATTRIBUTE_PLATFORM_REQUIRED (0x0000000000000001) 和 GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER (0x8000000000000000) 屬性。如需詳細資訊,請參閱 DiskPart:GPT

以上為切相容 UEFI介面的 BIOS 開機硬碟

基本使用

其他請參閱~文章 UEFI 跟 GPT 關連 

微軟 :

建議的 UEFI 型磁碟分割設定

設定 UEFI/GPT 型硬碟磁碟分割

Diskpart 指令行公用程式的說明

Windows 安裝程式:使用 MBR 或 GPT 磁碟分割樣式安裝

範例:使用 Windows PE 和 DiskPart 設定 UEFI/GPT 型硬碟磁碟分割

使用 DiskPart 指令建立磁碟與磁碟區

T客幫 : 大容量硬碟、UEFI 系統進階玩法:GPT / MBR 分割表格式無損輕鬆互轉

解讀BIOS+MBR以UEFI+GPT及 電腦小白科普篇

EFI、UEFI、MBR、GPT的區別

將 Windows 7 從 BIOS (MBR) 轉為 UEFI (GPT) 格式開機

修復Windows 8 無法進入系統-BCDBOOT指令

免工具,透過指令用 USB 隨身碟製作 Windows 7 安裝碟

[Windwos] Diskpart 工具(命令提示字元):格式化 | MBR轉GPT

建立安裝 Windows 7 的隨身碟

Windows 8 + UEFI 快速啟動/快速開機


arrow
arrow

    sungshu 發表在 痞客邦 留言(3) 人氣()