DiskPart Commands to Clean and Format a USB or fixed Disk

24th January 2015 0 By Simon

I put together this little post to help people clean and format their USB or fixed disk in Windows 8.1, I needed this because some of my USB drives have previously been formatted with ESXi or Linux installed on them and this was the easiest way to bring them back to a useable format.

Continue after the break to see how to clean your ESXi or Linux formatted drive

Run an elevated command prompt or type diskpart in the search panel to bring up the DiskPart utility.



Type list disk to get a list of the disks in the computer.


Type sel disk 2 to choose the USB drive, your disk number may change depending on the amount of fixed drives you have installed. Important to note that sel is short for select, you don’t need to use the full word.


Type clean to remove all partition or volume formatting from the drive. On master boot record (MBR) disks, only the MBR partitioning information and hidden sector information is overwritten. On GUID partition table (GPT) disks, the GPT partitioning (and Protective MBR) information is overwritten.


Running list disk shows that the drive has now had the drive cleaned and that there is space available to use.


Type create part pri (you can shorten this further to cre part pri) will create a primary partition on the current basic disk.


Type format fs=ntfs quick to format the new partition with the NTFS file system, you can ignore the fs=ntfs command and the disk will be formatted with FAT32 by default.


Type active to mark the partition or volume as a valid system partition or system volume.


Type exit to close the program