Monday, April 21, 2008

Who touched my fstab?

Confirming the whimsical nature of Linux, today morning I was unable to boot the system. Since it is not possible to scroll back through the error messages, I had to reboot a few times and use the scroll lock button to figure out what the problem was.
Apparently, the entry for / in fstab was missing! Without the root partition I was getting a long list of permission denied errors.
Thinking this may because of some data corruption, since it is difficult to imagine a particular line missing from a file overnight, I tried booting into the Opensuse installation that was also on the same drive. In Opensuse I got a "su" error, meaning that I was unable to login as root and use any of the tools limited to su, like fsck or accessing the disk partitioner to figure out how the partitions were labelled. As already mentioned in one of my posts, hda and sda are used depending on the distro used. Opensuse used sda while PC linux used hda to refer to the master primary hard disk. With OPensuse also acting dilinquent, I relied on a live cd to boot up.

I first did a fsck on the partition, and it did find some errors. Thinking this would solve the problem, I rebooted after the check. But the same errors were showing up. I also observed that even though the root partition was missing, the other partitions were being checked and tagged as clean.
Another live CD boot, and I investigated the fstab file in the relevant partition, and shockingly the entries for the root and swap partitions were missing. I am not sure how this happened. The last time I edited the fstab was probably two days back when I had mounted a few partitions and allowed the fstab to be updated. During that process, the root parition was not selected, since it was already mounted and did not need a mount point. Same with the case with the swap partition. I doubt if this could have overwritten the root and swap partition information in the fstab.

This remains a mystery. But, it confirms the claim that Linux is endowed with human qualities like eccentricity and impulsiveness.

No comments: