Installing next to (K)Ubuntu

Just a safety tip…

If you are installing along side of (K)Ubuntu, you may have problems booting back to your ubuntu distro. The openSuse installer will put a menu item for it in it’s list which will go to it’s menu file (i.e. all your old options from ubuntu will show up when selected). My kubuntu menu never called out a new root though so it could not find the kernel image. I fixed it by mounting the partition from within openSuse and adding ‘root (hd0,4)’ to the menu entry. Seems to have done the trick, I can now boot to either openSuse or Kubuntu. Don’t know how updates will be handled yet, but I’m backing up my MBR as a precaution.

Note that grub is zero based for drive and partition so hd0,4 looks in the fifth partition of the first drive.

So you’re saying it chain loads the GRUB of previous Kubuntu, just misses the root (hdX,Y) entry.

That’s actually better than expected, there was a bug reported just before release time, which implied it was trashing boot of past installs.

Could you as matter of interest post your working GRUB entry here?

Sure thing:

I fixed the kubuntu boot by mounting the partition that it was installed on (/dev/sda5 in my case). Edit the /boot/grub/menu.lst file. In order to avoid messing with kubuntu’s automatic update of that file (and to avoid it messing with me), I didn’t update the entry in place, instead copy the default one and add it at the bottom, at least below the line:


### END DEBIAN AUTOMAGIC KERNELS LIST

The only thing that I needed to add was the line that starts with root. Everything else is just copied straight from the original entry. Note that I am using the kernel image at /boot/vmlinuz-2.6.31-16-generic on the fifth partition of the first hd (grub hd and partition counts are zero based).

title		Ubuntu 9.10, kernel 2.6.31-16-generic hd0,4
root		(hd0,4)
uuid		6c8e766c-74ce-4000-b964-60b01d3322b1
kernel		/boot/vmlinuz-2.6.31-16-generic root=UUID=6c8e766c-74ce-4000-b964-60b01d3322b1 ro quiet splash 
initrd		/boot/initrd.img-2.6.31-16-generic
quiet

I guess having to do all this by hand a few years ago payed off, I may have freaked out a little bit if I was new to grub ;). There may be a better way to do this as well. One that will not cause me to have to re-copy the default entry after every kernel update, but I’m likely sticking with openSuse, so have not worried about tinkering with it yet.

Here’s what I have in openSUSE, which did work when I finally did a reboot to see Kubuntu’s GRUB2 menu. The direct way, and punting to 2nd boot loader menu :


#
# Rob : 2009/12/10 : Ubuntu 9.10 Entry
#
title Kubuntu 9.10 - 2.6.31-16-generic
    kernel (hd0,11)/vmlinuz-2.6.31-16-generic root=/dev/disk/by-id/ata-WDC_WD2500JS-75NCB3_WD-WCANKL034520-part13 splash=silent showopts vga=0x31a
    initrd (hd0,11)/initrd-2.6.31-16-generic

title Kubuntu GRUB2
    rootnoverify (hd0,11)
    chainloader +1

The only thing I needed to watch installing Kubuntu was opening up an “Advanced” option to select where GRUB is installed.

Oddly starting openSUSE from the auto-generated GRUB2 menu option resulted in it being very slow, when I checked I found only 1 CPU was active. Could be an effect of the chainloading not passing along all the BIOS info perhaps. In openSUSE I find you can boot via the “latest” links which are maintained by a kernel update, ignoring the version numbers.


#
# Rob : 2009/12/02 : OS-11.2 DVD Install Entry
#
title openSUSE 11.2 - up to date
    kernel (hd0,0)/OS11.2-DVDBoot/vmlinuz root=/dev/disk/by-id/ata-WDC_WD2500JS-75NCB3_WD-WCANKL034520-part11 splash=silent showopts vga=0x31a
    initrd (hd0,0)/OS11.2-DVDBoot/initrd

That avoids hand edits which need changing after every kernel update. Unfortunately Kubuntu’s kernel is not offering such convenient links, so to boot the newer kernel from openSUSE boot code, a hand update (or a script to update the links) is required.

I’ve been installing openSUSE 11.2 a couple times on 3 machines which had already Ubuntu karmic. 11.2 Setup never found Ubuntu nor added it in its menu.lst. It found others, like Fedora. It’s probably related to Ubuntu using Grub2. After editing /boot/grub/menu.lst manually it was never a problem to chainload Grub2 or boot an Ubuntu kernel.

If you want to keep booting Ubuntu Grub2 in first place, you should tell openSUSE explicitely NOT to write a generic bootcode in MBR. Not installing Grub in MBR (the default) is NOT enough to keep Grub2 booting. There is a checkbox three clicks away from Booting setup that you might have to uncheck. I described this issue already in another thread.