August 2, 2009

Ubuntu 9.10 - GRUB Bootloader Changes Coming

I have been testing Ubuntu 9.10 (Karmic Koala) Alpha 3 for the past few days.  I like it, a lot.  It has a lot of really good changes, improvements and fixes.  One of the biggest, though, needs to be handled with care - they are changing from the original (legacy) GRUB bootloader to the new GRUB 2 (aka grub-pc).  There is always a certain amount of risk involved when changing such a fundamental piece of software, but I have installed Karmic, with GRUB 2, on all of my systems now, and none of them had a problem with it.  However, users who have multi-boot systems, and those who are accustomed to editing their GRUB configurations, are in for some surprises, and some adjustment.

I don't intend to go into a lot of detail here about using or configuring GRUB - that is covered adequately on the <a href="http://www.ubuntu.com/testing/karmic/alpha2">Ubuntu 9.10 Alpha 2</a> announcement and related pages.  What I want to describe here, briefly, is how I have set up my multi-boot systems to have both Januty and Karmic installed, retain legacy GRUB for Jaunty (and other multi-boot use) and use GRUB 2 for Karmic.

The first step is simple.  Install Ubuntu 9.10 Alpha 2 to a separate partition on your disk.  I did this, and didn't pay any attention to GRUB installation, and what I ended up with was GRUB 2 in the MBR of the disk, which makes it the default bootloader.  Because I multi-boot a LOT of other Linux distros and XP Professional on this netbook, and I am totally clueless about configuring GRUB 2, I wasn't too happy with that.  I restored legacy GRUB after booting the existing Jaunty partition, but then I couldn't use the standard configfile notation in the Jaunty GRUB configuration to boot Karmic.  Ugh.

The Karmic Alpha release mentions that GRUB 2 can be chainloaded from a legacy GRUB installation.  The instructions there describe installing GRUB 2 into the existing Jaunty system, and then chainloading to run it.  Also not what I wanted to do.  Knowing that chainloading is not terribly complex, I decided to try to set up what I really wanted myself.  It turned out to be even easier than I expected.

I booted the Karmic installation again, and used grub-install /dev/sda14 to get GRUB copied into the header of the Karmic partition.   After a little bit of whinging from GRUB about this not being a good idea, it copied in just fine.  Then I booted back to the Januty installation, and editied the legacy GRUB config file /boot/grub/menu.lst.  All I did was add this:

title Ubuntu 9.10 (Karmic Koala) Alpha 3

root (hd0,13)

chainloader +1

 

Then I rebooted, chose the new Karmic boot option, closed my eyes and... it worked!  GRUB 2 came right up, I booted Karmic from there, and life is wonderful.

There are obviously a number of other ways to approach this problem.  The best is probably to learn enough about GRUB 2 to be able to configure it the way I want for multibooting, but I'm a bit short on time right now, and I would really rather not be under pressure when I set about learning that.  So this got what I needed done, and gives me a GRUB 2 bootloader installation that I can use to learn the new GRUB configuration.

One last warning.  Changing something as critical as the bootloader is risky business.  Make sure that you know how to recover from whatever errors you might make, BEFORE you start.  Your mileage may vary.

jw 2/8/2009

Click Here!