LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 08-05-2013, 11:30 PM   #1
dluco
LQ Newbie
 
Registered: Aug 2013
Location: British Columbia, Canada
Distribution: Crunchbang, Ubuntu, Slackware
Posts: 14

Rep: Reputation: Disabled
Configure lilo to boot grub


Hi,
I've been using grub for quite a bit, but now I'm using lilo due to its simplicity. However, lilo doesn't detect my other distros very well.

So, my question is:
Is it possible to have lilo boot to grub?

Note: I have lilo installed to the mbr and the grub.conf file is on /dev/sda8

Thank you in advance!
 
Old 08-06-2013, 01:09 AM   #2
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
First of all LILO is a boot loader and its config file resides under /etc/lilo.conf and not grub.conf.

here is the default lilo config file:

Code:
boot=/dev/had               # should points to the MBR or first hard disk
map=/boot/map                     # has boot map, do not mess with this
install=/boot/boot.b              # has a bootstrap file, do not mess with this
prompt                            # prompt to choose between available kernel images 
timeout=50
message=/boot/message          
default=Linux                     # default OS to be used

image=/boot/vmlinuz-2.4.2-2       # image section-first line contains path to Linux kernel image
  label=Linux                     # label for OS type
  read-only
  root=/dev/hda6                  # path for OS installation directory
  initrd=/boot/initrd-2.4.2-2.img # path for initrd image
you can add other OS with:

Code:
other=/some/path/to/kernel/image  # Image section for other kernel's use only if required
 lable=some_os
 [parameters]
 root=/some/path/to/installation/dir
save and exit.
NOTE: do not forget to apply changes afte editing the lilo.conf file.

run as a superuser or root:
Code:
/sbin/lilo

output should be something like:

Added linux *
EDIT: you have to strictly follow the comments I mentioned inline with the config file.

Last edited by SAbhi; 08-06-2013 at 01:13 AM.
 
Old 08-06-2013, 01:37 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
Yes, lilo and grub are both boot loaders, you can select anyone, but you cannot mix them and has no real meaning to boot one of them with the other one (although you can install both of them and switch between them - forth and back, but that will not solve your problem)
 
Old 08-06-2013, 05:56 AM   #4
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Quote:
Originally Posted by dluco View Post
Note: I have lilo installed to the mbr and the grub.conf file is on /dev/sda8
If grub is installed on /dev/sda8, then just add this to lilo.conf:
Code:
other = /dev/sda8
  title = whatever distro you're running
Then run lilo. Easy.
 
Old 08-06-2013, 11:07 AM   #5
dluco
LQ Newbie
 
Registered: Aug 2013
Location: British Columbia, Canada
Distribution: Crunchbang, Ubuntu, Slackware
Posts: 14

Original Poster
Rep: Reputation: Disabled
I know it's redundant and more work than it's worth, but I'd still like to be able to go from lilo to grub, if only to learn more about the two.

When I tried to put
Code:
other = /dev/sda8
  label = <whatever>
into lilo.conf, it complained and said /dev/sda8 had no valid bootsector.

Do I need to point lilo to the actual grub.conf on sda8?
 
Old 08-06-2013, 05:00 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
The problem is that Fedora (specifically) will not install grub2 anywhere but the MBR (you have to force it, and doing so is not something supported). so finding that sda8 doesn't have a valid bootsector is not a surprise.
 
Old 08-06-2013, 08:33 PM   #7
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
Quote:
Originally Posted by dluco View Post
I know it's redundant and more work than it's worth, but I'd still like to be able to go from lilo to grub, if only to learn more about the two.

When I tried to put
Code:
other = /dev/sda8
  label = <whatever>
into lilo.conf, it complained and said /dev/sda8 had no valid bootsector.
Yes that error is correct, because in that particular section if you have seen my post, I clearly mentioned to give a path to the image file or a boot sector should be given since /dev/sda8 is your grub location and not a valid boot sector for lilo it ends up with that message.

Quote:
Do I need to point lilo to the actual grub.conf on sda8?
well I will again suggest to go proper way and don't try to try a hack into anything until you know it completely.

The current scenario is you don't exactly know how a boot loader works and you are trying to do experiments on it. Better to get the hands on first.

cheers

Last edited by SAbhi; 08-06-2013 at 08:38 PM.
 
Old 08-07-2013, 05:23 AM   #8
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
dluco
You say grub.conf is on /dev/sda8, but is grub itself actually installed there? If it is, the method I mentioned in post #4 should work, I've used it many times.
 
1 members found this post helpful.
Old 08-07-2013, 11:05 AM   #9
dluco
LQ Newbie
 
Registered: Aug 2013
Location: British Columbia, Canada
Distribution: Crunchbang, Ubuntu, Slackware
Posts: 14

Original Poster
Rep: Reputation: Disabled
Alright, I figured out how to do it. Instead of going from grub(2) to lilo, I went the other way, ie. from grub to lilo.

I reinstalled lilo to the root partition of sda9 (where I have Slackware) and then reinstalled grub to the mbr.

To boot to LiLo from the grub screen, I added a menu entry for lilo in 40_custom:
Code:
menuentry "lilo" {
	insmod chain
	insmod ext4
	set root=(hd0,9)
	chainloader +1
}
Although grub says "file not found" when I boot to lilo, it still works.
 
Old 08-07-2013, 11:26 AM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
I don't think you need the insmod ext4... Lilo isn't part of a filesystem the way grub is.
 
1 members found this post helpful.
Old 08-07-2013, 12:17 PM   #11
dluco
LQ Newbie
 
Registered: Aug 2013
Location: British Columbia, Canada
Distribution: Crunchbang, Ubuntu, Slackware
Posts: 14

Original Poster
Rep: Reputation: Disabled
Thanks! Taking out the ext4 line fixed everything. It now goes straight from grub to lilo without any problems!

Just to be complete (and to help anyone else doing something similar), this is the menu entry in /etc/grub.d/40_custom to boot lilo from grub:
Code:
menuentry "LiLo" {
    insmod chain
    set root=(hd0,X)
    chainloader +1
}
where X is the partition that lilo is installed to.
 
Old 08-07-2013, 02:29 PM   #12
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by dluco View Post
Thanks! Taking out the ext4 line fixed everything. It now goes straight from grub to lilo without any problems!

Just to be complete (and to help anyone else doing something similar), this is the menu entry in /etc/grub.d/40_custom to boot lilo from grub:
Code:
menuentry "LiLo" {
    insmod chain
    set root=(hd0,X)
    chainloader +1
}
where X is the partition that lilo is installed to.
And hd0 is the disk drive it is installed on.
 
1 members found this post helpful.
Old 08-07-2013, 11:00 PM   #13
dluco
LQ Newbie
 
Registered: Aug 2013
Location: British Columbia, Canada
Distribution: Crunchbang, Ubuntu, Slackware
Posts: 14

Original Poster
Rep: Reputation: Disabled
Although the original purpose of this thread (booting lilo to grub) does not correspond with the apparent solution/compromise (booting grub to lilo), I think I'll mark this as solved.
 
Old 08-07-2013, 11:13 PM   #14
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
Please mark the thread as Solved.
 
  


Reply



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
Why do we need boot loader or boot manager? GRUB, Lilo kienlarsen Linux - Newbie 23 05-21-2011 08:00 PM
grub overwrote lilo multiboot, missing one boot in Grub rl23455 Linux - Newbie 1 12-09-2007 01:50 PM
Configure LILO for multi-boot tips ToothlessRebel Linux - Newbie 7 06-11-2004 10:40 PM
configure lilo to use two different /boot partitions TheOneAndOnlySM Linux - Software 4 05-23-2004 08:31 PM
no LILO, no GRUB, NO BOOT !!! mioche Linux - Newbie 4 08-25-2003 05:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:41 PM.

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
Open Source Consulting | Domain Registration