Recover deleted photos

Shit hap­pens… but for Lin­ux users, there is a pow­er tool straight from the US Air Force called “fore­most” to help you recov­er (aka undelete) your pho­tos eas­i­ly!
Note: you’ll need sudo rights to install this soft­ware tool.

But most impor­tant­ly: do not write any new data to your device (SD card, flash dri­ve or what­ev­er)! Oth­er­wise, you’ll over­write what is still there and lose your pho­tos forever.

The steps:
Remove or unplug the media/drive/card from your comupter.
Open a ter­mi­nal win­dow.

Install the recov­ery soft­ware.

sudo apt-get install foremost

Cre­ate a fold­er to put the recov­ered pho­tos in. Impor­tant: don’t put this fold­er on the dri­ve where you want to recov­er pho­tos from! See above…

mkdir recovered-photos && cd recovered-photos

Find the device: copy the fol­low­ing com­mand to your ter­mi­nal and press the [Tab] key twice

foremost -v -t jpg /dev/sd

It will say some­thing like this

sda   sda1  sda2  sda3  sda4  sda5  sda6  sdb

Now, plug in your drive/card/medium and press [Tab] again, twice.
It should change to some­thing like this

sda   sda1  sda2  sda3  sda4  sda5  sda6  sdb  sdc  sdc1

In my case sdc and scd1 showed up. Thus, sdc1 is the par­ti­tion on the device to recov­er from. Thus, I my case the full com­mand would be (You need to replace sdc1 with what­ev­er showed up pre­vi­ous­ly on your own ter­mi­nal!)

foremost -v -t jpg /dev/sdc1

… press return and see the mag­ic hap­pen! Your pho­tos will show up in a sub­fold­er of recovered-photos. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *