How to fix drive problems with DiskPart on Windows 10

To use DiskPart to fix storage drive issues on Windows 10, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to run DiskPart and press Enter:

    diskpart

  4. Type the following command to list all the active drives and press Enter:

    list disk

  5. Type the following command to select the drive that you want to clean and press Enter:

    select disk DISK-NUMBER

    In the command, replace DISK-NUMBER with the drive number you want to repair as it appears in the "Disk" column. If you do not perform this step correctly, you could erase the wrong drive. Proceed with caution.

  6. Type the following command to wipe out the drive and press Enter:

    clean

     

  7. Type the following command to confirm the drive still selected and press Enter:

    lisk disk

    Quick note: The output should include an asterisk (*) next to the selected drive.

  8. Type the following command to create a new partition and press Enter:

    create partition primary

     

  9. Type the following command to select the new primary partition and press Enter:

    select partition 1

  10. Type the following command to make the partition active and press Enter:

    active

  11. Type the following command to format the partition using the NTFS file system, set a drive label, and press Enter:

    format fs=FILE-SYSTEM label=DRIVE-LABEL quick

    In the command, replace FILE-SYSTEM with the name of the file system you want to use, such as NTFS or FAT32, and replace DRIVE-LABEL with the name of the drive as you want it to appear in File Explorer. The quick option is optional to perform a format more quickly. However, if you are not sure about the drive's condition, it is best to skip the option. Just remember that depending on the hard drive's size, the format could take a long time.

    This example formats the drive using the NTFS file system and names the partition "Data":

    format fs=ntfs label=Data quick

    Type the following command to assign a letter and make the drive available in File Explorer and press Enter:

  12. assign letter=DRIVE-LETTER

    In the command, change DRIVE-LETTER for the letter you want the drive to use, which is not assigned to another device.

    This example assigns the "G" letter:

    assign letter=g

    Type the following command to terminate DiskPart and press Enter:

  13. exit

  14. Type the following command to close Command Prompt and press Enter:

    exit

Once you complete the steps, if the drive does not have physical issues, it should now be available through File Explorer, and you can begin to store files on it.

Add Feedback