LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-26-2005, 01:55 PM   #1
Hector404
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, 02:17 PM   #2
Lenard
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: 56
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, 08:25 PM   #3
Cirdan
Member
 
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, 08:35 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,060

Rep: Reputation: 295Reputation: 295Reputation: 295
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 08:37 PM.
 
Old 12-26-2005, 08:47 PM   #5
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,174
Blog Entries: 4

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

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

Rep: Reputation: 46
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
 
  


Reply


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 04:27 AM
200GB of files Deleted - How to Recover? newlinuxnewbie Linux - General 4 10-05-2005 12:03 PM
how to recover deleted files sibtay Linux - Software 13 01-22-2005 08:09 PM
Recover deleted files? subaruwrx Linux - Newbie 8 06-04-2004 08:47 AM
Recover deleted files markdw Linux - General 1 12-07-2001 04:08 PM


All times are GMT -5. The time now is 01:39 AM.

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