Thursday, December 11, 2008

Editing fstab from "Repair Filesystem" prompt in Fedora 9

My Fedora 9 server is a laptop with a non-standard harddisk setup. In a mis-guided attempt to reduce the heat produced by the laptop, I removed the internal SATA II harddisk and put the Fedora's / root partition on a external SATA II harddisk connected by a SATA ExpressCard. As my laptop do not detect the main harddisk connected by the SATA ExpressCard, I created the /boot partition on a 1GB USB disk.

Here comes the problem, the USB disk is detected as either "/dev/sda1" or "/dev/sdb1" at different boot times. Thus I have the problem of deciding what to put in the fstab. You may ask when don't I use the UUID since these devices are controlled by udev anyway. It's because sometimes the UUID used to identify the USB disk do not work during boot up and Fedora drops me into the "Repair Filesystem" prompt.

Usually, I'll insert the Fedora DVD, boot into "Rescue" mode, chroot /mnt/sysimage/ and edit the fstab file. But when I rebooted and encountered the same problem last night, I got fed up of getting the DVD again.

I found the following forum while googling and the answer provided is exactly what I need:

In the "Repair Filesystem" prompt, login and remount the filesystem with:
> mount -o remount,rw /

I can modify the fstab file now.

Also, I found out that the system can boot up perfectly fine without mounting the /boot partition when I removed the entry from fstab. But I put the /boot entry back in case I forget to remount /boot when I upgrade the kernel in the future.

No comments: