Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PC BIOS bootloader: LILO vs GRUB
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2867
Location: Omnipresent

PostPosted: Sun Jun 24, 2012 7:51 am    Post subject: PC BIOS bootloader: LILO vs GRUB Reply with quote

Hello,

I use a partitionless SSD as my root filesystem, with the bootloader in the filesystem boot sector. I have been using GRUB2, but this is a bit of a pain, as the core.img is too big to fit in the filesystem header. I never used GRUB Legacy on this machine because ext4 support was not patched until later, and also because it requires 32-bit emulation.

If I have to reinstall the bootloader whenever I update the kernel anyway, why not just use a simpler bootloader? So today, I moved back to the old dog -- LILO!

Advantages:

* Is small enough live entirely in a filesystem boot sector
* Operates entirely by blocklists, so is filesystem independent
* Does not require 32-bit emulation
* Has a less byzantine configuration scheme than GRUB2, or even GRUB Legacy
* Enjoys two decades of use and development

I know that at least one other person is using LILO, but who else is? What is your setup, and why do you choose LILO over GRUB (or SYSLINUX)?
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2278
Location: UK

PostPosted: Sun Jun 24, 2012 2:54 pm    Post subject: Reply with quote

I usually use LILO but I had to use GRUB2 on a partition-less KVM block device to get it to boot. Did you have to do anything differently to get yours to work?
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2867
Location: Omnipresent

PostPosted: Sun Jun 24, 2012 4:23 pm    Post subject: Reply with quote

With the following lilo.conf

Code:
#
# Loader options
#
lba32
compact

#
# Boot interface options
#
prompt
timeout=50
bitmap=/boot/gentoo.bmp
bmp-colors=0,15,0,15,0,0
bmp-table=3,3
bmp-timer=72,28,0,15,0

#
# Default image options
#
root=/dev/sda
read-only
append="resume=/dev/sda resume_offset=34816"

#
# Images
#
image=/boot/kernel-3.2.12-gentoo
   label="Normal"
#
image=/boot/kernel-3.2.12-gentoo
   label="Recovery"
   addappend="noresume 2"


I invoke

Code:
# lilo -v 2 -b /dev/sda


and get

Code:
LILO version 22.8, Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2006 John Coffman
Released 19-Feb-2007 and compiled at 14:31:17 on Jun 24 2012
Running Linux kernel 3.2.12-gentoo on x86_64

raid_setup returns offset = 00000000  ndisk = 0
 BIOS   VolumeID   Device
Reading boot sector from /dev/sda
pf_hard_disk_scan: ndevs=0
device codes (user assigned pf) = 0
device codes (user assigned) = 0
device codes (BIOS assigned) = 0
device codes (canonical) = 0
mode = 0x03,  columns = 80,  rows = 25,  page = 0
Using BITMAP secondary loader
Calling map_insert_data
Secondary loader: 19 sectors (0x3800 dataend).
bios_boot = 0x80  bios_map = 0x80  map==boot = 0  map S/N: 20AC7DDA
Mapping bitmap file /boot/gentoo.bmp
Calling map_insert_file
Compaction removed 294 BIOS calls.
Bitmap: 301 sectors.
BIOS data check was okay on the last boot

Boot image: /boot/kernel-3.2.12-gentoo
Setup length is 26 sectors.
Compaction removed 6698 BIOS calls.
Mapped 6834 sectors.
Added Normal *

Boot image: /boot/kernel-3.2.12-gentoo
Setup length is 26 sectors.
Compaction removed 6698 BIOS calls.
Mapped 6834 sectors.
Added Recovery

 BIOS   VolumeID   Device
  80    20AC7DDA    0800
Writing boot sector.
/boot/boot.0800 exists - no boot sector backup copy made.
Map file size: 171520 bytes.
RAID device mask 0x0000


It is critical that you use the "-b" option instead of "-M" when installing to a filesystem instead of the MBR.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2278
Location: UK

PostPosted: Sun Jun 24, 2012 5:29 pm    Post subject: Reply with quote

No luck here, doing things the normal way just gets me this:
Code:
# lilo -v 2
LILO version 23.2 (released 09-Apr-2011)
  * Copyright (C) 1992-1998 Werner Almesberger  (until v20)
  * Copyright (C) 1999-2007 John Coffman  (until v22)
  * Copyright (C) 2009-2011 Joachim Wiedorn  (since v23)
This program comes with ABSOLUTELY NO WARRANTY. This is free software
distributed under the BSD License (3-clause). Details can be found in
the file COPYING, which is distributed with this software.
Compiled at 17:15:16 on Jun 24 2012
Running Linux kernel 3.3.7-zen-12653-g24b6129 on x86_64

raid_setup returns offset = 00000000  ndisk = 0
 BIOS   VolumeID   Device
Reading boot sector from /dev/vda
Fatal: Linux experimental device 0xfe00 needs to be defined.
Check 'man lilo.conf' under 'disk=' and 'max-partitions='

lilo.conf isn't very complex:
Code:
boot=/dev/vda
root=/dev/vda
read-only
lba32
compact

default=Gentoo

image=/boot/vmlinuz
    label=Gentoo

image=/boot/vmlinuz.old
    optional
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2867
Location: Omnipresent

PostPosted: Sun Jun 24, 2012 6:02 pm    Post subject: Reply with quote

LILO doesn't understand how to read your KVM block device -- just like in the old days before LBA if you had a buggy BIOS, you had to tell LILO what kind of geometry your disk had.

Per the KVM documentation, in the first section of your lilo.conf try adding the following line:

Code:
disk=/dev/vda bios=0x80 max-partitions=7


and see what happens. I presume you have a complete backup in case this whole thing goes to hell ...
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 7668
Location: Somewhere over Atlanta, Georgia

PostPosted: Sun Jun 24, 2012 6:29 pm    Post subject: Reply with quote

Being someone who has a long-time predilection for experimentation with filesystems, I've never been able to count on root filesystem support in any bootloader incarnation. Now, I know that lilo solves this problem simply (and some might say elegantly) but, really, I've never seen the downside of a small boot partition with good old ext2. Is there some additional downside with SSDs that I don't know about?

- John
_________________
This space intentionally left blank.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2867
Location: Omnipresent

PostPosted: Sun Jun 24, 2012 6:50 pm    Post subject: Reply with quote

On a partition-less SSD, the filesystem is automatically aligned with the erase block size. Set your stride and stripe-width, and you're good to go.

I understand that with new versions of disk partitioning utilities (e.g., fdisk), the default granularity is now larger than the erase block size of most SSDs (e.g., 1MB), rather than the traditional 512 bytes. Thus, partitioning can be brainless as it always used to be without hurting SSD performance or lifetime. However, I do not know precisely which versions these are ...

Moreover, I've always run into inconvenience when one partition grew to full and I had to re-partition my disk or move things around. This is also why I use a swapfile for hibernation rather than a swap partition.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 3825
Location: USA

PostPosted: Sun Jul 15, 2012 4:56 pm    Post subject: Reply with quote

Ok, sorry about trolling this topic...

I would only use elilo for EFI based machines but after seeing what GRUB can do, and after seeing EFI/OpenBoot/DECstation firmware/... PC BIOS is pure AWFUL and GRUB fits that space where PC BIOS left off...

As for filesystem support for GRUB, pretty much all my machines have a small boot partition formatted with some simple filesystem (VFAT, ext2, etc.) anyway. This lets me put my initramfs there as well, and not only that, can use any old boot disk to fix that partition (including installing a new kernel/initramfs with a MSDOS boot disk, if the partition is FAT...)
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4915

PostPosted: Sun Jul 15, 2012 5:03 pm    Post subject: Reply with quote

what about gummiboot?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sun Jul 15, 2012 5:11 pm    Post subject: Reply with quote

DaggyStyle wrote:
what about gummiboot?

Not a bootloader, but a manager that launches EFI apps. Though if your kernel is compiled with EFI_STUB, it is an EFI app, so gummiboot can be used to start it. It's similar to rEFInd that way, except rEFInd provides a graphical menu with big icons, while gummiboot provides a simple text menu.

To address the topic of this thread: syslinux everywhere, except my crazy netbook, on that one it's lilo. It's all about keeping it simple. Grub2 is a monster that among other things happens to include a bootloader. Grub1 is ok, but still overkill.

When I'll have an EFI machine, then it'll be gummiboot launching EFI_STUB kernels.


Last edited by Gusar on Sun Jul 15, 2012 6:13 pm; edited 4 times in total
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4915

PostPosted: Sun Jul 15, 2012 6:09 pm    Post subject: Reply with quote

Gusar wrote:
DaggyStyle wrote:
what about gummiboot?

Not a bootloader, but a manager that launches EFI apps. Though if your kernel is compiled with EFI_STUB, it is an EFI app, so gummiboot can be used to start it. It's similar to rEFInd that way, except rEFInd provides a graphical menu with big icons, while gummiboot provides a simple text menu.

To address the topic of this thread: syslinux everywhere, except my crazy netbook, on that one it's lilo. It's all about keeping it simple. Grub2 is a monster that among other things happens to include a bootloader. Grub1 is ok, but still overkill.


funny, their site shows a grub like menu which boots fedora.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sun Jul 15, 2012 6:20 pm    Post subject: Reply with quote

DaggyStyle wrote:
funny, their site shows a grub like menu which boots fedora.

What's funny about it?
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4915

PostPosted: Sun Jul 15, 2012 6:24 pm    Post subject: Reply with quote

Gusar wrote:
DaggyStyle wrote:
funny, their site shows a grub like menu which boots fedora.

What's funny about it?

well it makes you believe it is a boot loader, what boot loader it uses?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sun Jul 15, 2012 6:29 pm    Post subject: Reply with quote

Providing a menu does not make it a boot loader. To quote the page itself:
Quote:
gummiboot is a simple UEFI boot manager which executes configured EFI images.

[...]

Linux kernels need to be built with CONFIG_EFI_STUB to be able to be directly executed as an EFI image.
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4915

PostPosted: Sun Jul 15, 2012 6:45 pm    Post subject: Reply with quote

Gusar wrote:
Providing a menu does not make it a boot loader. To quote the page itself:
Quote:
gummiboot is a simple UEFI boot manager which executes configured EFI images.

[...]

Linux kernels need to be built with CONFIG_EFI_STUB to be able to be directly executed as an EFI image.

for the untrained eye, it is.

still it has a boot loader, question is which one
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
ProjectFootball
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sun Jul 15, 2012 6:52 pm    Post subject: Reply with quote

DaggyStyle wrote:
still it has a boot loader, question is which one

I don't know what you mean by that. It's an EFI app.
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 3825
Location: USA

PostPosted: Sun Jul 15, 2012 10:24 pm    Post subject: Reply with quote

I've never tried building an kernel as an EFI app... Can you still specify an initrd from the EFI command line?

The only EFI machine I have is an ia64 box... I've always used elilo. EFI's command line editor helps edit elilo.confl; coupled with the EFI CLI it makes it a really powerful bootloader...

I have no idea how the Windows ia64 EFI bootloader works. Fortunately I don't have Windows so I don't have to worry about it...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Mon Jul 16, 2012 9:58 am    Post subject: Reply with quote

eccerr0r wrote:
I've never tried building an kernel as an EFI app... Can you still specify an initrd from the EFI command line?

Sure. You can use the commandline, you can put the options (root=, initrd=, and such) directly into the EFI firmware with efibootmgr, or you use a manager like gummiboot. In the future (don't know if it made kernel 3.5), the kernel will also be able to read the options from a conf file.

eccerr0r wrote:
I have no idea how the Windows ia64 EFI bootloader works. Fortunately I don't have Windows so I don't have to worry about it...

You don't really need to know. Gummiboot and rEFInd detect it automatically, so all you have to do is select "Windows" from the menu.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2867
Location: Omnipresent

PostPosted: Sun Jul 22, 2012 11:13 am    Post subject: Reply with quote

Gusar,

What benefits do you enjoy with SYSLINUX over LILO?

One advantage I see is that SYSLINUX has a stage 2 in the boot partition, so one doesn't have to reinstall to the MBR after installing a new kernel or changing the conf file. Of course, this comes at the cost of some complexity, i.e. the contents of the /boot/syslinux .
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31716
Location: 56N 3W

PostPosted: Sun Jul 22, 2012 11:21 am    Post subject: Reply with quote

Hypnos,

grub legacy just works and you don't reinstall it for kernel changes.
grub drops its stage 1.5 and stage1 loads stage2 directly, by knowing its block list. Stage2 works in the normal way, so there is no need to reinstall grub when you change kernels.

Take care with grub updates - they move the stage2 around and you must reinstall grub then or you will be using your old 'phantom' stage2.
Just like updating your kernel with lilo and no running /sbin/lilo, if you are lucky, you get a phantom kernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2867
Location: Omnipresent

PostPosted: Sun Jul 22, 2012 11:28 am    Post subject: Reply with quote

Hi NeddySeagoon,

GRUB legacy has two drawbacks: 32-bit emulation, and annoying configuration scheme compared to LILO and SYSLINUX.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2642
Location: Slovenia

PostPosted: Sun Jul 22, 2012 11:34 am    Post subject: Reply with quote

Hypnos wrote:
What benefits do you enjoy with SYSLINUX over LILO?

Hmm, if I really thing about it, I couldn't really say. It's just that I switched from grub1 to syslinux quite some time ago (though on the netbook I had to go back to grub1, I blame the netbook, the thing is literally *crazy*), while going to lilo on the netbook is recent.

Why to syslinux back then? Well, I was playing around and eventually created my own LiveUSB (nothing fancy, it's Arch packaged into a squashfs image), and that meant getting acquainted with syslinux. I liked what I saw, so decided to switch to it everywhere.

Oh, and LILO has stuff on the boot partition too, the map file and another one.

NeddySeagoon wrote:
Just like updating your kernel with lilo and no running /sbin/lilo, if you are lucky, you get a phantom kernel.

I actually had that happen shortly after switching to lilo. I was quite O_O, believe me :)
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2867
Location: Omnipresent

PostPosted: Sun Jul 22, 2012 11:39 am    Post subject: Reply with quote

Gusar wrote:
Oh, and LILO has stuff on the boot partition too, the map file and another one.

True, the map file is necessary. The other one is just a backup of the old bootsector.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31716
Location: 56N 3W

PostPosted: Sun Jul 22, 2012 1:51 pm    Post subject: Reply with quote

Hypnos,

grub-static gets round the 32 bit emulation.
Configuration syntax is like any other tool - if you want to use it you need to learn it.

True, you need 32 bit support in your kernel to install grub-static to the MBR or whereever. After its installed and working why would you want to update it?
Its a bootloader, it just works. I use grub-static and have turned off 32 bit emulation in my kernels. It saves me getting updates I would rather not have and then forgetting to install thm to the MBR.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2867
Location: Omnipresent

PostPosted: Sun Jul 22, 2012 5:20 pm    Post subject: Reply with quote

NeddySeagoon,

That's an interesting setup -- it's as if GRUB Legacy Stage 1 has become firmware on your system :)

Stage 2 is your userspace driver -- hopefully your hard disk won't crash! Then you'll have to turn on 32-bit support in the kernel to reinstall your "firmware".

In any event, it looks like the future is rEFInd/gummiboot + stub/chain loading.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum