How to use DiskPart to clean and format a drive
How to use DiskPart to clean and format a drive
Important: Using DiskPart will completely erase everything on the drive you select,
making it impossible to undo any changes. It's crucial that you correctly choose the
drive you want to clean and format.
diskpart
4. Type the following command to list all the available drives and press Enter:
list disk
5. Take your time and very carefully, on the output from the previous command,
identify the drive you want to clean.
Use the following command to select the drive and press Enter:
select disk 3 (the number will be whichever drive you want to clean)
Remember to change 3 in the command with the number of the drive you want to
clean. If you fail to choose the correct number will erase all the data from the wrong
drive.
6. Type the following command to clean the drive and press Enter:
clean
7. Type the following command to double-check the drive still selected and press Enter:
list disk
If the drive still selected, you will notice an asterisk (*) next to the disk.
9. Type the following command to select the partition you just created and press Enter:
select partition 1
10. Type the following command to set the partition active and press Enter:
active
11. Type the following command to format the partition using NTFS and to set a label,
and press Enter:
Remember to change the WC-Drive in the command with the drive name you want
to use.
12. Type the following command to assign a drive letter and press Enter:
assign letter=W
Remember to change W in the command with a letter you want that isn't in use by
another drive on This PC.
13. Use the exit command to close DiskPart to complete the task.
Again, using this guide, remember to take your time and carefully select the drive
you want to repair. If you have multiple external drives connected to your computer,
it's a good idea to temporary disconnect them before proceeding to reduce the
chances of erasing the wrong drive.
Keep in mind that while there is many other tools to format a drive, DiskPart is likely
to be your best choice when you're dealing with data corruption, drive inaccurately
showing the storage capacity, and other serious problems.