HowTo Boot / Multiboot Ubuntu from the openSUSE GRUB bootloader

Versions: Tested in openSUSE 11.1, 11.2 and Ubuntu 9.04, 9.10.

Scenario: You have openSUSE and Ubuntu (and perhaps other distros) on your drives. After an online update of either Ubuntu or openSUSE, you can no longer boot Ubuntu from openSUSE, or perhaps you couldn't boot Ubuntu from openSUSE's bootloader menu from the very beginning. This tutorial takes you through replacing the default entry that Yast makes in openSUSE's boot menu with a better or repaired entry.

Note re booting Grub 2 in Ubuntu 9.10+ from openSUSE's legacy version of Grub with this code: yes it works fine.

Locate Ubuntu's entry in openSUSE's Grub menu

In this tutorial I use an example where Ubuntu is installed on partition sda9. In Grub parlance that's (hd0,8). Be sure to adjust any code you take from here for the partitioning on your computer.

You should find an entry for Ubuntu in openSUSE's Grub menu file (menu.lst). The file has restricted read/write access so you use this command to view it in your console window: sudo cat /boot/grub/menu.lst. Here's the default entry for Ubuntu in menu.lst:

#Don't change this comment - YaST2 identifier: Ubuntu 9.04 2.6.28-11#
title   Ubuntu 9.04, kernel 2.6.28-11-generic (/dev/sda9)
root    (hd0,8)
kernel  /boot/vmlinuz-2.6.28-11-generic root=/dev/sda9 ro quiet splash
initrd  /boot/initrd.img-2.6.28-11-generic

The reason this entry failed in real life was that the Ubuntu kernel was upgraded by an online update. It was no longer version 2.6.28-11, and so the entry became obsolete and if I update it, eventually it become obsolete again.

You might find a different style of entry, one that uses the configfile command from Grub's vocabulary. It looks like this:

#Don't change this comment - YaST2 identifier: Ubuntu 9.04 2.6.28-11#
title   Ubuntu 9.04, kernel 2.6.28-11-generic (/dev/sda9)
root    (hd0,8)
configfile /boot/grub/menu.lst

This entry generated by Yast during installation points to the Grub installation on the partition containing Ubuntu, in this case sda9. If you were to select this entry from the boot menu, control would be handed off to sda9 by way of that partitions "configfile", menu.lst. This usually works very well. But if the menu.lst or the Grub installation on sda9 is corrupt, the entry will fail.

Of course, you might find some other entry style for Ubuntu, or simply find that there is no entry at all for Ubuntu in menu.lst. Don't be fazed. Just edit in the recommended entry that I discuss in the next section.

Replace/fix Ubuntu's entry in openSUSE's Grub menu

First I'll show you the entry to use in openSUSE's menu.lst instead of either of the entries above. Then I'll explain it and its advantages. Here's the new entry for Ubuntu:

#Don't change this comment - YaST2 identifier: Original name: none#
title      Ubuntu 9.04 booting via symlinks
root       (hd0,8)
kernel     /vmlinuz root=/dev/sda9 ro quiet splash
initrd     /initrd.img

I'm going to refer to the first of the three code snippets above as code box #1, the second as code box #2 and the third as code box #3.

Consider code box #3: Ubuntu has symlinks vmlinuz and initrd.img in the root directory that point to the current real vmlinuz and initrd.img. The boot entries point to the symlinks /vmlinuz and initrd.img which call the correct contemporary values in the /boot directory. When an online update replaces the real vmlinuz and initrd.img in the /boot directory, the symlinks are updated to point to the new files. Thus the bootloader entry in code box #3 is never obsoleted by the online update process, unlike the bootloader entry in code box #1.

Now consider the flaw in the bootloader entry in code box #2: That snippet invokes the menu.lst file in the Ubuntu partition. If that file is corrupted, booting fails as is seen from time to time. But the alternate option in code box #3 does not use the menu.lst file in the Ubuntu partition at all, so it is not affected by any problems that occur in Ubuntu's menu.lst.

So the point of the tutorial is this: If you have an entry in your openSUSE menu.lst that is like either of the entries in code boxes #1 or #2 and it fails, then replace it with the entry in code box #3 and booting should be restored.

You can open the file menu.lst for editing with either of these console commands:

For Gnome users --> gnomesu gedit /boot/grub/menu.lst
For KDE users  --> kdesu  kwrite /boot/grub/menu.lst


That's all folks.
Swerdna, June 27 2009. Last updated April 7 2010.