Need help with chainloading

I have a desktop with Ubuntu 11.04 (32-bit) installed.
When I installed Ubuntu, I put its boot loader (GRUB 2) in the MBR. Ubuntu itself is installed in /dev/sda1 (root) and /dev/sda/5.

I have recently also installed Slackware 13.37. I put its boot loader (LILO) in the same partition where Slackware's root resides, i.e. /dev/sda3. The other partition used by Slackware is /dev/sda7 (/home).

Now I would like to insert a chainloader command in GRUB 2 so that I can start Slackware from its menu.

Here's what I've done (which obviously does not work!):

1) I inserted the following entries in file /etc/grub.d/40_custom (as root):

Code:

menuentry "Slackware" {
set root=(hd0,3)
chainloader (hd0,3)+1
}

2) I ran the following command (as root):

Code:

grub-mkconfig -o /boot/grub/grub.cfg

The error that I get when I select "Slackware" from the GRUB 2 menu is "No such partition". Of course, I am 100% sure that Slackware's root (and LILO) reside on /dev/sda3!

So, how do I chainload this correctly? Please note that Ubuntu 11.04 uses GRUB 2, not GRUB legay!

I have a desktop with Ubuntu 11.04 (32-bit) installed.
When I installed Ubuntu, I put its boot loader (GRUB 2) in the MBR. Ubuntu itself is installed in /dev/sda1 (root) and /dev/sda/5.

I have recently also installed Slackware 13.37. I put its boot loader (LILO) in the same partition where Slackware's root resides, i.e. /dev/sda3. The other partition used by Slackware is /dev/sda7 (/home).

Now I would like to insert a chainloader command in GRUB 2 so that I can start Slackware from its menu.

Here's what I've done (which obviously does not work!):

1) I inserted the following entries in file /etc/grub.d/40_custom (as root):

Code:

menuentry "Slackware" {
set root=(hd0,3)
chainloader (hd0,3)+1
}

2) I ran the following command (as root):

Code:

grub-mkconfig -o /boot/grub/grub.cfg

The error that I get when I select "Slackware" from the GRUB 2 menu is "No such partition". Of course, I am 100% sure that Slackware's root (and LILO) reside on /dev/sda3!

So, how do I chainload this correctly? Please note that Ubuntu 11.04 uses GRUB 2, not GRUB legay!

I've no experience with LILO but have you tried "sudo update-grub" from a terminal in Ubuntu? That automatically detects other operating systems - Windows versions & other Linux OS using both Grub Legacy & Grub2 - and produces a boot menu.

I've no experience with LILO but have you tried "sudo update-grub" from a terminal in Ubuntu? That automatically detects other operating systems - Windows versions & other Linux OS using both Grub Legacy & Grub2 - and produces a boot menu.

Just a thought

Seems to me I had a strange problem with Grub, that when I updated to 11.04, the list of OSes would be off a little. There was a menu item added, labeled "other Linuxes" or something, that threw the numbering system off. So when I selected "Windows 7", it would load the OS that's listed two lines down, which was Windows Vista recovery, or some such. What I had to do was select the listing up two from what I really wanted.

Another problem I had (on a different machine) is that the Grub it boots from was not the Grub from the distro I want to use, and I can't change it. I have to boot into the "right" distro and update Grub from there.

Seems to me I had a strange problem with Grub, that when I updated to 11.04, the list of OSes would be off a little. There was a menu item added, labeled "other Linuxes" or something, that threw the numbering system off. So when I selected "Windows 7", it would load the OS that's listed two lines down, which was Windows Vista recovery, or some such. What I had to do was select the listing up two from what I really wanted.

Another problem I had (on a different machine) is that the Grub it boots from was not the Grub from the distro I want to use, and I can't change it. I have to boot into the "right" distro and update Grub from there.

You may have known this, but everytime you update to a new version GRUB places an entry in the boot list, leaving the other still intact. There's a method to remove the old entry's though. I myself am having trouble updating the grub.cfg file, I liked GRUB 1.0 better.

You may have known this, but everytime you update to a new version GRUB places an entry in the boot list, leaving the other still intact. There's a method to remove the old entry's though.

Here's what I do. If I notice that an update is installing a new Linux kernel, I would rename the old one (/boot/linuz-*) so that when update-grub ran it would see only the current version and the previous version, thus leaving order of things in the menu intact (I always had my current Windows system as the default in grub). Of course, if I wasn't paying attention during the update, I would just rename the old kernel later and run update-grub manually.

With Grub 2, never edit grub.cfg directory, instead edit the files at /etc/grub.d and /etc/default/grub instead. Yeah its different than Grub 1, but the automatic configuration in Grub 2 makes it worthwhile.