Format USB Disk Using DiskPart Yields "No volume selected" Error

I use the following diskpart.exe sequence. I want to specify the disk number and then format the disk.

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>

As you can see, the script should work and might on Windows 7, as several pages searched on the internet says that, but on my Windows 10 installation I get

There is no volume selected

This article does not apply. The author really did forget the create primary partition. Ditto here.

As you can see from this screenshot, there definitely is a volume on Disk 2.

diskpart showing a single volume

My USB flash drive has a single volume, so format should work.

Thoughts?

2 Answers

The code is almost correct, but here is the fragment that is missing. Modify it according to your needs.

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

I ran into this same issue, and for the record, it worked after a reboot (it wouldn't let go of the disk to format it) and trying in CMD rather than Powershell. This worked:

  1. Run CMD
  2. Type "diskpart" and hit enter
  3. In the diskpart window, type "list disk" and hit enter
  4. Note the disk number of your USB device to use later
  5. Type "sel dis 1" changing out the number 1 for whatever number your USB device was in step 4. Hit enter
  6. Type "clean" and hit enter
  7. Type "cre par pri size=30000" and hit enter
  8. Type "sel par 1" and hit enter
  9. Type "active" and hit enter
  10. Type "format fs=fat32 quick" and hit enter
  11. Type "assign" and hit enter
  12. Close the diskpart and CMD windows.

I'm trying to prepare a 50+GB USB stick as a <32GB FAT32 partitioned boot device.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like