-   Linux - General (
-   -   recovering files (

nocturnal 04-18-2003 08:45 PM

recovering files
ok from the beginning...
i wanted to try slackware 9.0 so i decided to boot with the cd in the drive and i got a checksum error so i thought nothing big i just download a new one and make sure it works this time, well when i wanted to boot redhat right after the slack cd error it all went just fine until the x server was supposed to start then the screen just went blank and i've tried Ctrl+Alt+Backspace to terminate the x but nothing worked and after a minute it rebooted.
ok well after that i wanted to boot debian and suddenly after it didn't work even though i had never had problems with debian grub had a problem with booting it...
well well i had nothing important on debian and i had like tons of code and work on redhat so i decided to reinstall debian and this time use lilo instead of grub incase there was a problem with grub.
now debian works alright but i want to recover all my files on redhat, i tried booting with the redhat cd and used the rescue option and that gave me access to the partion but a lot of dirs were no listed and not the one dir i wanted to save containing all my code.
so i tried mounting the partion through debian but it wouldn't mount instead it told me to use some program called e2fsck(i can't remember the exact name)i don't know anything about this program.
can anyone please help me recover my files before i lose all faith in linux ;)

jailbait 04-18-2003 11:36 PM

Every time you umount a disk partition, such as at shutdown, Linux puts a record at the beginning of the partition assuring the world that the file was cleanly unmounted. If you try to mount that partition and the clean dismount record is not there then Linux will refuse to mount the file system because it may be corrupt. The corruption could be anything from merely missing a clean umount record to a thoroughly scrambled file system.

If your ext2 file system is corrupt then you need to run fsck (which will call e2fsck if it is an ext2 file system). fsck must be run against an unmounted file system. Assuming that hdc2 is the corrupt partition then the command you want to issue is:

fsck /dev/hdc2

fsck will go through your entire partition four or five times and try to fix the file system. Since there is a lot of redundency in an ext2 file system fsck is usually quite successful. It may start asking you for permission to fix certain errors. I have found that the best answer is always "yes". If fsck finds file fragments that it does not know what they are it gives the fragment a number and places it in a directory called lost+found. So after you run fsck check lost+found for lost file fragments.

nocturnal 04-19-2003 01:11 PM

i did all this and after i could mount the partion alright, but i still can't find any of the dirs i created after installing redhat.
what can i do?

jailbait 04-19-2003 04:31 PM

There are only two places to look for the files. They are either in their proper place or they are in lost+found. Otherwise they do not exist.

There is a lost+found for every partition. The lost+found that you want to look at is on the partition that you ran fsck against.

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