The Linux Loader or LILO is one of the most popular methods of booting into Linux. LILO also makes a highly flexible and effective boot manager:handy if you have multiple operating systems installed on your machine.
If this were the first time that you installed Linux, you probably, would have gone the dual-boot way. But you do need a boot manager that will allow you to switch between the different OS' installed on your system. Linux provides LILO ( LInux LOader ). This is a very simple but flexible boot manager.
When your computer starts up, the BIOS executes a bootstrap program which lies in the Master Boot Record (MBR) of your first hard drive or your floppy. The MBR lies on the first sector of this device. The job of the bootstrap program is to locate and load the operating system. If you're using Linux then this will go out at boot and load the kernel into memory. LILO can take over this job and also act as your boot manager.
Ok, after that short introduction, let's move on to LILO. You're first encounter with LILO will be at the time of installation. You will be asked where you want to install it. The options given are MBR or the root partition of your Linux installation. Your choice will be based on your setup. There are other boot managers are available like Boot Magic and System Commander and you might want to use one of these instead. They're a lot easier to configure if you have multiple OS' on your machine. If so, then choose the second option. If, however, you do want to use LILO as your boot manager, you should choose
the first option. Also choose this option if you want to pass certain parameters to the kernel at boot. This might be required for troublesome hardware configurations or if you need to feed the kernel some pre-defined parameters at boot.
If you chose to use LILO then you can read on. At boot, you will see a prompt that looks like 'LILO:'. Press the Tab key to see a list of the operating systems that you can boot into. Type in the label of the one you want and press enter or just press enter to boot the default choice.
Once you boot into Linux, you need to take a look at the LILO configuration file. This could be any file but by default LILO will check for /etc/lilo.conf. Open this file and you will see something like the following.
boot = /dev/hda
vga = normal
read-only
prompt
default = dos
timeout = 30
append="hdc=ide-scsi"
image = /boot/vmlinuz
label = linux
root = /dev/hda2
initrd = /boot/initrd
The structure of the LILO configuration file starts with the global directives that are taken as the default values, unless overridden by a directive in the image sub-section.
Let's check out the various options here.
The first option here is boot. This is the location where Lilo should be installed.
'/dev/hda' puts LILO in the MBR. This is the option to select if you want to use LILO as your boot manager.
If you want to use some other boot manager then you will have to write LILO to the first sector of your root partition. This could also be true if you already have another installation of Linux on your machine, which is what you're using primarily.
This should point to the partition where your root resides. This is a globaldirective.
vga is a common option that you see in most lilo configuration files. Possible options here are 'normal' (80x25 text mode), 'extended' (80x50 text mode) and 'ask' where you are prompted for the text mode.
read-only option if specified, mounts your root partition as read only. This is recommended because it fsck checks require the file system to be read only. In any case Linux will re-mount your root file system as read-write at startup. This can be locally defined in an image section too.
prompt is another option that you should have in here. If not then LILO will not bring up the LILO prompt at boot. To see the prompt, press the shift key. This is a global directive.
default specifies the default boot image to boot. If this is not specified then the first image in the configuration file is taken as the default.
timeout in tenths of a second is the time for which the prompt is displayed before the default image is booted. By default the timeout is infinite.
append is one of the most useful parameters here. It allows you to pass parameters to the kernel at boot without any intervention from you. This can be a global setting or a per-image setting. Just enter the parameters that are to be passed to the kernel within double-quotes. The advantage is that you don't have to pass the parameters to Linux at every boot. Here using the append statement, I am telling Linux to use the ide-scsi module
for /dev/hdc, which is my CD-Writer. If you have some troublesome hardware that doesn't work you might want to provide Linux with the settings here.
LILO also allows you to pass these parameter right at the LILO prompt. Type the name of the image you want to boot followed by the options that you want to pass to the kernel.
LILO: linux single
Using the above, I could tell Linux to boot the image linux in single user mode. I could also use 'linux root=/dev/hda3' to specify another root partition to use.
Now come the image sections. Options in the global section can be overridden by options in the image sections. Each section begins with a 'image=' statement that points to the kernel image that you want to boot.
Each image section also contains a 'label' option. This could be anything you want. It is just what you will type at the LILO prompt to boot that particular image.
If you need to have a different root for this image or you are trying to boot another Linux distribution then you will need to specify the 'root' option here as well as any other option specific to that image.
For more security you could add a password for that image.
password='password'
You can also put in 'restricted' here. You will only be prompted if you want to enter parameters on the command line. Normal booting of the image will still take place. This is just to prevent someone from entering a parameter like 'single' and then booting straight into the prompt.
While LILO can boot other Linux distributions, it can also boot other OS'. The
section for booting another OS is essentially the same as that for the image.
other = /dev/hda3
label = dos
table = /dev/hda
Each section will start with a 'other=' which will point to the partition that the other OS lies on. As with the image section, there is a label to be given.
The final parameter is table. This should point to the device that contains the partition table. Definitely required because LILO will take the partition information from this table and pass it on to the operating system that it is booting.
Every change to the lilo.conf will require you to re-run /sbin/lilo to ensure that any changes to the setup are written down. If you update the kernel, re-create the initrd image you need to re-run LILO.
Lilo resides in /sbin. To run, simply type /sbin/lilo. You should then see something like the following
Added linux *
Added suse
Added windows
This shows the various images that I have in lilo.conf. The image after which the '*' is displayed is the default boot image. To change the default boot image from the command line, add a '-D' followed by the image you want to use.
lilo -D windows
Added linux
Added suse
Added windows *
This is about all you need to configure LILO. If you have any problems/
suggestions then please send me a mail.
No comments:
Post a Comment