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?

closed as off-topic by n8te, bertieb, Ramhound, fixer1234, robinCTS Jul 3 '18 at 10:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – n8te, bertieb, Ramhound, fixer1234, robinCTS
If this question can be reworded to fit the rules in the help center, please edit the question.



http://www.cgsecurity.org/wiki/PhotoRec - Tested by myself, it works great.

  • 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. en.wikipedia.org/wiki/Inode: "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.


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.

  • 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

Not the answer you're looking for? Browse other questions tagged or ask your own question.