Using DISKPART on Windows 10 to configure a USB stick

Windows 10 comes with a handy little utility that enables USB drives to be wiped and configured from a command prompt. This is particularly handy if you’ve been using the USB stick with Linux or some other non-Windows operating system and wish to get the USB card back to something that can be used on a Windows box. This utility is called DISKPART. I use this utility frequently when  I have access to only a Windows box and wish to wipe a USB stick.

** DISCLAIMER: Use DISKPART carefully! It can wipe disks clean very easily and swiftly. Use the information below AT YOUR OWN RISK.

Plug in the USB drive.

Now, since DISKPART uses some low-level disk functions, it must be run as a user with administrator privileges. In the Windows Search bar, usually at the bottom left of the main bar, type cmd (without <RETURN>). When you see the Command Prompt icon as the best match returned, right-click it and choose Run as administrator. This’ll get you a command prompt with admin privileges.

From the command prompt type DISKPART

This brings up another command prompt window in which the DISKPART utility is started, at the DISKPART> prompt.

First, list the disks that are available with LIST DISK <RETURN>. You’ll see a list of the disks in the system, all numbered. The lower numbered disk are likely your fixed disks. Before proceeding ensure you are able to identify absolutely your USB disk and its number.

Next, select your USB drive with SELECT DISK #, where # is the number of your USB stick. For example, it might be SELECT DISK 5.

Once selected, you’ll want to clear the disk. Issue the command CLEAN. You should see the message Diskpart succeeded in cleaning the disk

Once the disk is cleaned, you can go about creating a new partition. Issue the command CREATE PARTITION PRIMARY. You should see the message Diskpart succeeded in creating the specified partition.

The new partition needs to be formatted. First select it with SELECT PARTITION 1. You should see the message Partition 1 is now the selected partition.

This partition needs to be made an active partition, so issue ACTIVE. You should see the message Diskpart marked the current partition as active.

Now you are ready to format the partition. Issue FORMAT FS=FAT32 QUICK. You should see a message reporting on the progress of the format, which is usually quite quick with the QUICK option set. You’ll see the message Diskpart successfully formatted the volume. when it is complete.

[There are several option for the FORMAT command. If you want to format the USB stick with the NTFS filesystem then use FS=NTFS instead. Likewise, you can specify a volume label by appending LABEL=<name> where <name> is your volume label.]

All that remains is to assign the new volume a drive letter so that Windows can access it. Issue ASSIGN LETTER=# where # is the drive letter you wish to assign. You’ll see the message Diskpart successfully assigned the drive letter or mount point.

Then enter EXIT and you will have succeeded in wiping, reformatting and preparing the USB drive for use.

Command Summary:

LIST DISK
SELECT DISK #
CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=32 QUICK
ASSIGN LETTER=#
EXIT

Be the first to comment

Leave a Reply

Your email address will not be published.


*