LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-21-2010, 09:38 AM   #1
2handband
Member
 
Registered: Jan 2009
Location: Alexandria, Minnesota
Distribution: Slackware 13.1
Posts: 809

Rep: Reputation: 96
chainloading to grub


I'm setting up a dual-boot for a friend with Ubuntu Studio and Slackware 13.1. Slackware will be the primary OS and Lilo will control the bootloader. After doing some research it seemed to me the best way would be to chainload grub from the lilo menu, so when I installed Ubuntu I stuck Grub in the Ubuntu root partition instead of the MBR and added the following to Slackware's lilo.conf:

Code:
# Linux bootable partition config begins
image = /boot/vmlinuz-generic-2.6.33.4
  initrd = /boot/initrd.gz
  root = /dev/sda3
  label = Linux_Gen
  read-only  # Partitions should be mounted read-only for checking
  other = /dev/sdb2
  label = Ubuntu_Studio
# Linux bootable partition config ends
It's not working. It just errors out and asks me to boot something else when I select Ubuntu_Studio from the lilo menu. I've never tried this before so I'm sure I'm making a really basic and stupid error; could somebody tell me what I'm doing wrong?
 
Old 12-21-2010, 09:55 AM   #2
witek
Member
 
Registered: Oct 2008
Location: Poland, Łódź
Distribution: Lubuntu, Salix
Posts: 102

Rep: Reputation: 19
It should work. Are you sure Ubuntu is sdb not sda?
And maybe try for clarity to start the lilo entry for Ubuntu from new line and without spaces before it. Remember to reinstall lilo.
 
Old 12-21-2010, 10:11 AM   #3
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,084
Blog Entries: 52

Rep: Reputation: Disabled
It might have something to do with Ubuntu Studio (any new Ubuntu) using GRUB2. That method used to work on previous releases of Ubuntu, and Debian "lenny".
 
Old 12-21-2010, 10:43 AM   #4
2handband
Member
 
Registered: Jan 2009
Location: Alexandria, Minnesota
Distribution: Slackware 13.1
Posts: 809

Original Poster
Rep: Reputation: 96
Quote:
Originally Posted by witek View Post
It should work. Are you sure Ubuntu is sdb not sda?
And maybe try for clarity to start the lilo entry for Ubuntu from new line and without spaces before it. Remember to reinstall lilo.
If I got 'em mixed up my Slackware wouldn't boot. It's correct. I'll try modifying the entry. I hope to God it's not a Grub2 issue. I have very little experience with dual-booting.
 
Old 12-21-2010, 11:30 AM   #5
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Rep: Reputation: 196Reputation: 196
With Linux Mint I tried to install GRUB on the partition using ReiserFS but I failed. There is some bug in Mint's GRUB so it's also in Ubuntu's GRUB. The only way is to chainload from Ubuntu's GRUB to Slackware's LILO. For comparison Arch's GRUB works well -- it's possible to install it on the partition using ReiserFS.

If you'd like you could follow that thread: GRUB: Cannot find list of partitions && /usr/sbin/grub-setup: error.
 
Old 12-21-2010, 11:33 AM   #6
2handband
Member
 
Registered: Jan 2009
Location: Alexandria, Minnesota
Distribution: Slackware 13.1
Posts: 809

Original Poster
Rep: Reputation: 96
So... if this is going to work, grub is going to have to take over the MBR.
 
Old 12-21-2010, 12:52 PM   #7
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 use ubuntu live and

grub-install --force /dev/sdb2

when finished reboot and see if that helped.
 
Old 12-21-2010, 01:02 PM   #8
piratesmack
Member
 
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 518

Rep: Reputation: 133Reputation: 133
You should be able to do it this way.

Combine the Grub2 files 'lnxboot.img' and 'core.img'
e.g. if your Ubuntu partition is mounted on /mnt/ubuntu, you can do it with:
Code:
cat /mnt/ubuntu/boot/grub/{lnxboot.img,core.img} > /mnt/ubuntu/boot/grub2.img
This creates a file called 'grub2.img' that can be booted from LILO with a menu entry like:
Code:
image = /mnt/ubuntu/boot/grub2.img
  label = Grub2
Note: This method is kind of annoying because you'll always have to mount your Ubuntu partition before running /sbin/lilo. Personally, I prefer to just install Grub to the MBR when dual-booting.

Last edited by piratesmack; 12-21-2010 at 02:53 PM.
 
Old 12-21-2010, 02:20 PM   #9
2handband
Member
 
Registered: Jan 2009
Location: Alexandria, Minnesota
Distribution: Slackware 13.1
Posts: 809

Original Poster
Rep: Reputation: 96
Quote:
Originally Posted by piratesmack View Post
You should be able to do it this way.

Combine the Grub2 files 'lnxboot.img' and 'core.img'
e.g. if your Ubuntu partition is mounted on /mnt/ubuntu, you can do it with:
Code:
cat /mnt/ubuntu/boot/grub/{lnxboot.img,core.img} > /mnt/ubuntu/boot/grub2.img
This creates a file called 'grub2.img' that can be booted from LILO with a menu entry like:
Code:
image = /mnt/ubuntu/boot/grub2.img
  label = Grub2
And it'll mount the Ubuntu root partition to /mnt/Ubuntu when lilo fires up?
 
Old 12-21-2010, 02:37 PM   #10
piratesmack
Member
 
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 518

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by 2handband View Post
And it'll mount the Ubuntu root partition to /mnt/Ubuntu when lilo fires up?
No, lilo can't mount partitions because it doesn't understand filesystems.

When you run 'lilo', it will create a list of blocks occupied by the file 'grub2.img' and use that information to load it.
 
Old 12-21-2010, 02:42 PM   #11
kapz
Member
 
Registered: Mar 2009
Location: kernel space
Distribution: Slackware_x64
Posts: 191

Rep: Reputation: 16
Quote:
it seemed to me the best way would be to chainload grub from the lilo menu, so when I installed Ubuntu I stuck Grub in the Ubuntu root partition instead of the MBR
If I were you, I would install grub2 on MBR and then again install lilo and chainload grub2 as primary partition.
For me it worked for FreeBSD bootloaderr and Minix bootloader, who knows it might as well work for you!
 
Old 12-21-2010, 02:47 PM   #12
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,772

Rep: Reputation: 478Reputation: 478Reputation: 478Reputation: 478Reputation: 478
Install grub-legacy manually and set it up to boot whatever and however you want.
 
1 members found this post helpful.
Old 12-21-2010, 03:06 PM   #13
2handband
Member
 
Registered: Jan 2009
Location: Alexandria, Minnesota
Distribution: Slackware 13.1
Posts: 809

Original Poster
Rep: Reputation: 96
Tried piratesmack's solution; still got "error 0x01" or something to that effect. Kapz, I'm not sure I undestand what you're suggesting, can you elaborate? Gnashley... I was hoping to leave lilo in control, but I may have to do what you're suggesting.
 
Old 12-21-2010, 04:01 PM   #14
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
Quote:
Originally Posted by gnashley View Post
Install grub-legacy manually and set it up to boot whatever and however you want.
You can do that with grub2 also and it will read ext4 files.
 
Old 12-21-2010, 04:27 PM   #15
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Rep: Reputation: 196Reputation: 196
2handband,

Thanks to gnashley I finally solved the problem concerning the installation of GRUB's bootloader at the beginning of the partition using ReiserFS. So I installed Slackware LILO's bootloader at MBR and now I can chainload Linux Mint's GRUB using Slackware's LILO.

To achieve that run the following commands in Ubuntu or Linux Mint:

sudo su -
apt-get remove grub-pc
apt-get install grub
update-grub # answer yes to the question about generating menu.lst
grub-install /dev/sda1

Then run Slackware, add to lilo.conf the following lines:

Quote:
other = /dev/sda1
label = mint
and run lilo command.

Last edited by w1k0; 12-22-2010 at 05:54 AM. Reason: sudo
 
  


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
[SOLVED] chainloading with grub and grub2 houndhen Linux - General 3 12-20-2010 02:39 PM
Chainloading Grub from Lilo Unr3a164 Slackware 5 06-04-2008 11:35 AM
grub and lilo chainloading rienqunuser Linux - Newbie 5 02-13-2008 06:59 PM
GRUB & XP w/out Chainloading: Possible? Computer Guru Linux - Software 5 06-14-2006 01:23 PM
grub and second linux, chainloading lacrimae Linux - Software 4 07-15-2002 10:17 PM


All times are GMT -5. The time now is 08:34 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration