How To Repair a Corrupted USB Drive or SD Card with DiskPart in Windows

Ask a question
Occasionally, you may find that your USB drive, SD card, or hard disk cannot be formatted because it is corrupt. When this is the case, you will receive an error message reading, "Windows could not complete the format".

Although inconvenient, this issue is not impossible to remedy. This can be done easily with a tool, called DiskPart, that is available for Windows XP, Vista, 7, and 8 devices.

How To Use DiskPart to Clean, Format, and Fix USB Flash Drive and SD Card

Press the Windows + R keys. Once the window opens, type diskpart, and press Enter:

N.B. In Windows XP, you will need to type diskpart.exe.

Once the black window appears, type list disk, then press Enter:

Next, find your USB drive or SD card. Once you know where it is, type select disk and enter the number of the USB drive, SD card, or hard disk:

N.B. Any mistakes during this step may result in the loss of data that you do not want to delete. It is important to follow the instructions to the letter.

If you do not know with certainty which one is your USB drive or SD card, type detail disk to verify that the chosen unit is the correct one. The detail disk option also allows you to check if the drive cannot be formatted because it is write protected:

Once you are sure that you have selected the correct drive, type clean. If the drive has more than one partition, type clean all:

Next, type create partition primary:

Then, type select partition 1:

Next, enter the command active:

Finally, type format fs=fat32 quick. For hard disk drives, type format fs=ntfs quick:

Image: © Oleksandr Yuhlchek -