Steve’s Computer Adventures II
It seems that lately, my computer has been doing a lot of very scary things… frightful to the innocent user who doesn’t know how to revive Windows XP from a recovery CD after an update fails. And last night, frightful to the user who doesn’t know how to fix a failing boot-loader.
I use GRUB as my boot-loader on my computer. For those of you unfamiliar with the term, a boot-loader is a small piece of software that starts the process of “booting” your computer, or loading the operating system. The boot-loader is located on the first 512 bytes of a hard-drive, and this is the place that the computer “instinctively” knows to look when looking for an operating system. Different boot-loaders differ very much in terms of features and complexity, and as a result, some boot-loaders cannot fit in this small, 512 byte region on a hard-drive. To solve this problem, people have developed what are called multi-stage boot-loaders (GRUB being a great example). In a multi-stage bootloader, the first 512 bytes of code on the hard-drive are responsible not for starting the operating system, but instead for loading the rest of the boot-loader!
As I mentioned, I use GRUB as my boot-loader on my computer. The advantage of GRUB is that it allows me to have a dual boot system between Linux and Windows – GRUB is capable of starting either operating system, and it displays a nice pretty menu that lets me pick every time I turn my computer on. All of my GRUB configuration files, as well as the secondary stages of the boot-loader, are all located on one of my Linux partitions on my hard-drive.
So last night, while packing for my trip back to MIT, I decided to check my email.
Bad Idea!
When I turned my computer, I was immediately confronted with an ugly boot-loader error from GRUB: Could not load GRUB stage 1.5 (one of the secondary boot-loader stages). This really isn’t a good sign. If a boot-loader fails, you aren’t able to access the rest of your system. Although all of my files and settings could still have been in tact, I’d be useless to access them, since I could boot neither Linux nor Windows. Pretty scary, huh?
The best solution I could think of to get my PC working and happy again was to use an Ubuntu LiveCD. Since I just re-installed Ubuntu a few days ago (see other posts!), I had an 8.10 LiveCD quite handy. So, I popped the CD into my computer. Since computers check CD drives before hard-drives, Ubuntu 8.10 jauntily booted off of the LiveCD. From there, I noticed something strange: I couldn’t mount my root Linux partition! All of my program files and configuration files were on this parition, and it’s a bad sign if it can’t be mounted. Something must have corrupted this file system. GParted is a program designed for doing lots of administrative tasks on hard-drive, and I tried scanning and fixing the partition for errors. After this, I was able to mount the partition, but then all of my files on it were gone….??
Well, that explains why by boot-loader wasn’t working. If the secondary stages of the boot-loader and all of my configuration files were on an un-mountable partition, then my boot-loader wouldn’t be able to work! I was tired and it was late last night, and I didn’t feel like spending hours fixing my partition. So, I took the brute-force approach and just re-installed Ubuntu, which put back the default system files and created a working boot-loader. After this, everything worked fine.
I’m still kind of mystified as to why any of this happened… do you have any ideas about what could have corrupted my root Linux partition? The funny thing is, my computer was working fine earlier in the day, and I wasn’t even using Linux! I was using Windows, and the one thing I thought of that perhaps may have caused this is a program in Windows that reads ext3 files on other partitions. I was looking through my ext3 files earlier in the day from Windows, and perhaps this program corrupted my filesystem?
Who knows for sure… but thus ends another edition of Computer Adventures… for now!

