Friday, September 27, 2013

Recovering Data Part 1 - deleted files

Have you ever deleted a file, only to realize that you in fact, still needed it? That's what the Trash Can is there for (Recycle Bin for Windows users). But what if you emptied the trash and then realized you still needed stuff?

Recovering deleted files can save you a lot of time and effort, in that you do not have to redo the work you spent hours or days doing and in some cases like with holiday photographs it can help you save precious memories. You can't go on holiday to the exact same place and retake all the photos you lost (normally).

Enter PhotoRec, it comes bundled together with TestDisk (which we will discuss in a later post). To install:
  • Open a Terminal Window
  • Type in: sudo apt-get install testdisk
  • Press <ENTER>
  • Type in your sudo password and press <ENTER>
  • Follow the prompts
(Alternatively search for testdisk in software manager)
(remember to include the Universe repository in the settings, if you get an error message when you try to install the program)

If you are not in a Terminal window, then open one. Type in sudo photorec and press <ENTER>. You might not have to enter your password again, unless if more than a few minutes has passed since you last typed it in.

PhotoRec will now ask you on which partition you want it to search for deleted files. I deleted a few files from a flash drive before installing the program and here I choose my Adata flash drive. Next you will need to choose what type of partition it is for PhotoRec to be effective. Now you are asked to choose the partition to scan for deleted files, do so.

  If you are asked which file types to recover, then make a selection (I must have chosen all files somewhere).

You will now be asked where to save the recovered files. I choose my home folder, PhotoRec make a sub folder with all the recovered files in it.

The only thing that was strange (to me at least) is that the recovered files where:

1. Not in folders, as they had been on the drive and
2. Had all been renamed, of the 238 recovered files all of them started with f

I tested some of the recovered files and found that they had successfully been recovered (unlike my experience with some Windows file recovery programs where you are told that your files are now back, but they don't open properly any more).

A program worth checking out.