I ran across a neat little trick when attempted to recover a deleted file on my Linux box.
You can use grep to search your disk at a bit level for a deleted file, on the condition you know a string in its contents.
You can test it like this, write a text file and store a specific string in it. ie
1 |
vim /home/username/myfile.txt |
then insert something like
1 2 3 4 5 |
I like cats I like Dogs fast cars smell like roses i like rinos i like lions. |
then delete the file.
1 |
rm /home/username/myfile.txt |
Now lets find the deleted file.
1 |
grep -a -B10 -A10 'fast cars smell like roses' /dev/mapper/vg_system-root |
Your missing file should appear with a bit of junk above and below the contents of your file.
Increase the lines in the -B10 -A10 depending how big your file it.