LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Power failure killed my fstab PLEASE HELP (https://www.linuxquestions.org/questions/linux-newbie-8/power-failure-killed-my-fstab-please-help-353658/)

woranl 08-15-2005 09:05 PM

Power failure killed my fstab PLEASE HELP
 
First of all, I post this thread in "Linux - Enterprise" forum before, but because I think this is more like a Newbie FAQ.. so I decide to post in here again.. BTW, this is quite Urgent.. please help

After the power failure, my system cannot boot up...Please help..

the following is the error message:

WARNING: bad format on line 1 of /etc/fstab
WARNING: Your /etc/fstab does not contain the fsck passno field. I will kludge around things for you, but you should fix your /etc/fstab file as soon as you can.

fsck ext2: Is a directory while trying to open / [Failed]

***An error occured during the file system check
***Dropping you to a shell; the system will reboot
***when you leave the shell
***Warning SElinux is active
***Disabling security enforcement for system recovering
***Run 'setenforce1' to reenable
Give root password for maintenance
(or Control-D to continue):

Please help!! I don't have a back up of my /etc/fstab.... How do I recover my system without losting my data . .. . really need your help:cry:

kencaz 08-15-2005 09:15 PM

Hmm, Usually if there is a power failure during a Read/Write process it may cause the Read/Write head to crash into the platter causing damage. I don't think your fstab has changed but may be a physical problem with the drive.

Don't know the FC rescue process but you may want if you have access to boot a LiveCD or a bootable, either Linux or DOS disk to attempt to recover your data.

KC

woranl 08-15-2005 09:29 PM

Physical disk problem?? Oh god !!

Can anyone tell me how to back up my system? Step by Step please
I've never experience with a linux crash before....

this is bad.. :cry:

kencaz 08-15-2005 09:36 PM

Are you able to get any sort of command prompt or login either as root or user? when you boot are you able to get passed the point where it say's to "give root Password" ???

More information please...

KC

woranl 08-15-2005 09:40 PM

I meant not back up.. but how do I recover my data... DOS or LiveCD or whatever...

oh god..
I think I'm doomed....

woranl 08-15-2005 09:50 PM

Yes it does ask me to give root password as follow:

Give root password for maintenance
(or Control-D to continue):



when I type in my root password, I'm able to get into the maintenance mode.. (but I don't know what to do next)... I try to "vi" to the read only /etc/fstab file, and it seem the file is messed up...it contains numbers, not the fstab I used to know before.


:confused:

spooon 08-16-2005 02:31 AM

When using Maintenance Mode, try doing
Code:

fsck /dev/whatever
on each of your Linux partitions, where /dev/whatever is the name of the partition. That will try to fix errors in the filesystem.

If that doesn't work, try booting the FC install CD and going to rescue mode by typing "linux rescue" at the boot: prompt. Then do fsck on all your partitions.

woranl 08-16-2005 05:26 PM

I still can't recover my data...PLEASE HELP

I try to use the FC rescue disc and type

Code:

fsck /dev/hda
But because it can't read /etc/fstab, it gives me some error message.

I tried to boot using Slax LiveCD.. and try to mount my hda manually...
the /dev/hda1 was mount ok, and it contains grub, some .img files, some System.map files.. etc... I think this is the boot partition

Problem is .. I can't mount my /dev/hda2 (I suspect my linux installation is hda2, but I maybe wrong because I'm not sure) BTW, I only have 1 hard drive, so it makes sense it's hda and not other thing else

I type

Code:

mount -t ext3 /dev/hda2 /mnt/hda2
and it gives me the following error:

Code:

wrong fs type, bad option, bad superblock on /dev/hda2
missing codepage or other error
In some case useful info is found in syslog - try
dmsg | tail or so

So I type dmsg | tail and the following error occured
Code:

Can't find ext3 filesystem on dev hda2
What should I do now? :cry:
what else can I try
Please HELP...

woranl 08-16-2005 05:35 PM

maybe hda2 is swap...
ok.. here are some of the blocks that I have under /dev

hda
hda1
hda2
hdc
Loop0 , Loop1 ... etc
and some for floppy

I don't know where my linux is installed into.. I only have 1 hard drive and only 3 partitions i think,.... one for boot, one for swap and one for the main partition.

I think i'm doomed:(

woranl 08-16-2005 06:43 PM

Hi,

I've just notice that my linux is install in /dev/VolGroup00/LogVol00

This is how my partition looks like

Code:

        Device                Mount Point/Raid/Volume        Type         

LVM Volume Groups     
    VolGroup00
            LogVol01                                          swap       
            LogVol00                                          ext3         

Hard Drives
    /dev/hda
        /dev/hda1                                            ext3
        /dev/hda2                    VolGroup00            LVM PV

What kind of filesystem is LVM PV?? How do I mount that when I boot using Slax LiveCD?

When I go to the directory /dev , I can't find the directory of /dev/VolGroup00/LogVol00 ... so where exactly is it?? I'm confused...:scratch:

WhatsHisName 08-16-2005 07:16 PM

Logical Volume Manager (see the HowTo: http://www.ibiblio.org/pub/Linux/doc...LVM-HOWTO.html ). It’s a fancy way to do disk management.

/dev/hda1 = /boot
/dev/VolGroup00/LogVol00 = /
/dev/VolGroup00/LogVol01 = swap


Try mounting the “/” logical volume from the terminal like this:

mkdir /mnt/temp
mount /dev/VolGroup00/LogVol00 /mnt/temp

You may need to activate the logical volumes before you can mount/access them. Use this series of commands to activate the LVs:

lvm vgscan
lvm lvscan
lvm vgchange -a y
lvm lvscan

Only the third line should really be needed, but sometimes, you also need the first two lines.

You can now mount the LV and use vi to edit/check fstab.

When done, be sure to:

cd /
umount /mnt/temp


P.S. I have never seen swap set up as a logical volume, but I guess anything is possible.

woranl 08-16-2005 10:21 PM

Thank You EVERYONE !!!
you guys rock !


My system is now up and running w/ all data recovered !!! :D


It was a good lesson and exciting experience :study:

again, thank you all !


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