Saturday, November 20, 2010

Reflections on GRUB 1

I noticed that after installing openSUSE on my hardisk, I was able to boot from either FreeBSD or PC BSD but not both. Of course, I could always boot into openSUSE. I couldn't quite understand it. There were 3 operating systems on my hard disk - FreeBSD, PC BSD and openSUSE. But why was it that whenever I would choose either FreeBSD or PC BSD from the GRUB menu, I would succeed in booting into one of them?

The FreeBSD and PC BSD boot managers had simple functionality and small enough to fit into the MBR. GRUB was more complex. In fact, in Linux world, GRUB is called a boot loader and seldom boot manager. The fact is that GRUB loads in stages. The stage 1 loads first and is tiny enough to fit into the MBR. The subsequent stages of grub (1.5 and 2) load later and are present in the first sector of the respective partition (grub's home partition) or something like that.

Anyway, I need to investigate on that. But, I could solve the above problem by actually going through the installation procedure for GRUB after openSUSE had got installed. That means, GRUB was not previously installed into the MBR! Then how was openSUSE getting loaded. I noticed that the extended partition on which openSUSE was installed was marked active. When I made some other partition active, the GRUB menu was never displayed, so the partition on which GRUB (openSUSE) was installed had to be active for it to load. The fact that GRUB was not in the MBR may also have been the reason for the funny behavior I noted in the first paragraph of this post.

Jaya Sri Sridharasvami Maharaja.