LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to recover deleted files (https://www.linuxquestions.org/questions/linux-software-2/how-to-recover-deleted-files-266158/)

sibtay 12-13-2004 11:53 PM

how to recover deleted files
 
hello

i ve accidently deleted a folder with

rm -rf <folder name>

can i recover it?

student04 12-14-2004 12:15 AM

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.

ogmoid 12-14-2004 12:29 AM

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.]

gd2shoe 12-14-2004 02:10 AM

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.

hari_seldon99 12-14-2004 04:44 AM

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.

Artanicus 01-19-2005 11:04 AM

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.. (:

hari_seldon99 01-20-2005 04:44 AM

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/ ?

gd2shoe 01-21-2005 02:42 AM

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>

Not now, John! 01-21-2005 03:48 PM

If you use ext2 then you're lucky.
If you're using ext3 then there's no easy (read: cheap) way of recovering data.

student04 01-21-2005 05:19 PM

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*

realjustin 01-21-2005 10:03 PM

If you use ext3 you can mount it as ext2 and lose the journaling abilities, then you may be able to use that tool.

Not now, John! 01-22-2005 03:53 AM

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.

MasterC 01-22-2005 04:06 AM

What happens at that point? Is there an error?

Can you post the message?

Cool

gd2shoe 01-22-2005 08:09 PM

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.


All times are GMT -5. The time now is 10:46 AM.