Recovering Files from Unmountable SD Card

There have been a number of posts about retrieving data from "unreadable" SD cards. I thought that I would add my two cents.

Listed below are a couple of recovery methods to be considered. Each is a pair of programs: an Arduino sketch and a Python program. Each uses the SPI capability of an Arduino Uno R3.

  1. The first is an extension of DumpFile. The Python program reads a list of files to be dumped. It opens a file in the directory from which it is run. It sends file names one at a time to the Arduino sketch. The sketch dumps the SD file contents to the serial interface. Python reads from serial and writes to the computer file. When the file dump is complete, Python closes the file and processes the next.

  2. The second is an extension of sd_recovery_raw. The Python program opens a file in the directory from which it is run. The sketch reads blocks of an SD card starting at zero to the end of the card. It dumps the binary to the serial interface. Python reads from the serial and writes to an image file. When the SD dump is complete, Python closes the file.

Each of these methods has been tested successfully with good, mountable SD cards. From the second method, the image file has even been mounted as a virtual disc.

However, in cases that have been tried so far, when testing an unmountable SD card, after many reads, the card has become completely inaccessible. That is, even block reads no longer work.