我使用以下diskpart.exe
順序。我想指定磁碟號,然後格式化磁碟。
C:\>diskpart
Microsoft DiskPart version 10.0.18362.1
Copyright (C) Microsoft Corporation.
On computer: AAAAAAA
DISKPART> select disk 2
Disk 2 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> create partition primary
DiskPart succeeded in creating the specified partition.
DISKPART> format fs=ntfs label="My USB Disk" quick
There is no volume selected.
Please select a volume and try again.
DISKPART>
正如您所看到的,該腳本應該可以工作並且可能會運行Windows 7
,正如在互聯網上搜索的幾個頁面所說的那樣,但在我的Windows 10
安裝中我得到了
沒有選擇音量
這文章不適用。作者確實忘記了create primary partition
。同上這裡。
正如您從該螢幕截圖中看到的,磁碟 2 上肯定有一個磁碟區。
我的 USB 隨身碟只有一個卷,因此format
應該可以使用。
想法?
答案1
程式碼幾乎是正確的,但這裡缺少一個片段。根據您的需要修改它。
create partition primary
select partition 1
active
format fs=ntfs label="My USB Disk" quick
assign letter=D
答案2
我遇到了同樣的問題,根據記錄,它在重新啟動後工作(它不會放開磁碟來格式化它)並在 CMD 而不是 Powershell 中嘗試。這有效:
- 運行命令
- 輸入“diskpart”並按 Enter 鍵
- 在diskpart視窗中,輸入“list disk”並按回車鍵
- 記下您的 USB 裝置的磁碟編號以供稍後使用
- 輸入“sel dis 1”,將數字 1 變更為您的 USB 裝置在步驟 4 中的編號。
- 輸入“clean”並按 Enter 鍵
- 輸入“cre par pri size=30000”並按 Enter 鍵
- 輸入“sel par 1”並按 Enter 鍵
- 輸入“active”並按回車鍵
- 輸入“format fs=fat32 fast”並按 Enter 鍵
- 輸入“分配”並按 Enter 鍵
- 關閉 diskpart 和 CMD 視窗。
我正在嘗試準備一個 50+GB 的 USB 記憶棒作為 <32GB FAT32 分割區啟動裝置。
答案3
我不知道我做了什麼,但它有效。
**
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 119 GB 1024 KB *
Disk 1 Online 931 GB 300 GB *
Disk 2 Online 29 GB 29 GB
DISKPART> select disk 2
Disk 2 is now the selected disk.
DISKPART> clean
DiskPart has encountered an error: The device is not ready.
See the System Event Log for more information.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> active
There is no partition selected.
Please select a partition and try again.
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 119 GB 1024 KB *
Disk 1 Online 931 GB 300 GB *
* Disk 2 Online 29 GB 0 B
DISKPART> select disk 2
Disk 2 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> active
There is no partition selected.
Please select a partition and try again.
DISKPART> format fs=fat32 quick
There is no volume selected.
Please select a volume and try again.
DISKPART>
C:\WINDOWS\system32>diskpart
Microsoft DiskPart version 10.0.22000.653
Copyright (C) Microsoft Corporation.
On computer: ZMBBY
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 119 GB 1024 KB *
Disk 1 Online 931 GB 300 GB *
Disk 2 Online 29 GB 29 GB
DISKPART> select disk 2
Disk 2 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> format fs=fat32 quick
There is no volume selected.
Please select a volume and try again.
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 119 GB 1024 KB *
Disk 1 Online 931 GB 300 GB *
Disk 2 Online 29 GB 29 GB
DISKPART> select disk 2
Disk 2 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> create partition primary
Virtual Disk Service error:
The object is not found.
DISKPART>
C:\WINDOWS\system32>diskpart
Microsoft DiskPart version 10.0.22000.653
Copyright (C) Microsoft Corporation.
On computer: ZMBBY
DISKPART> list diskc
Microsoft DiskPart version 10.0.22000.653
DISK - Display a list of disks. For example, LIST DISK.
PARTITION - Display a list of partitions on the selected disk.
For example, LIST PARTITION.
VOLUME - Display a list of volumes. For example, LIST VOLUME.
VDISK - Displays a list of virtual disks.
DISKPART> list dick
Microsoft DiskPart version 10.0.22000.653
DISK - Display a list of disks. For example, LIST DISK.
PARTITION - Display a list of partitions on the selected disk.
For example, LIST PARTITION.
VOLUME - Display a list of volumes. For example, LIST VOLUME.
VDISK - Displays a list of virtual disks.
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 119 GB 1024 KB *
Disk 1 Online 931 GB 300 GB *
Disk 2 Online 29 GB 0 B
DISKPART> select disk 2
Disk 2 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> create partition primary
Virtual Disk Service error:
The object is not found.
DISKPART> active
There is no partition selected.
Please select a partition and try again.
DISKPART> format fs=fat32 quick
There is no volume selected.
Please select a volume and try again.
DISKPART> create partition primary size=30000
No usable free extent could be found. It may be that there is insufficient
free space to create a partition at the specified size and offset. Specify
different size and offset values or don't specify either to create the
maximum sized partition. It may be that the disk is partitioned using the MBR disk
partitioning format and the disk contains either 4 primary partitions, (no
more partitions may be created), or 3 primary partitions and one extended
partition, (only logical drives may be created).
DISKPART> create partition primary
C:\WINDOWS\system32>diskpart
Microsoft DiskPart version 10.0.22000.653
Copyright (C) Microsoft Corporation.
On computer: ZMBBY
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 119 GB 1024 KB *
Disk 1 Online 931 GB 300 GB *
Disk 2 Online 29 GB 0 B
DISKPART> select disk 2
Disk 2 is now the selected disk.
DISKPART> clean
DiskPart succeeded in cleaning the disk.
DISKPART> create partition primary
DiskPart succeeded in creating the specified partition.
DISKPART> format fs=fat32 quick
0 percent completed
DiskPart has encountered an error: The request is not supported.
See the System Event Log for more information.
DISKPART> format fs=fat32 quick
100 percent completed
DiskPart successfully formatted the volume.
**