You turn on your phone, open Gallery to see a picture you took last week and ... Oh, no! There are no pictures! What happened to them? Where did they go?
First, a little lesson on how Android works. When you turn the phone on, or restart it, a system function called Media Scanner runs, listing all the media files on the phone and, if you have one, the external SD card. Videos, music, pictures - any media files. When you run Gallery it looks at that list for picture files, finds each one and displays them. The "album" name the pictures are in is the folder the files are in. If the picture file is on the phone you'll see it in Gallery (or QuickPic, a much better app). There's no "gallery" folder.
So where did your pictures go? They probably got deleted. Now your question is "how do I recover a deleted picture?"
Well ... the first thing is to not to have to. Always back up anything that's important. (See Backing up an Android Phone.) If it's on your computer, and on a cloud account, and it gets deleted from your phone, oh, well. Another minute of your life wasted copying it back to the phone. An old computer saying has it that any file not backed up is a file you don't need. Of course it's the other way around - any file you don't need, you don't back up. But it's true. If it's worth having, it's worth backing up.
There are at least a few dozen free cloud accounts you can get by googling free cloud account. You can probably get a few TB of free space. Many of them have free apps, so you can do the backup right from the phone, out in the middle of I-40 (unless you're in Great Smoky Mountains National Park, also known as Great Smoky Mountains Signal Hole for all Carriers). Take a picture or video, it's great, back it up right then.
So from now on, make sure you back up at least the really important things as soon as possible. (Being a parent, grandparent, uncle, etc., almost makes me want to cry when someone lost the only pictures of their first child's first steps.)
But it's too late now, you didn't back that picture up and it's gone. What do you do? That depends on whether the file was on internal storage or the external SD card.
Internal Storage
Unless you're already set up to recover deleted files, you're probably going to lose at least part of one file. You can not recover a deleted file unless the phone is rooted. Don't look for a "way out", a "back door", you need access to a part of the file system that only the user "root" can access. (But see the last paragraph of this guide. Yes, you still have to be rooted, but it's one of those "whyt didn't I think of that" things. I've used dd many times over the years. It was so obvious once I saw it on the PhotoRec site.) Or, rather, the app you're going to use does. It's called DiskDigger undelete. The free version only recovers pictures. If you want to recover other types of files you need the paid version DiskDigger Pro. It's $3, not much as good apps go. (Install Google Opinion Rewards and you'll make that in a week or two - for spending 30 seconds a few times a week checking multiple choice answers.) (But, again, see that last paragraph.)
When a file gets "deleted", the file doesn't go anywhere - the space it's in gets marked as unused. Anything you save from that point on could get stored where that file was. So rooting the phone and installing DiskDigger could potentially overwrite one or more of the deleted files. (And, if you don't have an HTC phone, rooting the phone voids the warranty. [Evidently HTC doesn't see installing one file and one app as being a serious threat to the phone - and that's all rooting is.])
So, if you're ready to go, root your phone (look on XDA Forums for rooting instructions, files, etc., for your particular model phone if you don't know how to do it). Then go to the Play Store and install DiskDigger. Run it and it'll find lots of deleted files. Tell it to recover the one(s) you want. If you find a picture in which the bottom half, third, some part, is garbage, the space that part of the file was in got used to store another file. There's nothing you can do about that, except maybe edit the picture if the important part is still there.
(But see the last paragraph of this guide.)
External SD Card Storage
This one's easier, because all you have to do to the phone is take the SD card out. Put it into a card reader. This one will do the job, reads SD cards or microSD cards, is USB 3.0 and is only $6.
Now go to PhotoRec. Download the file. Extract the contents into a folder on your hard drive. (Name it PhotoRec if you want your hard drive to make sense to you.) Run photorec (the Windows version is named photorec_win.exe, the ones for other operating systems are similar.) BTW, this is a great improvement over the older version of PhotoRec (which I was running until I downloaded this one in order to write this guide. You used to have to burn PhotoRec to a disk, then start your computer with that disk. Now it's just a program.)
Be careful with 2 things:
1) The drives it's recovering from use the Linux naming convention, so the first drive (drive C in Windows) will normally be /dev/sda, the second one /dev/sdb, etc. Your card reader will be identified on the right end of the line as a media card reader or something to that effect - it won't be a hard drive type name like any others in the list. That's the one you want.
2) You must not recover to the media card reader. If you do, PhotoRec will find a file and write it to unused space on the card - just what you don't want. Recover to your C drive, your D drive, any drive other than the media reader. (Make a temporary folder to put the recovered files in.)
BTW, PhotoRec will recover a load of different file types, not just pictures. Not just file types you've heard of. So don't be surprised if it recovers 32GB of files from a 32GB SD card that's had everything deleted. (There's a list of file types it recovers in the menu when you're running the program You can tell it to not recover certain file types. By default, it recovers anything it knows.)
There's an excellent step by step explanation, with screen shots, of how to use PhotoRec at PhotoRec Step By Step - CGSecurity
CG Security has written a program that's worth a lot. It's free (and open source - if you're a programmer, you can grab the source, help add to it, etc.) Get it. If you can spare it, make a donation. They deserve it. (No, I'm not associated with them in any way. I've just been glad, many times, that I found this program.)
If you have an iPhone, you can even recover the deleted files from the iPhone with it. The main part of the process, dd, is available on a rooted Android phone too (I think it's in Busybox), so following the Recover Data from an iPhone procedure should work on an image file produced by dd on an Android phone as well. If it does, you can use that instead of DiskDigger. Of course the phone has to be rooted and Busybox has to be installed. And dd takes a long time to make an image file, so start it running before you have something to do that's going to take a while, or watching grass grow in the winter will be more lively and exciting.
First, a little lesson on how Android works. When you turn the phone on, or restart it, a system function called Media Scanner runs, listing all the media files on the phone and, if you have one, the external SD card. Videos, music, pictures - any media files. When you run Gallery it looks at that list for picture files, finds each one and displays them. The "album" name the pictures are in is the folder the files are in. If the picture file is on the phone you'll see it in Gallery (or QuickPic, a much better app). There's no "gallery" folder.
So where did your pictures go? They probably got deleted. Now your question is "how do I recover a deleted picture?"
Well ... the first thing is to not to have to. Always back up anything that's important. (See Backing up an Android Phone.) If it's on your computer, and on a cloud account, and it gets deleted from your phone, oh, well. Another minute of your life wasted copying it back to the phone. An old computer saying has it that any file not backed up is a file you don't need. Of course it's the other way around - any file you don't need, you don't back up. But it's true. If it's worth having, it's worth backing up.
There are at least a few dozen free cloud accounts you can get by googling free cloud account. You can probably get a few TB of free space. Many of them have free apps, so you can do the backup right from the phone, out in the middle of I-40 (unless you're in Great Smoky Mountains National Park, also known as Great Smoky Mountains Signal Hole for all Carriers). Take a picture or video, it's great, back it up right then.
So from now on, make sure you back up at least the really important things as soon as possible. (Being a parent, grandparent, uncle, etc., almost makes me want to cry when someone lost the only pictures of their first child's first steps.)
But it's too late now, you didn't back that picture up and it's gone. What do you do? That depends on whether the file was on internal storage or the external SD card.
Internal Storage
Unless you're already set up to recover deleted files, you're probably going to lose at least part of one file. You can not recover a deleted file unless the phone is rooted. Don't look for a "way out", a "back door", you need access to a part of the file system that only the user "root" can access. (But see the last paragraph of this guide. Yes, you still have to be rooted, but it's one of those "whyt didn't I think of that" things. I've used dd many times over the years. It was so obvious once I saw it on the PhotoRec site.) Or, rather, the app you're going to use does. It's called DiskDigger undelete. The free version only recovers pictures. If you want to recover other types of files you need the paid version DiskDigger Pro. It's $3, not much as good apps go. (Install Google Opinion Rewards and you'll make that in a week or two - for spending 30 seconds a few times a week checking multiple choice answers.) (But, again, see that last paragraph.)
When a file gets "deleted", the file doesn't go anywhere - the space it's in gets marked as unused. Anything you save from that point on could get stored where that file was. So rooting the phone and installing DiskDigger could potentially overwrite one or more of the deleted files. (And, if you don't have an HTC phone, rooting the phone voids the warranty. [Evidently HTC doesn't see installing one file and one app as being a serious threat to the phone - and that's all rooting is.])
So, if you're ready to go, root your phone (look on XDA Forums for rooting instructions, files, etc., for your particular model phone if you don't know how to do it). Then go to the Play Store and install DiskDigger. Run it and it'll find lots of deleted files. Tell it to recover the one(s) you want. If you find a picture in which the bottom half, third, some part, is garbage, the space that part of the file was in got used to store another file. There's nothing you can do about that, except maybe edit the picture if the important part is still there.
(But see the last paragraph of this guide.)
External SD Card Storage
This one's easier, because all you have to do to the phone is take the SD card out. Put it into a card reader. This one will do the job, reads SD cards or microSD cards, is USB 3.0 and is only $6.
Now go to PhotoRec. Download the file. Extract the contents into a folder on your hard drive. (Name it PhotoRec if you want your hard drive to make sense to you.) Run photorec (the Windows version is named photorec_win.exe, the ones for other operating systems are similar.) BTW, this is a great improvement over the older version of PhotoRec (which I was running until I downloaded this one in order to write this guide. You used to have to burn PhotoRec to a disk, then start your computer with that disk. Now it's just a program.)
Be careful with 2 things:
1) The drives it's recovering from use the Linux naming convention, so the first drive (drive C in Windows) will normally be /dev/sda, the second one /dev/sdb, etc. Your card reader will be identified on the right end of the line as a media card reader or something to that effect - it won't be a hard drive type name like any others in the list. That's the one you want.
2) You must not recover to the media card reader. If you do, PhotoRec will find a file and write it to unused space on the card - just what you don't want. Recover to your C drive, your D drive, any drive other than the media reader. (Make a temporary folder to put the recovered files in.)
BTW, PhotoRec will recover a load of different file types, not just pictures. Not just file types you've heard of. So don't be surprised if it recovers 32GB of files from a 32GB SD card that's had everything deleted. (There's a list of file types it recovers in the menu when you're running the program You can tell it to not recover certain file types. By default, it recovers anything it knows.)
There's an excellent step by step explanation, with screen shots, of how to use PhotoRec at PhotoRec Step By Step - CGSecurity
CG Security has written a program that's worth a lot. It's free (and open source - if you're a programmer, you can grab the source, help add to it, etc.) Get it. If you can spare it, make a donation. They deserve it. (No, I'm not associated with them in any way. I've just been glad, many times, that I found this program.)
If you have an iPhone, you can even recover the deleted files from the iPhone with it. The main part of the process, dd, is available on a rooted Android phone too (I think it's in Busybox), so following the Recover Data from an iPhone procedure should work on an image file produced by dd on an Android phone as well. If it does, you can use that instead of DiskDigger. Of course the phone has to be rooted and Busybox has to be installed. And dd takes a long time to make an image file, so start it running before you have something to do that's going to take a while, or watching grass grow in the winter will be more lively and exciting.
Last edited: