LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-03-2011, 09:53 PM   #1
tb75252
Member
 
Registered: Oct 2010
Distribution: Slackware 14.2 (64-bit)
Posts: 149

Rep: Reputation: Disabled
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!
 
Old 09-03-2011, 10:43 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
You really don't need to deal with chainloading LILO from GRUB2.

The simplest solution is mount your slackware partition and :

Create a /boot/grub directory.

Create a /boot/grub/menu.lst file containing

Code:
title Slackware Latest
root (hd0,2)
kernel /boot/vmlinuz root=/dev/sda3 ro
If you have a custom kernel or use the huge kernel.

or

Code:
title Slackware Latest
root (hd0,2)
kernel /boot/vmlinuz root=/dev/sda3 ro
initrd /boot/initrd.gz
If you use an initrd.

You just have to make sure that the symbolic link /boot/vmlinuz points to the kernel of your choice.

Then boot your Ubuntu install and

Code:
sudo update-grub
and you will be able to boot into your latest slackware kernel.

You can add other entries to your menu.lst file if you choose.

Grub does not even have to be installed for this to work (although I believe that it is installed in a normal "full" slackware installation.)
 
Old 09-03-2011, 10:56 PM   #3
tb75252
Member
 
Registered: Oct 2010
Distribution: Slackware 14.2 (64-bit)
Posts: 149

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andrewthomas View Post
You really don't need to deal with chainloading LILO from GRUB2.

The simplest solution is mount your slackware partition and :

Create a /boot/grub directory.

Create a /boot/grub/menu.lst file containing

Code:
title Slackware Latest
root (hd0,2)
kernel /boot/vmlinuz root=/dev/sda3 ro
If you have a custom kernel or use the huge kernel.
Thanks, Andrew.
It is my understanding that GRUB 2 no longer uses menu.lst. I found this information at https://help.ubuntu.com/community/Grub2 (in the File Structure section).
Do you think that I need to use some other file with GRUB 2?
 
Old 09-03-2011, 11:26 PM   #4
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Put the menu.lst file in the slackware partition.

Grub2 will recognize the file and add the entries to Ubuntu's grub.cfg.
 
Old 09-04-2011, 07:21 AM   #5
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
I understand you wanting to chainload, if using multiple distros and changing to new releases and updates it is a lot easier to chainload the partition. Remove Lilo and install grub2 to root of slackware then try your chainloading.
 
Old 09-04-2011, 08:23 AM   #6
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida
Distribution: slackware64-current, puppy, ubuntu
Posts: 1,906

Rep: Reputation: 262Reputation: 262Reputation: 262
Try this to chainload

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

or

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

edit: change ext2 to the correct mod if your slack partition is not formated with ext4 or similar.

Last edited by colorpurple21859; 09-04-2011 at 08:30 AM.
 
Old 09-04-2011, 10:17 AM   #7
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by Larry Webb View Post
I understand you wanting to chainload, if using multiple distros and changing to new releases and updates it is a lot easier to chainload the partition. Remove Lilo and install grub2 to root of slackware then try your chainloading.
It is pretty easy to maintain one or two symlinks, especially at the rate that kernels are updated in Slackware.

Since I have never installed lilo, I am not sure if its installation to the partition boot record will interfere with grub2 picking up a /boot/grub/menu.lst file from that same partition.

EDIT: I will concede that the OP did ask for a chainloading solution and I did not provide one. I just believe that my proposed solution is a simple one.

Last edited by andrewthomas; 09-04-2011 at 10:19 AM. Reason: added disclaimer
 
Old 09-04-2011, 05:16 PM   #8
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Try this on your lilo and if it does not work then you will have to boot direct or change to grub2 if you want to chainload. From terminal using ubuntu live cd. Substitute your lilo partition for the hdxx.

sudo mkdir /mnt/temp
sudo mount /dev/hdxx /mnt/temp
sudo chroot /mnt/temp
sudo lilo –b /dev/hdxx
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chainloading to grub 2handband Slackware 38 12-24-2010 08:25 AM
[SOLVED] chainloading with grub and grub2 houndhen Linux - General 3 12-20-2010 02:39 PM
Weird one - chainloading Grub rhomp2002 Linux - Newbie 5 07-16-2008 02:52 AM
Chainloading other Linux alaskazimm Linux - General 5 01-04-2006 05:14 PM
chainloading lilo mimithebrain Linux - Software 7 05-18-2005 06:31 PM


All times are GMT -5. The time now is 01:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration