Recover / Undelete lost data using TestDisk

Hi people of Earth! Are you really worried / vexed because you have accidentally lost your data / partition on your storage media? Don’t worry, just chill! TestDisk has come to your rescue from planet–Open Source. ๐Ÿ˜› So I (friend of TestDisk) will guide you through the steps how to get help from the alien–TestDisk in getting / recovering your lost data (mind it! TestDisk is really fond of getting admired, so go ahead and don’t forget to admire it;-)).

Okay let’s begin recovering your data. Let’s DELETE the data with our own hands and then we will UNDELETE (recover) it. Don’t worry, in this tutorial we will delete some data from our pendrive (just for experimental purpose) and then will recover it. Alternatively, you don’t need to delete the data if your data is already deleted. ๐Ÿ˜›data1

Step1: Create a log file:

Let’s us DELETE some data from our pendrive. In my case I have two files in my pendrive (one song and one picture). Now go ahead and delete your files either from terminal or graphically (as you prefer). Now let’s call our alien-friend, TestDisk for help, type “Testdisk” in terminal and press Enter. Now it will ask for selecting any one of the three options viz [ Create ], [ Append ], [ No Log ]. For now you may select [No Log]. Create and Append are used for recording the work of TestDisk in a log file.Create a log file
Step2: Select a media:

Now this will show all your partitions and mounted drives (pendrive) or any other storage media which is mounted. Now select the media from which you want to recover the data and >[Proceed] (press Enter).Select a media

Step3: Select the partition table type:

Now select the partition table depending upon how partitioning has been done in your storage media. For simplicity, TestDisk gives a HINT below which may indicate the automatically detected partition table type. In our case it has detected Intel. Select and press Enter.Select the partition table type

Step4: Select Advanced:

Now TestDisk may ask for selecting from options viz [Analyse], [Advanced], [Geometry], [Options], [MBR Code], [Delete] and [Quit]. Out of these select [Advanced] and press Enter.Select Advanced

Step5: Select Undelete:

Now it may ask for selecting from options viz [Type], [Boot], [Undelete], [Image Creation], [Quit]. Select [Undelete] as we want to undelete (recover) our deleted files.Select Undelete

Step6 : Select the files to be Recovered:

Now it will show the deleted files in RED. Now you can select the file with “c” (lowercase) to copy the current file, “a” (lowercase) to select all files and “C” (uppercase) to copy the selected files (you may type capital “C” by pressing shift+c).files to be Recovered

Step7: Select the destination where marked files will be copied:

Now select the destination where marked files will be copied. Use arrows keys. The two dots (..) will take you one directory back. Keep pressing enter until you reach your desired destination. For simplicity we will select destination, Desktop.destination

Step8: Final Move!

Now press “C” (shift+c) to copy the selected files onto your destination (Desktop in our case). Now it will start recovering your deleted files. Now if your data to be recovered is in gigabytes (huge amount) go and get some coffee for yourself and leave TestDisk alone for doing its job. ๐Ÿ˜‰ After the recovery is done it will display “Copy done!” in GREEN. That it! Your data is restored. Cheers! Now keeping press “q” untill you quit.

Final Move!Wait! Don’t forget to admire TestDisk (in the comment section below) as it was mentioned above it’s fond of getting admired. ๐Ÿ˜›