Note: This article is part of a series. See the Index for more information.
Update: I’ve recorded this series as a screencast for Pluralsight:
If you have a Pluralsight subscription, please consider watching it. Thanks!
Sometimes bad things happen to SD cards, and Windows doesn’t always handle it gracefully. I’ve had cards that Windows refused to recognize, and SD Formatter wouldn’t touch. There are a number of ways to fix this. Sometimes, putting the card in a camera, and telling it to format the card will work. If that doesn’t work, all is not necessarily lost. Here are some steps you can try.
Remember that you will lose any information that was on the drive, so don’t do this if you need to recover data from the bad card. There are utilities out there for rescuing data from damaged cards, but that’s beyond the scope of this article.
Note: These instructions are written for a Windows user. The “fdisk” command in Linux performs similar operations, but you’ll have to look elsewhere for the walkthrough.
Remove the bad SD card, along with any other flash drives or SD cards from your computer so you don’t accidentally format the wrong one. Press the Windows key, and “R” together, type “diskpart” at the prompt, and press enter.
You’ll find yourself looking at something that is almost, but not quite entirely, unlike a command prompt.
Type “list disk” to see all the disks in the computer.
Now insert the bad SD card into your reader, and type “List Disk” again, and look for the disk that wasn’t there before.
In this example, Disk 3 is the new entry in the list, and therefore the SD card that we want to reformat. Type “select disk x” where “x” is the number of the new disk from the list.
Before proceeding, be VERY sure you’ve selected the right disk. We’re about to blow away its partition table. If you accidentally chose your primary hard drive, very bad things will happen. Don’t blame me. I warned you plenty.
Once you are ABSOLUTELY sure you have the right disk selected, type “clean” and press enter.
The drive you selected is now a blank slate. Type “create partition primary” to create a brand-new partition table.
Finally, format the new partition by typing “format fs=fat32 quick”. Don’t forget the “quick” part, or you’ll be waiting around a while.
And that’s it. The drive is freshly formatted and ready to use again. If you open a file explorer window at this point, you should see your drive. It will still have its old name, but will be completely empty. Type “exit” to close diskpart. You can now proceed as usual.