How To Recover Deleted Files From Your Linux System

Damien Oh 04-11-2008

How To Recover Deleted Files From Your Linux System hard diskRecovering 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.

recover partition

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 :

recover lost files

Select the partition type :



Find the lost partition :


Write the data to the partition :



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.


photorec-recover deleted files

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.


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.


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 How To securely Retrieve and Delete PC files Read More 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.

Related topics: Disk Partition, Restore Data.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Elijah
    November 19, 2009 at 2:52 am

    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.

  2. Jordan
    November 2, 2009 at 4:36 am

    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.

  3. jafar
    August 10, 2009 at 9:32 pm

    i want your help.

  4. Nikesh
    April 20, 2009 at 6:07 am

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

  5. Paul
    November 5, 2008 at 6:10 pm

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

    • Damien Oh
      November 6, 2008 at 7:17 am

      Yes. TestDisk does fix that as well.