There are many programs in the web that will help you recover erased data. Some great ones and some mediocre ones; some very costly and some free. In the following tutorial I will describe what I believe to be the best solution for recovering erased files from your computer. A method which works on virtually any operating system; Windows, Mac or Linux. A method which is safe, reliable and free. Do not be scared of the size of this article, it is actually a walkthough and it is very easy to follow.
Something I must mention before starting this tutorial is that once you have deleted the file, you need to recover it as soon as you possibly can. Every minute that your computer is on, is a minute counting against you. Why? Let me explain. In order to save time your operating system does not really delete the file; it just marks the space the file occupies as available. As soon as the space becomes available, it can be overwritten at any time. Your operating system is constantly running tasks in the background, therefore, even if you do not save anything to the hard drive, your data can be overwritten just by having your computer on, specially if you do not have much free space available in your hard drive.
Something else worth mentioning is that, you cannot install the data recovery software in the same hard drive your data was deleted from, otherwise your data might get overwritten by the installation of the recovery software. So what do you do now? You could take the hard drive out of the computer and connect it to another computer as a slave, or make make it an external USB hard drive. However, these solutions could be time consuming, complicated, and even dangerous for computer illiterates. There is a smarter solution which the majority of commercial data recovery programs do not offer: booting from a CD instead of from your local hard drive; this CD will run its own operating system and will have the data recovery software installed as well.
In this tutorial we will learn how to use two free, open source and extremely useful programs. One, a Linux live CD called “Parted Magic” and the other a data recovery program named “Photorec“.
Connect an external hard drive or USB flash drive to your computer; this is the drive we are going to use to extract the data to. If the drive is not empty it is wise to create a folder to dump the recovered data in. For our example I have created a folder named “Recovered Data”.
Boot your computer from the CD-Rom drive. Newer computers have a boot menu which will let you select which device you want to boot from. It is usually one of the F keys on top of the keyboard (Usually F10 or F12). You must press this key quickly, right after turning your computer on (you have a very brief amount of time for this). If yours does not have a “boot menu” you are going to have to change the boot order in your computer’s BIOS, and set the CD-ROM as your first boot device. To access the BIOS you also need to press a key on your keyboard immediately after turning your computer on. Right when you turn the computer on, it will tell you which key to press (it’s usually F1, F2 or DEL).
When Parted Magic is up and running, the first thing you are going to do is mount your external hard drive. To do this, click on “Mount Devices” on Parted Magic’s desktop.
Look for your external drive and click on the “Mount” button to mount it (if it’s marked green it is unmounted, if it’s marked red it is mounted). Parted Magic is a Linux liveCD and Linux does not use drive letters like Windows does, it uses paths. Write down the path assigned to your external drive.
Click on the Parted Magic start menu, then click on “System Tools” and finally click on “Photorec“.
Photorec will then open in a terminal window; select the drive you wish to recover data from using the UP and DOWN arrow keys on your keyboard. Then, on the bottom of the screen, using the RIGHT and LEFT keys, make sure “Proceed” is selected and click “Enter” to continue.
Select the partition table type and click “Enter” to continue. If it is a Windows or Linux partition, leave it on “Intel”. For Macs choose “Mac” or “EFI GPT”.
Select your partition. Be sure to select the right one; you can usually tell by the “Size in sectors“. As you can see in the picture down below, our hard drive has two partitions; the one with the highest size in sectors is the one we are looking for. The other tiny partition was created for the use of the operating system and is irrelevant to us.
Then, if you want to search for specific types of files, rather than for every single deleted file on the hard drive, select “File Opt“.
Contrary to what its name leads to believe, Photorec not only recovers photos, but a vast list of files as well. All files are selected by default; if you want to remove some of them and leave only the ones you wish to recover, go through the list using the UP and DOWN arrow keys and uncheck any files you do not want by pressing the space bar on your keyboard. Press the “b” key on your keyboard to save your preferences and select “Quit” to go back to the previous menu. Once on the previous menu, select “Search” and click enter.
Next, select the filesystem type. Photorec usually detects this automatically. Press “Enter” to continue.
If you just want to recover files that have been deleted select “Free“. However, if you want to recover files from a hard drive that has a bad or unreadable partition, select “Whole“. For example, a hard drive which displays the error “missing operating system” when you try to boot from it, or an external hard drive which displays the error “This hard drive needs to be formated” when connected in Windows.
Now, remember the path I told you to write down at the beginning of the article? the path assigned to your destination drive? We are going to need it now. The path our drive has in this example is “\media\sdd2” (yours will probably be different), so first select “media” and click “Enter” to continue.
Then, select “sdd2” (yours will probably be different) and click on “Enter” to continue.
Next, select the directory you created for data recovery. For this example ours was named “Recovered Data“. Select it and click “Enter” to continue.
Now that you are finally inside the destination directory, click “Y” on your keyboard to begin recovering your data.
Photorec will take a few minutes to scan the drive and recover the files.
You can see files even as they are being recovered by clicking on the “My Documents” icon and selecting the destination drive and path. Go into the folder you created for data recovery; you will see that Photorec has created a bunch of directories, inside you will find your recovered files.