In this article, we will learn how to use the Windows built-in disk partitioning tool to manage your disks.

Hard drive failures due to logical or physical problems are commonplace. Unfortunately, there is no clear way to determine when or how a drive can fail. What we can try, however, is to make a corrupted disk usable.

This is where the DiskPart tool comes in. Here’s how you can use DiskPart to erase, reformat, and partition a drive that’s ready for use.


What is DiskPart?

DiskPart is a command line utility provided by Microsoft with Windows 10. In other words, DiskPart is built into every Windows computer, so you don’t need to download it separately.

DiskPart allows you to erase data from a local or external drive, reformat the drives in any file system of your choice, and create new volumes from an existing block of storage.

DiskPart being a command line tool, you need to know some commands and their syntax and options to use it.

How to reformat a drive using DiskPart?

While physical problems can never be corrected by a software tool, you can solve logical problems by reformatting a drive.

Reformatting a drive involves cleaning the drive, deleting all data on it, and formatting the drive with the file system of your choice. The process is simple, but it results in irreparable loss of data; therefore, back up your files before proceeding.

Open DiskPart and select a disk

Open DiskPart en typing diskpart in the search bar of start menu, then selecting the best match. This will open a Command Prompt window with DiskPart already selected. To get a list of all available commands, type the command help puis press Entrance.

With the command line window open, type list disk and press Entrance. You will see a list of all available drives displayed on the screen. You will see the disk number in the first column, the status in the next column, and the size and free space in the following columns. You can ignore the last two columns, as they will be empty if your disk is functioning properly.

From the list, find the drive you want to format. You can find the drive by its size. If you don’t know the size, remove the disk, run the command again list disk and write down the disk numbers from the first column. Reconnect the drive, run the command, and you’ll see a new disk number listed. This is your disk, write down its number.

Now choose the disk by typing select disk DISK-NUMBER, replacing DISK-NUMBER by the actual disk number that you previously noted in the list.

For example, if I want to select the disc 2, type the command select disk 2. Finally, press the key Entrance.

You will see a confirmation message telling you that your storage drive is selected. To check it, type list disk and press Entrance. The displayed list of disks indicates the selected disk with an asterisk (*) in front of the disc number.

If you want to change the disc, repeat the select command with the desired disc number.

Clean up and partition the drive

Before reformatting, make sure you have backed up your data. Then type the command clean and press the key Entrance. This will erase all data on your drive. After DiskPart successfully wipes the disk, a message is displayed on the screen.

After cleaning the drive, you are ready to reformat it.

One last thing before you move on to reformatting: you need to partition your drive before you can use it again. After cleaning the disk, your computer will no longer recognize the disk as a storage unit. So you need to partition it into one or more blocks for your computer to recognize the device.

You may also want to consider partitioning your storage drive with multiple file systems if you are going to use it with different operating systems. For example, you can partition part of storage in exFat for Windows and part in macOS Extended Partition for use with Macs.

But for now, we’re only going to partition the drive into a single block of storage. Type the command create partition primary or create part pri and press Entrance. This will partition the drive into a single block.

After partitioning, be sure to activate the partition, as your computer can only use one active partition. Type the command active and press the key Entrance. The partition you just created will then become an active partition.

Format the drive with a new file system

Finally, you can now reformat the drive.

Enter the command format fs = FILE-SYSTEM label = DRIVE-LABEL quick and press Entrance. Be sure to replace FILE-SYSTEM by the filesystem of your choice (such as NTFS, FAT or exFAT) and LABEL by the name of the reader.

For example, if you are formatting a removable USB drive to store music on it, replace FILE-SYSTEM through ” exfat “And LABEL by” Music “(Which gives the command format fs = exfat label = music quick).

A confirmation message is displayed to let you know that the drive has been formatted.

Assign a letter to the new drive

The last step in the process is to assign a letter to your storage drive. Windows needs these letters to display drives in File Explorer. In most cases, the letters “C”, “D” and “E” are already in use by internal storage devices. So choose another one.

In any case, be sure to assign a letter that is not already in use by your internal readers.

Enter the command assign letter = DRIVE-LETTER, replacing DRIVE-LETTER with the desired drive letter (for example: assign letter = f for the letter F) and press Entrance. You will receive a confirmation message telling you that the letter has been assigned.

Now check that you have done everything correctly by typing the command list volume and press Entrance. The drive you just formatted will be preceded by an asterisk (*) and will reflect any properties you specified during the process.

Close the command line utility DiskPart while typing exit and pressing Entrance.


Reformatting only works to resolve logical issues. Unfortunately, we cannot solve all storage issues by reformatting. If your drive is repeatedly corrupting or not showing up after reformatting, it may indicate a hardware failure. And no one can solve a hardware problem with a software tool.

Unfortunately, that means you will have to spend some money and buy a new disc.

About the author


Leave a Comment