Sunday, 3 May 2009

Adventure of a Gentoo install

My first Gentoo install was on an x86 laptop. It worked fine. I wouldn't say it was a piece of cake as I would say for a SuSE install. However, it was pretty much close. I was trying to get the GUI installer to work but realized gradually that it was broken and I should try my hands on the command line. After few years of linux experience, I wasn't scared of the shell. The install completed fine. I successfully configured a dual boot system. I liked Gentoo's performance and ease of tweaking. So, I decided to try Gentoo on my old desktop at home.

Now that I am enjoying vacation at home, I decided to embark on the Gentoo installation adventure (I wont be calling it an adventure, were it not in retrospection.). Recently, the desktop was upgraded to an core 2 duo processor (E7200). So, I thought of giving the amd64 version a shot. I started from the command line. Everything went fine till the grub installation. I configured my bsnl broadband to work with it. I shall write about it in my next post.

The minimal install cd kernel showed the partitions as /dev/hdbx (x being the numbers differentiating partitions). So following the instructions of the handbook, I decided that hdb7, my root partition which contained /boot folder (I do not use a separate /boot partition.) translates to (hd1,6) in grub terminology. I created grub.conf with hdb7 as root and tried install grub with root on (hd1,6). However, I was surprised when an error message told me that no such device existed. I cross checked the handbook and found I was doing as it said. I decided to get some expert opinions on this. So, I switched another virtual terminal and fired up irssi. I talked to people in the #gentoo channel. They also confirmed that I was doing fine and I didn't get any reason for such behaviour. Then I was suggested to try grub-install. I thought lets give it a shot. There were more surprises to come. The device map showed the following translations.
/dev/fd0 -->> (fd0)
/dev/hdb -->> (hd0)
/dev/sda -->> (hd1)
/dev/sdb -->> (hd2)
I reported back at #gentoo and people there were surprised too. I thought I should try in #grub channel as well.

After joining the channel, I read the channel topic. They were basically focusing on grub 2. After confirming that I could about previous grub versions, I put forth my situation. They told me that the device map isn't much predictable as it depends on the BIOS. They also told me that grub is designed such that almost always the device from which the system can boot is (hd0), as happened with me: grub-install made the / partition as (hd0) as it was going to boot from it.

Now that I had understood why and how grub was translating my partitions, (unlike as described in the Gentoo handbook,) I edited my grub.conf to reflect the changes and installed grub manually. After successful install, I was happy to see the splash image and multi-boot options; but the adventure was far from over.

First, I checked if my windows partition was okay. It was relieving to find that it was perfectly alright. Then rebooted again to resume my adventure and headed straight into the next hurdle. I started my newly installed Gentoo system only to run into a kernel panic. The error message came from VFS telling me that it could not find the root partition /dev/hdb7. The first thought that came to my mind was: probably I was right in the beginning in suspecting about the success of the install when I saw hdb instead of sdb. My doubt was based on the fact that irrespective the disk drive being ATA or SATA, newer kernels use to refer to them as /dev/sdx, where x is a letter differentiating drives. The kernel panic message also told me that I should try with /dev/sdxN format. The reason I had not done it before was because I trusted the live cd kernel's behaviour. As the minimal install cd was burnt from an iso generated by the latest autobuild, I did not think that the live cd kernel would be outdated or behave like an outdated one. I checked at #gentoo and was advised to file a bug (my first bug report) after double checking.

I used the minimal install cd again and chrooted to my root partition. I editted my grub.conf and fstab to suit newer kernels' format. After a reboot, I was happy to have successfully installed Gentoo.

No comments: