使用 DiskPart 格式化 USB 磁碟會產生「未選擇磁碟區」錯誤

使用 DiskPart 格式化 USB 磁碟會產生「未選擇磁碟區」錯誤

我使用以下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 上肯定有一個磁碟區。

顯示單一卷的 diskpart

我的 USB 隨身碟只有一個卷,因此format應該可以使用。

想法?

答案1

程式碼幾乎是正確的,但這裡缺少一個片段。根據您的需要修改它。

create partition primary
select partition 1
active
format fs=ntfs label="My USB Disk" quick
assign letter=D

答案2

我遇到了同樣的問題,根據記錄,它在重新啟動後工作(它不會放開磁碟來格式化它)並在 CMD 而不是 Powershell 中嘗試。這有效:

  1. 運行命令
  2. 輸入“diskpart”並按 Enter 鍵
  3. 在diskpart視窗中,輸入“list disk”並按回車鍵
  4. 記下您的 USB 裝置的磁碟編號以供稍後使用
  5. 輸入“sel dis 1”,將數字 1 變更為您的 USB 裝置在步驟 4 中的編號。
  6. 輸入“clean”並按 Enter 鍵
  7. 輸入“cre par pri size=30000”並按 Enter 鍵
  8. 輸入“sel par 1”並按 Enter 鍵
  9. 輸入“active”並按回車鍵
  10. 輸入“format fs=fat32 fast”並按 Enter 鍵
  11. 輸入“分配”並按 Enter 鍵
  12. 關閉 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.

**

答案4

嘿,體積沒什麼大不了的,你只需要選擇驅動器,在我的例子中是H驅動器,這是第8個,所以我選擇了它並繼續!

嘿下面是我的cmd進程的圖像,一定要檢查一下

希望能幫助你:
cmd進程映像

相關內容