A computer illiterate family member asked me to recover photos from an SD card she used in her camera. She went to fetch them from her computer when it informed her that the device needed to be formatted. She swears that she didnt proceed with the format and asked if I knew how to fix it.

I use a Knoppix boot cd that I like because it comes prebundled with ddrescue and other tools. Plugging the card into my built in reader, it recognized the device under /dev/sdc however it didnt automatically mount.

I ran the command

ddrescue -d /dev/sdc /media/sdb1/test.img /media/sdb1/testimage.log

The output suggested it ran perfectly fine. It successfully read all 16GB and reported 0 errors. When I opened the img file in a hex editor however it was 16GB of zeros. I wasnt sure if ddrescue was just silently failing at every read attempt and just writing a zero, so I also tried plain vanilla dd and got the same result.

Everything about the card appears to be fine, it is apparently just empty. Normally I am used to when memory controllers on these cards start to go bad that they misreport the memory size or there are bad sectors but here it all just seems like a happy factory fresh SD card.

Of course she is tech illiterate so i cant rule out that she accidentally zero filled the thing but I would think if anything she would have accidentally quick formatted it and blew away the partition table leaving the bytes at address intact.

Is there anything I might be missing or doing wrong here or is the card just completely hosed?

closed as too broad by Rui F Ribeiro, RalfFriedl, Isaac, schily, 200_success Nov 18 '18 at 2:22

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • It's odd for it to be ALL zero. Usually you get an empty filesystem at least (so non-zero partition table and filesystem metadata, zero everything else). If there is an empty filesystem, guess it was zero-formatted after all and there is nothing you or anyone else can do about it. – frostschutz Nov 15 '18 at 21:44
  • 3
    You can use cmp -l /dev/zero test.img to see if there are non-zero parts your hex editor might not have immediately showed. – frostschutz Nov 15 '18 at 21:46
  • @frostschutz It is odd. I just dont understand how she could have accidentally zero filled the drive on a Windows machine. – maple_shaft Nov 15 '18 at 21:46
  • 1
    You can also try another cardreader just for kicks, but unlikely ... – frostschutz Nov 15 '18 at 21:47
  • I have my doubts it is way out of topic here the way a camera formats SD cards. – Rui F Ribeiro Nov 16 '18 at 0:07

I assume your Linux system is able to read working SD cards.

"The device needed to be formatted" is the Windows message you would expect to see, when you insert an unformatted card, including one which is 100% zeroes i.e. completely blank.

The data is lost.

This is what you would see if the flash remapping tables on the SD card have been reset, to all unallocated, e.g. using the Linux blkdiscard command on the whole device. (blkdiscard command tends to work with internal PCI card readers, I think it tends not to work with USB card readers).

If you want random guesses, I think it's more likely a fault where the controller is still operating, but it is failing to load remapping tables for some reason. In that case, you wouldn't be able to write to the card / writes will be silently lost.

I'm not thinking it was due to a deliberate discard command, because I've heard very little about those being used on SD cards.

I would be surprised if the SD card decided to reset itself, wiping all the mapping tables. Note the full-device blkdiscard command takes quote a while for me. At least, there's no reason to design it to automatically reset itself.

Not the answer you're looking for? Browse other questions tagged or ask your own question.