LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How do I recover deleted files? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-recover-deleted-files-396619/)

Hector404 12-26-2005 01:55 PM

How do I recover deleted files?
 
I have deleted a whole directory using the 'rm -r -f' and it contained important files, images, and scripts. Is there anyway I could recover the deleted files quickly?

Thank you!

Lenard 12-26-2005 02:17 PM

Restore from backup....................

Don't have a backup then you learned a valuable lesson the hard way.
Everybody makes mistakes, everything made by man breaks or fails.

Cirdan 12-26-2005 08:25 PM

When you deleate something, doesn't the hard drive(or Filesystem) just mark that spot as writeable?(There isn't a file in that spot) So technicaly you could use a program to try to recovor it if I am right. I don't know of any specific programs tho.

btmiller 12-26-2005 08:35 PM

It depends on the filesystem. If you're using a non-jounralled filesystem like vfat or ext2 then there is some hope (and there even exists a nice ext2 undelete program). If you're using ext3, because of the way the jourmal works (zeros out the inode entry), you're more or less out of luck. The data may still be on the disk blocks, so it's possible that some non-OS dependent disk scanning tools could find it, but it's going to be hit and miss. If the data is critical, a professional disk recovery firm would probably be happy to help, but it will cost you.

Remember, in Linux, rm means rm.

[edit to add]

If you're using ReiserFS, there may be some hope, as expressed by this howto. I've never tried anything like it, though, so I can't vouch for any of the info.

XavierP 12-26-2005 08:47 PM

I have changed the title slightly to make it less, ummm, emotional.

And welcome to LQ :D

heema 12-27-2005 01:35 AM

it is wise to make an alias in ~/.bashrc file to ask you first if you want to remove the file or not

Code:

alias rm="rm -i"

http://wiki.linuxquestions.org/wiki/Alias


All times are GMT -5. The time now is 03:04 PM.