LinuxQuestions.org
Register a domain and help support LQ
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 02-13-2008, 01:13 PM   #1
rienqunuser
LQ Newbie
 
Registered: Feb 2008
Posts: 6

Rep: Reputation: 0
grub and lilo chainloading


hello,
I have 2 disks and the following config in my system.

disk1 sda:
sda1 : primary Lilo based installed (65MB) :I can't remember if Lilo was installed here
sda2: extended partition
sda3: logical redhat root
sda4: logical redhat swap

disk2 sdb:
sdb1: XP
sdb2: vista
sdb3: spare
sdb4: extended partition
sdb5: logical suse root
sdb6: logical suse main
sdb7: logical suse swap

Depending on the BIOS boot priority settings, the machine will boot LILO or GRUB .
The questions I have are :
1. I can't remember where LILO and GRUB were installed on the disk so :
is LILO in disk1 sda 's MBR or sda root partition?
is GRUB in disk2 sdb 's MBR or sdb root partition?
How can I find this out ?

2. How can I setup grub / menu.lst to boot the Linux version on disk1 SDA and/or how can I setup LILO.conf to boot the Linux version (suse) on disk2 SDB?
thx
 
Old 02-13-2008, 03:02 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,740

Rep: Reputation: 298Reputation: 298Reputation: 298
Years ago,when I first ventured into Linux, my distro of choice offered me the choice of either Lilo or Grub. I tried both and settled on grub. It just seems eaiser to configure and maintain than lilo; for me, that is. For someone else, lilo may be eaiser. It's part of the beauty of Gnu/Linux; you have choices.

Anyhow, let's assume that Suse was the last OS installed, and you choose to use grub as the bootloader. Now you need to make certain that grub is configured to allow you to boot RedHat and WinXP along with Suse.

When you turn the power on, go into the BIOS and set the boot order for your drives. cd/dvd first, sda second, and sdb third. Then QUIT MESSING WITH THE BIOS! Sorry for yelling at you, it's just that it's so unnecessary to do the BIOS switching thing.

When you first turn the power on, what do you see? Is is a RedHat Lilo boot screen, a WinXP boot screen, or Suse's grub boot screen?

Assuming you want Suse's grub installation to be the bootloader to boot/handoff boot to another OS, do the following:

Boot Suse.

Open a console and give the command: grub and press <enter>.
That will get you to a grub prompt which looks like this: grub>

Now give the command: setup hd0 (that's hd zero).
Grub from the Suse installation will write the first stage of grub, along with the partition table, to the MBR of the first drive (sda).

Now, su to root and open the file /boot/grub/menu.lst (I hope you're confortable with text based applications).

If you do not see entries in the menu list for Red Hat and Win XP (i.e., you only see an entry for Suse), then add entries as follows:

title RedHat
root (hd0,2)
chainloader +1

title Windows XP
root (hd1,0)
map (hd0) (hd1)
map (hd1) (hd)
makeactive
chainloader +1

title Windows Vista
root (hd1,1)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1

Then save and close the file, and reboot. You should see RedHat, XP, Vista, and Suse in the grub menu. Try them all, one after another, to make certain they will boot.

As an added benefit, you don't need to remember which bootloader you used, or where it's installed. Grub uses the chainloader code to pass the boot porcess to the appropriate partition, then hands the boot process over to whatever is there.

For some interesting reading on using Grub to boot 140+ OSs, look up LQ memeber Saikee. Check out the links in his signature, especially on the use of grub. It's awesome, way rad, beautiful, and a whole bunch of other complimentary words/phrases.

Last edited by bigrigdriver; 02-13-2008 at 03:09 PM.
 
Old 02-13-2008, 03:23 PM   #3
budword
Member
 
Registered: Apr 2003
Location: Wisconsin
Distribution: Switched to regualr Ubuntu, because I don't like KDE4, at all. Looks like vista on crack.....
Posts: 675

Rep: Reputation: 31
Use this to poke around and find out where grub and lilo are.

http://supergrub.forjamari.linex.org/?section=download

Then pick one, I'd choose grub, and have the bios boot that disk first. Then chainload lilo, with an entry on menu.list.

Let us know how it goes.

David
 
Old 02-13-2008, 04:09 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,053

Rep: Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971
If you merely change the BIOS boot order and a different loader comes up, it means both are in the MBR. Lilo on one disk, and grub on the other.
Also means you can't chainload from one to the other. For that to work, you need the second one to be installed to a partition so a proper boot sector record is built.
Easy enough to fix.
 
Old 02-13-2008, 05:28 PM   #5
rienqunuser
LQ Newbie
 
Registered: Feb 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Yup that's the problem I am facing :

I separately installed LILO/redhat on disk SDA
and installed XP,VISTA,SUSE10.3 on disk SDB .

DISK SDA will boot LILO fine
DISK SDB will boot GRUB fine

but it requires me to change BIOS settings !

I installed the LILO/REDHAT separately from disk SDB because of concern of corruption/space use which then will affect my XP/VISTA/SUSE usage later on

So if chainloading is NOT possible because both LILO/GRUB are on separate MBRs, I am screwed .
BTW , is there anybody who can really tell how to determine whether LILO is on the MBR or root partition ?

I already tried some of the previous suggestions with menu.lst before I posted this questions without success to boot LILO from GRUB with my config.
 
Old 02-13-2008, 05:59 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,053

Rep: Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971
Quote:
Originally Posted by rienqunuser View Post
So if chainloading is NOT possible because both LILO/GRUB are on separate MBRs, I am screwed
I didn't say that - it's easy to fix.
Quote:
BTW , is there anybody who can really tell how to determine whether LILO is on the MBR or root partition ?
Technically it is in both - the MBR loader code (stage1) loads then transfers control to the code in one of the partitions. Lilo and grub are setup somewhat differently, but the effect is the same.
Try this
Code:
for i in a b ; do dd if=/dev/sd$i count=1 | strings ; done
That'll tell you what's in the MBR of each disk - look for grub/lilo.

Decide which you want as the primary loader, then boot the other one - from that (secondary) one, install to the partition you are running in.
Then go load your "normal" one and chainload to the secondary.
All done.
 
  


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 from grub to LILO AtomicAmish Slackware - Installation 2 08-24-2007 10:47 PM
GRUB & XP w/out Chainloading: Possible? Computer Guru Linux - Software 5 06-14-2006 12:23 PM
chainloading lilo mimithebrain Linux - Software 7 05-18-2005 05:31 PM
grub and second linux, chainloading lacrimae Linux - Software 4 07-15-2002 09:17 PM


All times are GMT -5. The time now is 12:50 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