In this tutorial, I explain how you can format a hard drive or external storage drive like Pen drive, External HDD, etc using the command prompt. Before proceeding further, better you backup your all available data to prevent data loss. Follow the steps below to format a drive:
STEP 1: Open Command Prompt As Administrator
Search for CMD or command prompt, right click and run as Administrator.
STEP 2: Use Diskpart
Once command line is open, type "diskpart" and press Enter.
STEP 3: List Disk
In the Diskpart window, type "list disk" and press Enter. It will list all the available drives.
STEP 4: Select the Drive to Format
Now type "select disk (disk number)" as shown above. Specify the drive number which needs to be formatted.
STEP 5: Clean the Disk
In this step, type "clean". This command will permanent delete all files and folders, and successfully clean up the disk.
STEP 6: Create Partition Primary
To make the drive again accessible, type "create partition primary" and press enter.
STEP 7: Format the Drive
Now format the drive with FAT or NTFS file system. Type "format fs=ntfs" and press Enter.
STEP 8: Assign a Drive Letter
To assign a drive letter, you can type "assign' as shown above.