How do I fix a corrupted SD card?
I have a 32 GB microSD card that I know has been corrupted for some time. I used to use it in my Android phone to store music --- nothing critical, but I wanted to try to repair it. When I put the card into an SD adapter and plug the whole thing into my laptop's SD slot, I know the computer detects its presence. Pcmanfm doesn't see it, but I figured that would happen.
Listing /dev after inserting, however, shows a new file/device, /dev/mmcblk0. lsblk also sees the device. I ensured that the SD adapter was unlocked, and tried to mount it. mount appears to hang, and doesn't even respond to CTRl-C, CTRL-D, etc; the only way out is to close the terminal. Ditto for fsck /dev/mmcblk0. I even tried dd if=/dev/zero of=/dev/mmcblk0 bs=512 to zero it out, again to no avail.
I read the troubleshooting section of the "USB storage devices" wiki page, but I'm not having any of those issues. The first issue --- I can see the card in lsblk. The second -- I'm using the LTS kernel, and it's been booted since the last upgrade.
If the card is repairable, how can I fix it? If it's not, it's not a big deal.
Thanks in advance!
About this post
- Posted
- Archived
- Score
- 5 · 86% up
- Kind
- Text
- ID
- kwredd
4 comments
You can't fix a SD card that started to corrupt data. You might even damage it more by trying to fix it. Like any flash storage, sectors can be written a fixed amount of times, it depends on the actual memory technology. When sectors reach the end on their life, they randomly don't retain information anymore and since there's no SMART like system on SD cards, it can't decide not to use a dead sector or reallocate it. That's why SD cards are pretty bad to store sensible data. SD cards are quite cheap storage and expandable, so no big deal.
Ah, darn. Thanks for the great explanation though.
Yup, it's dead Jim. No problem.
Yeah once you start seeing input/output errors, it's toast.