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 08-06-2013, 12:30 AM   #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, 02: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: 664

Rep: Reputation: 80
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 02:13 AM.
 
Old 08-06-2013, 02:37 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,133

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
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, 06:56 AM   #4
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

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, 12:07 PM   #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, 06:00 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
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, 09: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: 664

Rep: Reputation: 80
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 09:38 PM.
 
Old 08-07-2013, 06:23 AM   #8
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

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, 12:05 PM   #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, 12:26 PM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
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, 01: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, 03:29 PM   #12
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
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-08-2013, 12:00 AM   #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-08-2013, 12:13 AM   #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: 664

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


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


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