Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 12-26-2005, 02:55 PM   #1
LQ Newbie
Registered: Dec 2005
Posts: 1

Rep: Reputation: 0
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!
Old 12-26-2005, 03:17 PM   #2
Senior Member
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 57
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.
Old 12-26-2005, 09:25 PM   #3
Registered: Nov 2005
Distribution: Arch Linux
Posts: 84

Rep: Reputation: 15
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.
Old 12-26-2005, 09:35 PM   #4
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
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.

Last edited by btmiller; 12-26-2005 at 09:37 PM.
Old 12-26-2005, 09:47 PM   #5
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 472Reputation: 472Reputation: 472Reputation: 472Reputation: 472
I have changed the title slightly to make it less, ummm, emotional.

And welcome to LQ
Old 12-27-2005, 02:35 AM   #6
Senior Member
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

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

alias rm="rm -i"


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
can i recover deleted files from a reiser4 fs? jameson Linux - Newbie 5 12-24-2005 05:27 AM
200GB of files Deleted - How to Recover? newlinuxnewbie Linux - General 4 10-05-2005 01:03 PM
how to recover deleted files sibtay Linux - Software 13 01-22-2005 09:09 PM
Recover deleted files? subaruwrx Linux - Newbie 8 06-04-2004 09:47 AM
Recover deleted files markdw Linux - General 1 12-07-2001 05:08 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:12 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration