How To Recover Deleted Files From Your Linux System

hard disk   How To Recover Deleted Files From Your Linux SystemRecovering deleted/lost files on a Windows system is easy to do as there are plenty of software (both paid and free file recovery apps) that allows you to do so like a CSI expert.  But what about Linux?

Recently my Linux hard disk crashed on me and it was then that I discovered that there was a limited choice of data recovery tools that I could use on my Linux system. In my desperate attempt to revive my hard disk (and the data on it), I came across these two great pieces of software TestDisk and PhotoRec that single-handedly saved my hard disk.

TestDisk – Recover Lost Partitions

TestDisk is a partition recovery software that can recover any lost partition or make a non-booting disk bootable again. It can be really handy when your hard disk has crashed due to faulty software, viruses or any accidental removal of the partition.

It doesn’t matter whether you are using Windows, Linux, Mac or any other UNIX system because TestDisk is able to recover them all.

testdisk1   How To Recover Deleted Files From Your Linux System

As you can see from the image above, TestDisk is run in the terminal (or DOS) mode. That doesn’t mean it is difficult to use. There is no command line to remember. All you need to do is to move your arrow keys and press Enter to select the right answer, just like how you answer an online survey.

Select the hard disk to scan for the lost partition :

testdisk2   How To Recover Deleted Files From Your Linux System

Select the partition type :

testdisk3   How To Recover Deleted Files From Your Linux System

Find the lost partition :

testdisk4   How To Recover Deleted Files From Your Linux System

Write the data to the partition :

testdisk5   How To Recover Deleted Files From Your Linux System

Most of the time when your hard disk has crashed, or fails to boot, it doesn’t mean that it is spoilt. It could just be due to a corrupted file or accidental removal of the boot record, which can be easily fixed with TestDisk.

I have successfully restored two 80GB hard disks that originally could not be booted up.

PhotoRec – Recover Lost and Deleted Files

PhotoRec works to recover lost files from any storage devices, including video, documents, pictures and archives from hard disks, memory cards, USB thumb drives and CD-ROM’s. It doesn’t care what filesystem you are using and it goes deep under to dig out any underlying data.

Even if your storage device is severely damaged or re-formatted, there is a great chance that you can retrieve your data, as long as it has not been overwritten.

photorec1   How To Recover Deleted Files From Your Linux System

Unlike other data recovery software, PhotoRec does not come with a nice user interface and it does not allows you to select which files to restore. By default, it will recover all the files that it can find, but you can configure it to search only for a particular file extension.

photorec2   How To Recover Deleted Files From Your Linux System

A point to note while using PhotoRec: you should never restore a file to its original location as it will overwrite the data and make the file unrecoverable. Instead, restore the files to a secondary hard disk or a separate partition.

Conclusion

I would strongly recommend TestDisk and PhotoRec as Linux data recovery tools. Although they are not as visually appealing, their solid support for multiple platforms and filesystems give them a great advantage over other data-recovery software, not to mention that they are free too.

If you are using Windows and want to retrieve lost files, other data recovery software (such as Restoration and Undelete Plus) would be useful as they have a better interface and give you more control over which files to restore. However, if you are on Linux, Mac or any other platform other than Windows, PhotoRec would be a great alternative.

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

8 Comments -

0 votes

Paul

TestDisk sounds good. You mentioned something about repairing boot record, does it offer the option to do that as well? Thanks in advance

0 votes

Damien Oh

Yes. TestDisk does fix that as well.

0 votes

Nikesh

Yea, I have used it many time on my OpenSuse 11.1 system and it works like charm.

0 votes

jafar

i want your help.

0 votes

Jordan

Thanks for such a nice information about recover deleted files from linux system.I have used Stellar Phoenix Linux data recovery software to recover my lost data from Linux OS.This linux data recovery software demo version is free in which you can see the preview of your recoverable data.

0 votes

Elijah

The app confused me.. thinking they were two applications but strangely the same download area. They are actually one application with two commands once installed =/ It took me a few minutes to find photorec without realizing I already had it installed.