Mandriva

Booting GNU/Linux - Lilo

LiLo Configuration

~LiLo's configuration file is '/etc/lilo.conf'. You can edit it either by loading it into an editor, or - since 7.1 - by using the '~DrakBoot' tool in '~DrakConf' ('Mandrake Control Center' - 'Boot' - 'Boot Config').
If you want to or have to do the configuration by hand, however, here's how.

~LiLo's configuration file features two sections. A general section which contains options for ~LiLo itself and one or more special sections for each operating system or GNU/Linux kernel you wish to boot.

The most important thing to remember is to run the

lilo
command every time after having edited 'lilo.conf' by hand1.1 Not only does this apply the changes made to the file to the boot sector but it also performs some basic error checking on the configuration file.

The general section of my 'lilo.conf' looks like this:

boot=/dev/hda<br> map=/boot/map<br> install=/boot/boot.b<br> vga=790<br> default=linux<br> keytable=/boot/de-latin1-nodeadkeys.klt<br> lba32<br> prompt<br> timeout=50<br> message=/boot/message

boot=/dev/hda

This defines where the boot sector should be installed.

/dev/hda
is Linux speak for 'the whole IDE disk connected as master to the first IDE channel' (more on device names). This boot sector is commonly referenced to as the Master Boot Record (MBR). The boot loader installed in the MBR will be the first thing you see after the BIOS messages on boot.
If you are using another boot loader and want to keep on using that as the master loader, you have to install ~LiLo not into the MBR, since that would overwrite the other loader, but into the partition where the '/boot' directory is located. This is one of the options available at the end of the installation process.

map=/boot/map, install=/boot/boot.b

These entries tell ~LiLo where some files it needs are located.
'/boot/boot.b' is a symlink pointing to either of these files: boot-graphic.b for a graphical boot screen, boot-menu.b for a text menu boot screen and boot-text.b for a simple command line boot interface. Two switch between these interfaces, just change the symlink:

ln -sf boot-&#123;...&#125;.b boot.b
.

vga=790

You will find an entry like this usually only if you are using a framebuffer console (i.e. when you get the blue 'Welcome' screen and the graphical 'Aurora' screen during boot). The number defines the screen resolution and color depth of the framebuffer.
You'll find those numbers in '/usr/src/linux/Documentation/fb/vesafb.txt' (second table). You will have to convert them into decimal numbers first, though.

default=linux

Says which of the special entries should be booted by default if no entry is selected from the boot menu after a specified period of time. If this entry is missing, the first special entry is the default entry.

keytable=/boot/de-latin1-nodeadkeys.klt

This defines the key table to be used when editing ~LiLo's boot command line.

lba32

Uses 'Large Block Addressing' and thus bypasses the BIOS' 1024 cylinder barrier. The practical upshot of which is that you can have your boot partition anywhere you want to.

prompt

Well, you get a boot prompt ;-). You might want to remove this, if you are booting only one operating system from ~LiLo.

timeout=50

The interval of time in tenth/seconds (i.e. 50 = 5 sec.) after which the default entry (see above) will be booted.

message=/boot/message

Defines the file which contains the boot screen message for text-menu and text boot screens.

The general section is followed by entries for the operating systems or GNU/Linux kernels to boot. Entries for system kernels start with

image
and entries for other operating systems or Linux installations start with
other
.
An entry for the system kernel may look like this:

image=/boot/vmlinuz label=linux root=/dev/hda8 initrd=/boot/2.2.14-15mdk_1 append="" read-only

image=/boot/vmlinuz

Place and name of the kernel image. This file usually is a symlink to the 'real' kernel image file in '/boot', 'vmlinuz-{version}'. If more than one kernel image file is present, this symlink will be switched dynamically according to the kernel (boot menu entry) you select on the ~LiLo boot screen or prompt.

label=linux

Under which name this entry will appear in the boot menu.

root=/dev/hda8

The device name of the partition where the '/boot' directory is located.

initrd=/boot/2.2.14-15mdk_1

Where the initrd image is located. This entry is only necessary if you boot off devices the drivers of which have been compiled as kernel modules (e.g. SCSI hard disks) and not into the kernel itself. See

man mkinitrd
.

append=""

Optional for boot parameters which should be executed automatically on each boot (e.g. 'hd{x}=ide-scsi' for IDE CD writers). Further options can be found on the Kernel Parameters / Boot Prompt page.

read-only

How the root partition should be mounted first (it will later be remounted read-write anyway). This entry protects data on the root partition and should therefore not be changed.

You'll find more ~LiLo options in

man lilo.conf
.

You can create several kernel images and boot them alternatively by adding entries for them. You can also add multiple entries for the same kernel image, which might be useful for booting with different 'append' settings.

The crucial thing is that you should never forget to run the

lilo
command after having made changes either to 'lilo.conf' or the partition layout on the disk.

section index

Booting Other Kernels / Distributions / Operating Systems Via ~LiLo

Other Kernels

This feature comes in handy when you want to test a new kernel but keep your trusty old one around in case the new one doesn't work as expected.
Edit 'lilo.conf' to create an entry for your new kernel. If you've used a kernel-RPM, chances are that there already is an entry for the new kernel.
The new entry looks like the old one, except for the

label
parameter, of course, the name under which it will appear in ~LiLo's boot menu. If you are booting from a SCSI device and SCSI support is compiled as a module, you also have to create a new initrd image for the new kernel and point an
initrd
entry to it.

Save, run

lilo
and reboot. The new entry should now appear on the boot menu or after hitting the TAB key at the boot prompt.

Other Distributions

If you are installing another Linux distribution on your computer (or another release of Mandrake), tell it to install the ~LiLo boot sector not in the master boot record but to the first sectors of the partition which will hold the '/boot' directory. Then boot your first distribution again, edit 'lilo.conf' and add an entry like this:

other=/dev/&#123;root partition of other distro&#125;<br> label=otherlin

Of course you can replace 'otherlin' with an entry of your choice (the distribution's name, for example).

If you've accidentally installed the new ~LiLo to the master boot record and thus erased the previous entry, use a boot floppy to boot your old distro, edit 'lilo.conf' and change the

boot=
line to point it to the root partition of your old distribution (e.g. from
/dev/hda
to
/dev/hda1
). Save and run
lilo
. Reboot to your new distribution, edit its 'lilo.conf' and add an entry for your old distribution like the one above.

This approach also works if you want to use a boot manager other than ~LiLo.

Other Operating Systems

~LiLo has so far been able to boot every operating system I've encountered yet.

An entry for DOS, Windows 3.x or 9.x installed onto the first IDE disk may look like this:

other=/dev/hda1 label=ms table=/dev/hda

This tells ~LiLo:

  • where the first partition of this operating label is (here the first partition on the first IDE drive)
  • which boot prompt argument will boot this entry ("win")
  • where the partition table for this system is located (here on the first IDE drive).
The 'table' entry seems to be needed by MS operating systems only. An entry for booting ~BeOS installed on the second primary partition of the first SCSI disk looks like this:

other=/dev/sda2<br> label=beos

Operating systems like MS NT and OS/2 come with boot managers of their own. You can use their managers to boot Linux (have a look at the HOWTOs listed above) but you can also boot them via ~LiLo. Notice however that MS NT is known to react allergic to a non-NT boot sector sometimes, though it works just fine here with Win98 and Win2000, YMMV. Notice also that at least NT 3.5 and 4 do not recognize the partition types used by Linux and may try to 'repair' the MBR on its own ...

A more esoteric feature of ~LiLo is that it can boot DOS and Windows 9.x from the second hard drive. For this you have to add these lines to the DOS / Windows entry in 'lilo.conf':

map-drive = 0x80<br> to = 0x81<br> map-drive = 0x81<br> to = 0x80

'~LiLo' is a very versatile tool, read the User's Guide in '/usr/share/doc/lilo-{...}/doc' for lots more.

section index

Next Item: GNU GRUB

Related Resources:

Multi-Disk HOWTO
Installation HOWTO, 8.2
LILO mini-HOWTO
Multiboot using LILO mini-HOWTO
Linux+DOS+Win95+OS2 mini-HOWTO
Linux+NT-Loader mini-HOWTO
Linux+Win95 mini-HOWTO
Booting Linux with the Win 2k Boot Loader

man lilo
,
man lilo.conf

~LiLo User Guide in /usr/share/doc/lilo-{...}

Revision / Modified: Sept. 19, 2001
Author: Tom Berger
Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.

KB - Booting GNU/Linux - Lilo
Version 1.14 last modified by ptyxs on 09/11/2006 at 21:47

 


en fr pt

RSS

Creator: AdminWiki on 2004/03/22 09:44
(c) Mandriva 2007
18888888