PDA

View Full Version : broke fstab, OS won't boot now :(



draxxus
11th September 2006, 02:49 AM
So I tried to auto mount my new hard drive in /etc/fstab in fedora core 5 and I guess I did it wrong. Now when the system boots, I get an error and have to go into shell. Now when I try to edit fstab in shell, it's read only and I can't save my modifications.

I gotto reinstall fc5?

thanks for the help

dodd
11th September 2006, 03:07 AM
Do you mean root file system is mounted read-only? Then mount it in somewhere alse. do as root:
mount /dev/hda1 /mnt (where /dev/hda1 is your root file system device)
and access your files there.

draxxus
11th September 2006, 03:18 AM
when it's starting all the services, and says Checking filesystems, "an error occurred during the file system check. Dropping you to a shell; the system will reboot when you leave the shell"
"Give root password for maintenance:"
<password>
(repair filesystem) 1 # _

that's where I'm at, I can't
(repair filesystem) 1 # vi /etc/fstab

I added the hard drive mount to fstab like this
files /dev/sda ext3 defaults 0 2

I think it's the 0 2 that killed me

pparks1
11th September 2006, 03:20 AM
Just for others sake down the road. Any time you play with imporant files, do something like this first

cp /etc/fstab /etc/fstab.backupDATE

draxxus
11th September 2006, 03:23 AM
Just for others sake down the road. Any time you play with imporant files, do something like this first

cp /etc/fstab /etc/fstab.backupDATE


Good call. However, in my particular situation I doubt it would matter much because I can't even write a new file or delete one. :(

edit: I just noticed when I go into /etc/, grub.conf is red and blinking. What's that mean? I can't even vi into it. It says recovery is impossible.

rappermas
11th September 2006, 03:40 AM
Let me be of some assitance:

Put in your Fedora installation media (cd 1 or dvd) and type linux rescue at the prompt.

Let it detect your keyboard, network, and mount the system image. You'll drop down to a shell.

type:



chroot /mnt/sysimage


This will mount your Fedora install and from here, you can pretty much just go wild. First, run fsck on your hard drive and try to repair it that way--if fsck gives any errors and warns you not to continue, don't. If you have a journaled filesystem, you may be in luck. However, you can also edit fstab here. When you're done editing it in vim, you have to type :wq! to force it to overwrite the read-only file.


exit
exit


After two exits, the system will reboot.

draxxus
11th September 2006, 04:27 AM
Let me be of some assitance:

Put in your Fedora installation media (cd 1 or dvd) and type linux rescue at the prompt.

Let it detect your keyboard, network, and mount the system image. You'll drop down to a shell.

type:



chroot /mnt/sysimage


This will mount your Fedora install and from here, you can pretty much just go wild. First, run fsck on your hard drive and try to repair it that way--if fsck gives any errors and warns you not to continue, don't. If you have a journaled filesystem, you may be in luck. However, you can also edit fstab here. When you're done editing it in vim, you have to type :wq! to force it to overwrite the read-only file.


exit
exit


After two exits, the system will reboot.

You rule. 'Nuff said.

Thanks everyone.