Is there any way to save/restore pictures deleted from an encrypted SD card?

mkaut

New member
Feb 20, 2018
2
0
0
Visit site
I thought I was deleting the last picture I have taken, but it was the whole folder (which got the last picture as a thumbnail) .. so I deleted the whole DCIM folder - and Gallery has not even asked me for confirmation.

I have Galaxy S5 with Android 6.0.1 in Norway and the DCIM folder is on an encrypted SD card. The phone is not rooted.

I have tried a couple of apps that are supposed to help (like DiskDigger), but they find only some thumbnails and a couple of pictures from LOST.DIR, but none of the deleted pictures.

Is there any way to get the pictures back?
 

Rukbat

Retired Moderator
Feb 12, 2012
44,529
26
0
Visit site
It's not only possible, it's trivial, to restore deleted files, but once they're encrypted, something may go wrong. (The file itself, with all the encrypted data - as it was encrypted - will be restored, but what the phone will do with that data is another question, and one I can't answer.)

Try PhotoRec (instructions at PhotoRec Step By Step). It takes a while to figure it out if you don't know Linux (because it's based on Linux), but once you set it going, you don't have to do anything (even if it's a large card, and the PC has to be running on it for a week until it recovers all the files - that's the PC's problem, not yours.)

Speaking of PCs, there are versions there for Windows, MacOS and Linux, so unless you have an old SunOS box, or a mainframe, you should find what you need. Restore the files, copy them to the SD card and see what the phone makes of them. (PhotoRec is forensic software, so it doesn't write to the card it's recovering from - it will save the files anywhere else that you tell it to.)
 

mkaut

New member
Feb 20, 2018
2
0
0
Visit site
Thanks for the tip! :)
I have run PhotoRec and it found about a thousand .eCryptfs files. (By the way, it was faster to create an image of the card and run PhotoRec on the image .. it took only about half a minute to scan a 16 GB card.)
Then, I just renamed all the files to .jpg and copied them to the DCIM folder of the card (physically, not via the phone) .. and the phone happily decrypted them. Of course, not all the files were actually jpegs, but that is easily solved by deleting all files that the Gallery app marked as corrupted. (Actually, since it is over 1000 files, I think I will just mount the phone over MTP, copy the files to the PC and do the sorting there.)
Anyway, the good point is that I have most of my pictures back - and if I were not an ***** and made an image of the card at once, instead of using two evenings trying to save the pictures from within the phone (and forgetting that I have other apps storing data on the card), I could have avoided the corrupted files that the delay inevitably caused...
 
Last edited: