DiskPart: a Windows build-in command-line tool to format USB drive.

Image by OpenClipart-Vectors from Pixabay
 
Recently, I try to build my very first network-attached storage(NAS) with openmediavault on an old laptop. The installation did not go well, I try to install the OS on a USB drive, so I can free up a hard disk drive for additional storage. However , the installer keeps pop-out error messages indicate my USB drive not able to create an openmediavault file system. 

After a few tries and errors, I give up this solution and plan to re-use my old 3.5mm 80GB SATA hard disk drive to be an openmediavault system drive. Now, I have to wait for the USB to SATA adapter. My USB drive corrupted, plug into the computer only prompt a message with "please insert a disk into drive". I try to select the USB drive and format it, but no option for me to do it after right-click, even I try to use Disk Management also not able to discover my USB drive.

I do some google-ing and find out Windows built-in a command-line tool call diskpart. diskpart is a tool to help users manage computer drives. Then, I type all the commands and diskpart able to detect my USB drive. I start to remove everything and format it, bring it back to normal. Before go further, if you have any critical data in your USB drive, make sure all the data backed up to prevent any data loss. The following steps will guide you to format a USB drive. 

  1. Type "cmd" on Windows Search and right-click cmd and run as administrator. 
  2. Type "diskpart" and press enter. 
  3. Type "list disk" and press enter, it will show all the available disks. 
  4. Type "select disk (disk number)" and press enter. You can refer to the list from the above step.
  5. Type "clean" and press enter, this command will permanently delete everything on your USB drive. 
  6. Type "create partition primary" and press enter, this drive will start accessible. 
  7. Type "select partition 1" and press enter to select the partition just created.
  8. Type "active" and press enter, make the partition active.
  9. Type "format fs=fat32 label=(name of the drive) quick" and press enter, this command will format your USB drive to FAT32. if you are using an external hard disk normally will format to NTFS. 
  10. Type "assign letter=(a-z)" and press enter, this command name gives the USB drive a drive letter. 
  11. Lastly, you can type "exit" and press enter, repeat it twice to close the whole cmd program. 

Inclusion, diskpart is a very useful tool to bring back my USB drive to life. Also, it built right in Windows computer no requires to download other App. If you interest in diskpart and want to learn more about this command-line tool, please visit Microsoft Docs

Extras: 

diskpart command-line step by step
step 3 - 7

diskpart command-list step by step 8 until 10
step 8 - 10


Disclaimer: English is not my native language, I'm still learning. So, if you find out my grammar mistake or you have a better suggestion on word of choice, please leave a comment below to let me know.

Next Post Previous Post
No Comment
Add Comment
comment url