Submitted by MTag on Tue, 22/03/2005 - 10:06.
( categories: Distributions )

Salamoo Alikoooo,
I'm using RedHat 9 (a very old distro), I need a folder was deleted by a mistake.
How can i recover this?
Thanks


Alaa's picture
Submitted by Alaa on Tue, 22/03/2005 - 17:26.

it depends on which file system you use, I know it is possible to undelete files from ext2 filesystems, and it is not easily possible to do it from ext3, no idea about other filesystems.

search for undelete and recover on freshmeat

cheers, Alaa


http://www.manalaa.net "i`m feeling for the 2nd time like alice in wonderland reading el wafd"


Pronco's picture
Submitted by Pronco on Tue, 22/03/2005 - 18:12.

Overall, linux does not know folders. that's an MS invention.

They are called directories, not folders.

Concerning to yours I never done recovering of directories but you can grep the files also you could use the ext2 debugging utility otherwise search somewhere for undelete utilities for ext2 Here it Is

This does the trick and there are lots of links on further knowledge

If you're currently use ext3 you can simply convert it to ext2 then revert it to your previous ext3 filesystem


I used to be indecisive .. but now I'm not so sure


Submitted by phaeronix on Wed, 23/03/2005 - 02:28.

dunno about the rest of the info you mention, but I just wanted to say that an ext3 filesystem cannot be "converted" to ext2.

Actually it is an ext2 filesystem, that has a journal.

so : ext2 + journal = ext3

You can simply mount the ext3 partition as ext2 and no journalling will take place. ie. mount -t ext2 /dev/hdawhatever /mnt/whatever

Alaa's picture
Submitted by Alaa on Wed, 23/03/2005 - 03:16.

while you can mount ext3 as ext2 undelete still doesn't work (I've no idea why don't ask me).

there is a solution that uses libmagic to try and find files, probably won't work with most plain text files though.

cheers, Alaa


http://www.manalaa.net "i`m feeling for the 2nd time like alice in wonderland reading el wafd"


MohammedSameer's picture
Submitted by MohammedSameer on Wed, 23/03/2005 - 04:11.

I once found that it's because ext3 zeros the inodes, I'm not sure whether this is correct or not as I didn't really understand it!


-- I was known as Uniball!
WWW: http://www.foolab.org/
Quote "c u next life time then when i come back as a mug of tea :P"


Pronco's picture
Submitted by Pronco on Wed, 23/03/2005 - 04:47.

you can convert ext3 filesystem to ext2 (and vice versa)

unmount the partition you want to convert then enter the following command:

tune2fs -O ^has_journal /dev/hdaX

once the conversion process is complete, check the partition for file system errors by entering the following command:

fsck.ext2 -f /dev/hdaX

after the file system check is finished, you can safely delete the .journal file (if one was created).


I used to be indecisive .. but now I'm not so sure


Submitted by phaeronix on Wed, 23/03/2005 - 05:56.

please, the guy asked how to undelete files, not how to break the filesystem. doing all this won't undelete the files.

Besides journalled filesystems are more reliable. So don't g back to ext2.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.