Home page
Articles for Windows, Linux, OS X
Mac tips and articles
Mac tips
Windows 8 tips and articles
Windows 7 tips and articles
Vista Tips
XP Tips
Linux tips and articles
Read the blog
Online store
Windows, Linux, OS X programs

Recover lost and deleted files in Linux

We all lose files occasionally and sometimes it is because of a disk fault and a file or folder is deleted, and sometimes it is simply human error. You may be lucky and find the file in the Wastebasket, but if it isn't there, what options are there?

Unlike Windows, there aren't any easy to use point and click file recovery tools for Linux. Recovering lost and deleted files is not easy, but one tool that might possibly do the job is Photorec.

Photorec is a companion program to TestDisk and you can download them from here, but you will also find TestDisk, which includes Photorec, in Ubuntu's Software Centre.

Using Photorec is quite straightforward and you open a Terminal window and type sudo photorec. Select the disk and then the place to write recovered files to. You can write them back to the same disk, but there is a danger of overwriting files you are trying to recover. Always choose a different disk if possible. You can then start Photorec scanning for deleted files.

Photorec Linux files recovery

The big problem with Photorec is that it recovers all deleted files on the disk, in fact, everything you or the operating system has ever deleted. On a seldom used disk it recovered over 27,000 deleted files! Before I started I created a text file, saved it and deleted it with the intention of trying to recover it. However, Photorec recovered 16,000 text files. Was the one I was looking for among them? Who knows. All the recovered files have names like f9350032.txt and I lost interest after looking through a few dozen.

It recovered 142 jpg files, so it wouldn't have been so bad if I'd deleted a JPEG as a test. You'll obviously need to use a search tool to find whatever file you are looking for because it stores them in multiple folders, probably because there are so many.

Photorec is far from perfect and finding your file among the thousands recovered involves some work, but at least it recovers files.