Is there a command to recover/undelete deleted files by rm
?
$ rm -rf /path/to/myfile
How can I recover myfile
? If there is such a tool how can I use it?
data-recoverydeleted-fileslinux
Is there a command to recover/undelete deleted files by rm
?
$ rm -rf /path/to/myfile
How can I recover myfile
? If there is such a tool how can I use it?
Best Answer
The link someone provided in the comments is likely your best chance.
Linux debugfs Hack: Undelete Files
That write-up though looking a little intimidating is actually fairly straight forward to follow. In general the steps are as follows:
Use debugfs to view a filesystems log
At the debugfs prompt
Sample output
Run the command in debugfs
Determine files inode
With the above inode info run the following commands
Files been recovered to
recovered.file.001
.Other options
If the above isn't for you I've used tools such as
photorec
to recover files in the past, but it's geared for image files only. I've written about this method extensively on my blog in this article titled:How to Recover Corrupt jpeg and mov Files from a Digital Camera's SDD Card on Fedora/CentOS/RHEL.