Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I deleted files on my linux drive that I shouldn't have. What is a good tool to use to recover these files that will:

  • Recover the various file types (txt, php etc)
  • Recover it as the original files names

TestDisk and PhotoRec almost do the trick, but the original filenames are not restored. So I need a better solution?

share|improve this question
Any of those helpful?… – Troggy Jan 25 '10 at 13:38
What file system? There are many. – David Thornley Jan 25 '10 at 14:50 - Tested by myself, it works great.

share|improve this answer
I once used GNU ddrescue to pull lots of data off a damaged hard drive using Puppy Linux. It did pretty well. I did have to download some development tools for Puppy, though, so I could compile it. – Nathaniel Jan 25 '10 at 22:56
The problem with PhotoRec is that it doesnt recover the actual file NAMES. Any suggestions on how to get the fileNames? – coderama Jan 26 '10 at 7:08
It could be hard because of the way how file system works. "Inodes do not contain file names, only file metadata. Unix directories are lists of "link" structures, each of which contains one filename and one inode number." – Maciek Sawicki Jan 26 '10 at 11:40

This may depend on the file system you are using. For example, on ext2, you can use undelete utility.

share|improve this answer

It's probably not helpful to the OP, but the correct mantra here is "restore from backup."

If you haven't set up a fake delete (that moves files to a trashcan for later deletion), most of the Linux filesystems offer at best a probability of recovery.

share|improve this answer
Unfortunately - at least in my case - it was in the process of moving files from my camera's media stick to my file server that things went wrong. The file server is backed up nightly by Bacula - haven't yet found a camera that will do that!! – kwutchak Feb 22 '10 at 0:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .