Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.
Here’s how I recovered (or tried to) lost data from an SD card.
As usual I write those posts to remember how, as this is the 2nd time I’ve done this procedure and I always have to search how to do it.
I ran into trouble with my photography hobby twice in the past couple of months, both times with SD cards:
- an SD card appeared empty on the computer and wasn’t readable anymore from the camera (a camera firmware issue), and I had a few days worth of pictures on it
- I accidentally deleted a picture I didn’t want to delete, directly on camera, and that was a good picture
There’s a lot of mess when you look for disk recovery, maybe slightly in panic because you lost precious stuff, and many of the things you’ll find are paid options.
photorec (GitHub here) is a free option, actually it’s free GPL-licensed software, which is even better than “just” free.
It’s a command line tool.
It basically tries to retrieve all data that was stored on an SD card (or another kind of disk storage) even after it was deleted.
In the first case I was able to recover my pictures. In the second case it didn’t work; it was a very different use case, but at least I know I tried.
There’s an official site with docs and also a complete documentation in PDF available
Download it from https://www.cgsecurity.org/wiki/TestDisk_Download
On a Mac, install it using Homebrew with brew install testdisk (photorec comes with another tool called testdisk used to check disk partitions) and then run it using:
sudo photorec