0% found this document useful (0 votes)
5 views17 pages

Linux Boot Loader Guide

The document provides an overview of the Linux Loader (LILO), detailing its functionality to boot Linux and other operating systems, installation options, and configuration through the /etc/lilo.conf file. It explains the components of LILO, including the boot loader and the lilo command, along with various configuration and command options. Additionally, it addresses common boot errors and provides references for further reading.

Uploaded by

gurunath.thiran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views17 pages

Linux Boot Loader Guide

The document provides an overview of the Linux Loader (LILO), detailing its functionality to boot Linux and other operating systems, installation options, and configuration through the /etc/lilo.conf file. It explains the components of LILO, including the boot loader and the lilo command, along with various configuration and command options. Additionally, it addresses common boot errors and provides references for further reading.

Uploaded by

gurunath.thiran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

SUBJECT CODE

TYPE THE SUBJECT NAME HERE

UNIT II - LINUX

2.3 The Linus Loader(LILO)

IV VIII

20ITEL801- FOSS
20ITEL801

FREE AND OPEN SOURCE SOFTWARE

The Linux Loader(LILO)

LILO INTRODUCTION:-

● In addition to booting Linux, LILO can boot other operating systems, such as
Windows or any of the BSD systems.
● During installation, some Linux distributions provide the opportunity to install
LILO (most now install GRUB by default).
● LILO can also be installed later if necessary. LILO can be installed on the MBR of
your hard drive or as a secondary boot loader on the Linux partition.
● LILO consists of several pieces, including the boot loader itself, a configuration file
(/etc/ lilo.conf), a map file (/boot/map) containing the location of the kernel, and the
lilo command (/sbin/lilo), which reads the configuration file and uses the
information to create or update the map file and to install the files LILO needs.
20ITEL801
FREE AND OPEN SOURCE SOFTWARE

● One thing to remember about LILO is that it has two aspects:


○ the boot loader
○ lilo command.

i) The lilo command configures and installs the boot loader and updates it as necessary.
ii)The boot loader is the code that executes at system boot time and boots Linux or
another operating system.

You can make a rescue CD for LILO with the LILO command mkrescue --iso to make
an image that can be burned to CD. Use mkrescue by itself or with other options to
make a rescue floppy disk.
20ITEL801

FREE AND OPEN SOURCE SOFTWARE

The LILO Configuration File

The lilo command reads the LILO configuration file, /etc/lilo.conf, to get the
information it needs to install LILO. Among other things, it builds a map file containing
the locations of all disk sectors needed for booting. Note that any time you change
/etc/lilo.conf or rebuild or move a kernel image, you need to rerun lilo to rebuild the map
file and update LILO.

The configuration file starts with a section of global options, described in the next
section. Global options are those that apply to every system boot, regardless of the
operating system you are booting. Here is an example of a global section (a hash sign, #,
begins a comment):
20ITEL801

FREE AND OPEN SOURCE SOFTWARE

Global options
backup backup-file Copy the original boot sector to backup-file instead of to /boot/boot.nnnn,
where nnnn is a number that depends on the disk device type.

boot boot-device Set the name of the device that contains the boot sector. boot defaults to
the device currently mounted as root, such as /dev/hda2. Specifying a
device such as /dev/hda (without a number) indicates that LILO should be
installed in the master boot record; the alternative is to set it up on a
particular partition, such as /dev/hda2.

change-rules Begin a section that redefines partition types at boot time for hiding and
unhiding partitions. See the LILO User’s Guide, which comes with the
LILO distribution, for detailed information on using this option and
creating a new rule set.

compact Merge read requests for adjacent disk sectors to speed up booting. Use of
compact is particularly recommended when booting from a floppy disk.
Use of compact may conflict with linear.
20ITEL801

FREE AND OPEN SOURCE SOFTWARE

default name Use the image name as the default boot image. If default is omitted, the first
image specified in the configuration file is used.

cylinders cylinders The number of cylinders on the disk

force- backup-file Like backup, but overwrite an old backup copy if one exists.
backup

heads heads The number of heads on the disk

disktab disktab-file This option has been superseded by the disk= option

install boot-sector Install the specified file as the new boot sector. If install is omitted, the boot
sector defaults to /boot/boot.b.

ignore table Tell lilo to ignore corrupt partition tables


20ITEL801

FREE AND OPEN SOURCE SOFTWARE

IMAGE OPTIONS
The following options are specified in the image section for a particular boot image. The
image can be a Linux kernel or a non-Linux operating system.
alias name Provide an alternate name for the image that can be used instead of the name specified
with the label option.

label name Specify the name that is used for the image at the boot prompt. Defaults to the
filename of the image file (without the path).

lock Like lock, as described in the previous global options section; it can also be specified
in an image section.

other pathname Specify the path to a file that boots a non-Linux system. Each per-image section that
specifies a bootable non-Linux system starts with an other option.

optional Specify that the image should be omitted if it is not available when the map is created
by the lilo command. Useful for specifying test kernels that are not always present
20ITEL801

FREE AND OPEN SOURCE SOFTWARE

image pathname Specify the file or device containing the boot image of a bootable Linux kernel.
Each per-image section that specifies a bootable Linux kernel starts with an image
option. See also the range option.

loader chainloader For a non-Linux operating system, specify the chain loader to which LILO should
pass control for booting that operating system. The default is /boot/ chain.b. If the
system will be booted from a drive that is neither the first hard disk nor a floppy or
CD, the chainloader must be specified.

password password Specify that the image is password-protected and provide the password that the user
is prompted for when booting. The password is not encrypted in the configuration
file, so if passwords are used, permissions should be set so only the superuser can
read the file.

table device Specify, for a non-Linux operating system, the device that contains the partition
table. If table is omitted, the boot loader does not pass partition information to the
operating system being booted. Note that /sbin/lilo must be rerun if the partition
table is modified. This option cannot be used with unsafe.
20ITEL801

FREE AND OPEN SOURCE SOFTWARE

KERNEL OPTIONS
The following kernel options can be specified in /etc/lilo.conf as well as on the boot
command line:

initrd. filename Specify the file to load into /dev/initrd when booting with a RAM disk. See also
the options load_ramdisk (in “Boot-Time Kernel Options” on page 539) and
prompt_ramdisk, ramdisk_size, and ramdisk_start in this section

literal string Like append, but replace all other kernel boot options

noinitrd Preserve the contents of /dev/initrd so they can be read after the kernel is booted.

read-only Specify that the root filesystem should be mounted read-only for file system
checking (fsck), after which it is typically remounted read/write

read-write Specify that the root filesystem should be mounted read/write.


20ITEL801

FREE AND OPEN SOURCE SOFTWARE

THE LILO COMMAND

You need to run the lilo command to install the LILO boot loader and to update it
whenever the kernel changes or to reflect changes to /etc/lilo.conf. Note that if you
replace your kernel image without rerunning lilo, your system may be unable to boot.
The path to the lilo command is usually /sbin/lilo. The syntax of the command is: lilo
[options] Some of the options correspond to /etc/lilo.conf keywords:
20ITEL801

FREE AND OPEN SOURCE SOFTWARE

These options should be put in the configuration file whenever possible; putting
them on the lilo command line instead of in /etc/lilo.conf is deprecated. The next
section describes those options that can be given only on the lilo command line;
the others were described earlier.
20ITEL801

FREE AND OPEN SOURCE SOFTWARE

LILO Boot Errors


As LILO loads itself, it displays the letters of the word LILO, one at a time as it proceeds.
Once LILO is correctly loaded, you’ll see the full word printed on the screen. If nothing
prints, then LILO has not been loaded at all; most likely LILO isn’t installed or it is
installed, but on a partition that is not active. If LILO started loading, but there was a
problem, you can see how far it got by how many letters printed:

It has been listed in below side:-


20ITEL801

FREE AND OPEN SOURCE SOFTWARE

L The first stage boot loader is loaded and running, but it can’t load the second stage. There should be
an error code indicating the type of problem; usually the problem is a media failure or bad disk
parameters. See the LILO User’s Guide for the meaning of the error codes.

LI The first stage boot loader loaded the second stage but was not able to run it. The problem is most
likely bad disk parameters or the file /boot/boot.b (the boot sector) was moved but the lilo command
wasn’t run.

LIL The second stage boot loader was run, but it couldn’t load the descriptor table from the map file. This
is usually caused by a media failure or bad disk parameters.

LIL? The second stage boot loader was loaded at an incorrect address, probably because of bad disk
parameters or by moving /boot/boot.b without running lilo

LIL- The descriptor table is corrupt. The problem is probably bad disk parameters or moving /boot/map
without running lilo.

LILO LILO was successfully loaded.


20ITEL801

FREE AND OPEN SOURCE SOFTWARE

LILO Command Options


The following list describes lilo command options that are available only on the
command line. Multiple options are given separately; for example:

● -C config-file Specify an alternative to the default configuration file (/etc/lilo.conf).


lilo uses the configuration file to determine which files to map when it installs
LILO.
● -I label Print the path to the kernel specified by label to standard output, or an error
message if no matching label is found. For example:
$ lilo -I linux
● -q List the currently mapped files. lilo maintains a file (/boot/map by default)
containing the name and location of the kernel(s) to boot. Running lilo with this
option prints the names of the files in the map file to standard output, as in this
example (the asterisk indicates that linux is the default):
$ lilo -q linux * test
20ITEL801

FREE AND OPEN SOURCE SOFTWARE

● -r root-directory Specify that before doing anything else, lilo should chroot to the
indicated directory. Used for repairing a setup from a boot CD or floppy; you can
boot from that disk but have lilo use the boot files from the hard drive. For example,
if you issue the following commands, lilo will get the files it needs from the hard
drive:
$ mount /dev/hda2 /mnt
$ lilo -r /mnt
● -R command-line Set the default command for the boot loader the next time it
executes. The command executes once and then is removed by the boot loader. This
option typically is used in reboot scripts, just before calling shutdown -r.
● -t Indicate that this is a test—do not really write a new boot sector or map file. Can be
used with -v to find out what lilo would do during a normal run.
20ITEL801

FREE AND OPEN SOURCE SOFTWARE

● -U device-name Like -u, but do not check the timestamp.


● -V Print the lilo version number
● -u device-name Uninstall lilo by restoring the saved boot sector from
/boot/boot.nnnn, after validating it against a timestamp. device-name is the name of
the device on which LILO is installed, such as /dev/hda2.
20ITEL801

FREE AND OPEN SOURCE SOFTWARE

REFERENCE

Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins, "Linux in a Nutshell",
Sixth Edition, OReilly Media, 2009.

Tom Phoenix, Randal Schwartz, Brian Foy "Learning Perl" , 6th Edition, O'Reilly
Media, 2011.

You might also like