LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-13-2004, 11:53 PM   #1
sibtay
Member
 
Registered: Aug 2004
Location: U.S
Distribution: Ubuntu
Posts: 145

Rep: Reputation: 15
how to recover deleted files


hello

i ve accidently deleted a folder with

rm -rf <folder name>

can i recover it?
 
Old 12-14-2004, 12:15 AM   #2
student04
Member
 
Registered: Jan 2004
Location: Georgia
Distribution: OS X, CentOS
Posts: 669

Rep: Reputation: 34
From my knowledge, no.

But then I don't really know what linux is doing behind the scenes when files are removed with the rm command.
 
Old 12-14-2004, 12:29 AM   #3
ogmoid
Member
 
Registered: Jul 2004
Location: Coeur d'Alene Idaho
Distribution: Slackware
Posts: 41

Rep: Reputation: 15
Take a look at this:

unrm

[My understanding is that rm does an 'unlink' on the files .. effectively forgetting they exist. rm itself doesn't actually overwrite files.]
 
Old 12-14-2004, 02:10 AM   #4
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
You may also want to check out libtrash. I haven't tried it, and don't know how well it works. I will not help you with your present dilemma, though. It is supposed to create a recycle bin type of folder where things are moved to when they are deleted.

Thanks ogmoid for your post. What little I have seen on undeleting in Linux made me think that there was no easy way to do it. I think this project only applies to ext2 (and probably ext3) filesystems though.
 
Old 12-14-2004, 04:44 AM   #5
hari_seldon99
Member
 
Registered: Jun 2003
Location: Front of PC
Distribution: Linux Mandrake
Posts: 212

Rep: Reputation: 30
In theory, it is possible to recover the data, since when you delete the file, all you delete are the inodes and stuff at the filesystem level, not the data itself. It's still there. You can use unrm or access your hd on windows and use Acronis Data Recovery on the linux partition. If the data is buried very deep in the magnetic multilayers of the HD, then you will have to use scanning microscopy to recover the data, and there are professional data-recovery companies that do so.
 
Old 01-19-2005, 11:04 AM   #6
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
Quote:
Originally posted by gd2shoe
I think this project only applies to ext2 (and probably ext3) filesystems though.
Tried this with ext3 as an experiment, get just a complaint:
Checking device /dev/hdb2...is not an ext2 file system!
So I wouldnt bet on the ext3 compatibility.. (:
 
Old 01-20-2005, 04:44 AM   #7
hari_seldon99
Member
 
Registered: Jun 2003
Location: Front of PC
Distribution: Linux Mandrake
Posts: 212

Rep: Reputation: 30
Quote:
Originally posted by student04
From my knowledge, no.

But then I don't really know what linux is doing behind the scenes when files are removed with the rm command.
Doesn't it just move the file to /dev/null/ ?
 
Old 01-21-2005, 02:42 AM   #8
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
Quote:
Originally posted by hari_seldon99
Doesn't it just move the file to /dev/null/ ?
Arrrrrrrgh.

I just got half way through explaining what really happens when something gets deleted. I glanced down, and saw that you already have a sound understanding of where the file goes to.

That... must have... been... a, joke?

<smack head on keyboard> <think about it for a minute> <repeat>
 
Old 01-21-2005, 03:48 PM   #9
Not now, John!
Member
 
Registered: Jul 2004
Distribution: LFS 5.1
Posts: 161

Rep: Reputation: 30
If you use ext2 then you're lucky.
If you're using ext3 then there's no easy (read: cheap) way of recovering data.
 
Old 01-21-2005, 05:19 PM   #10
student04
Member
 
Registered: Jan 2004
Location: Georgia
Distribution: OS X, CentOS
Posts: 669

Rep: Reputation: 34
Quote:
Originally posted by gd2shoe
I will not help you with your present dilemma, though.
That's a typo, I believe. "I" should be "It", or? One typo changed the entire meaning... *cries* gd2shoe doesn''t like helping people *runs away*
 
Old 01-21-2005, 10:03 PM   #11
realjustin
Member
 
Registered: Aug 2004
Location: /dev/null
Distribution: Slack 10, Debian
Posts: 99

Rep: Reputation: 15
If you use ext3 you can mount it as ext2 and lose the journaling abilities, then you may be able to use that tool.
 
Old 01-22-2005, 03:53 AM   #12
Not now, John!
Member
 
Registered: Jul 2004
Distribution: LFS 5.1
Posts: 161

Rep: Reputation: 30
Quote:
Originally posted by realjustin
If you use ext3 you can mount it as ext2 and lose the journaling abilities, then you may be able to use that tool.
No, it won't work. I tried that.
 
Old 01-22-2005, 04:06 AM   #13
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
What happens at that point? Is there an error?

Can you post the message?

Cool
 
Old 01-22-2005, 08:09 PM   #14
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
Quote:
Originally posted by student04
That's a typo, I believe. "I" should be "It", or? One typo changed the entire meaning... *cries* gd2shoe doesn''t like helping people *runs away*
Yeah, you'd better run!

<sigh>

I almost always spell check my posts. The checker kinda misses that one though. You can feel free to have some lighthearted humor at my expense, just be aware that some others (even here at lq) are easier to offend.
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
200GB of files Deleted - How to Recover? newlinuxnewbie Linux - General 4 10-05-2005 12:03 PM
recover deleted windows files from linux(help) rkrishna Linux - General 2 06-22-2005 11:32 AM
Recover deleted files on CDUDF (Direct CD) Vincent_Vega Linux - General 2 12-29-2004 11:08 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 04:56 PM.

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