Jump to content

BL-01: LILO Configuration


Recommended Posts

Browse: [About the FAQ Forum] [Table of Contents] [FAQs] [Contribute] [BL: Bootloaders]

 

BL-01: LILO configuration

 

LILO stands for "LInux LOader". It is one of the many Bootloaders for Linux, and the default on most distributions.

 

This FAQ will cover the configuration of LILO.

 

The File /etc/lilo.conf contains the information that allows LILO to "know" where to boot your Operating Systems/Kernels.

 

Below is an example of my /etc/lilo.conf file.

 

boot=/dev/hda
map=/boot/map
vga=normal
default="linux"
keytable=/boot/us.klt
prompt
nowarn
timeout=100
message=/boot/message
menu-scheme=wb:bw:wb:bw
image=/boot/vmlinuz
       label="linux"
       root=/dev/hda6
       initrd=/boot/initrd.img
       append="devfs=mount hdd=ide-scsi acpi=off"
       read-only
other=/dev/hda1
       label="windows"
       table=/dev/hda
other=/dev/fd0
       label="floppy"
       unsafe
image=/boot/vmlinuz-2.4.21-0.13mdk
       label="linux2"
       root=/dev/hda6
       initrd=/boot/initrd-2.4.21-0.13mdk.img
       append="devfs=mount hdd=ide-scsi acpi=off"
       read-only
image=/boot/vmlinuz
       label="failsafe"
       root=/dev/hda6
       initrd=/boot/initrd.img
       append="failsafe devfs=nomount hdd=ide-scsi acpi=off"
       read-only

 

Summarising the options:

  • boot=/dev/hda This is the device that will be booted. It will almost always be either /dev/hda or /dev/sda, depending on your Hard Drive.
     
  • map=/boot/map This is a file that contains the specific locations from where your kernels are booted. You should never need to change this option.
     
  • vga=normal This sets LILO's resolution, your distribution should set it up on install, and you should not need to change it. vga=791 is 1024 x 768, vga=788 is 800 x 600 and vga=normal is 640 x 480.
     
  • default="linux" You can set a default kernel to boot here. This corresponds to one of the label="*****" options.
     
  • keytable=/boot/us.klt To be honest i don't actually know what this line does, and if someone can inform me that would be appreciated. For a guess, i think that this would load the default so-called "keymap" that "tells" the kernel what your keyboard layout is.
     
  • prompt Tells LILO to display a prompt where you can select which kernel to boot.
     
  • nowarn With this i also have no idea of what it does. If anyone can inform me, this would, again, be much appreciated.
     
  • timeout=100 Tells LILO how many tenths of a seconds to display the prompt (after which the first kernel is booted).
     
  • message=/boot/message I do not know what this does, either should you need to know it. Anyone know?
     
  • menu-scheme=wb:bw:wb:bw I have no idea how to modify this, nor should you ever need to, i am guessing it corresponds to the colour of LILO's prompt, but i am not too sure. I'd say this line is only applicable for a text-based LILO, not Mandrake's graphical stuff.

Now the options for the specific boot options:

  • image=/boot/vmlinuz This tells LILO which linux kernel image to boot, by default, Mandrake's kernel is stored in the file /boot/vmlinuz .
     
  • other=/dev/hda1 The "other=" prefix tells LILO that this is a non-linux kernel to boot. In my case here, a windows kernel (*gasp*, NOTE: I do not use is, it's for my mother ;) ). The "/dev/hda1" part shows the device to boot the kernel from. This may vary for you, depending on your configuration.
     
  • label="linux" The text to type/select at the boot prompt to boot the kernel is contained within double-quotes. In my case here, "linux" of course :D
     
  • root=/dev/hda6 This points to the root partition ( / ) that the kernel must mount at boot. NOTE: This option is only applicable for Linux kernels, not Windows.
     
  • initrd=/boot/initrd.img This points to the so-called "Initial Ramdisk". I do not know much about it, but you should not need to modify this, ever.
     
  • append="devfs=mount hdd=ide-scsi acpi=off" This passes options to the kernel at boot time (the stuff in the double quotes). Using mine as an example, the devfs filesystem is mounted, the kernel is "told" to enable SCSI emulation for cd burners (Thanks to HJ for this correction) and it is "told" to turn off ACPI. You will rarely need to change this, the only case i can think of would be when compiling your own kernel from source, but i have never needed to change this.
     
  • read-only This option specifies that the root filesystem must be mounted "read-only" initially. You should not need to change this.
     
  • table=/dev/hda Only applicable for Windows, this points out where your windows partition is (my guess is that the option is called "table=" because of Windows' filesystem being FAT, a.k.a File Allocation Table.) I do not know what this line would look like for an NTFS partition, sorry.
     
  • unsafe I do not know what this option does, you can probably always keep this "as-is".

Configuring LILO to boot a "custom-kernel":

 

Since i have never done this using LILO, i will just improvise, and please, someone correct me if i'm wrong here.

 

WARNING: Though you may feel the urge to kill me if a custom kernel doesn't boot properly after using the instructions outlined below, i will point out now that you are doing it at your own risk, and i take no responsibility for what happens with your "custom kernel". Use these instructions at your own risk.

 

You can copy one of the sections for the kernel you are using, e.g

image=/boot/vmlinuz
       label="linux"
       root=/dev/hda6
       initrd=/boot/initrd.img
       append="devfs=mount hdd=ide-scsi acpi=off"
       read-only

 

to the bottom of the file /etc/lilo.conf. then you can edit the options for the new kernel image (most likely a bzImage file). You should only need to modify the "image=" line and "label=" line, and in some special cases, the "append=" line. Also, in some cases (RPM install for example) you will have to edit the "initrd=" line.

 

For example, a 2.6.0 kernel would have a setup something like this:

image=/boot/bzImage-2.6.0
       label="Linux2.6"
       root=/dev/hda6
       initrd=/boot/initrd.img
       append="devfs=mount hdd=ide-scsi acpi=off"
       read-only

 

After making any changes to LILO, in lilo.conf, you must run "lilo" in the terminal to make the changes take effect.

 

If you have any corrections, suggestions, constructive-critisism, please, pm me.

Edited by Tuxiscool
Link to comment
Share on other sites

 Share

×
×
  • Create New...