-->

Previous | Table of Contents | Next

Page 27

CHAPTER 3

LILO

by Bill Ball and Jay Austad

IN THIS CHAPTER

Page 28

Booting Linux requires you to install a program to load the kernel into your computer. Which program you use depends on the computer you're using: You'll use LILO for Intel-compatible PCs, MILO for Digital Equipment Corp. Alpha PCs, or SILO for SPARC-compatible workstations. Because the CD-ROM included with this book contains Red Hat Intel/Linux, this chapter will focus on LILO, which, according to its author, Werner Almesberger, stands for Linux Loader.

This chapter will help you if you chose not to install LILO when you first installed Red Hat Linux or if you need help in properly starting Linux with certain kernel options. You've probably already decided how you want to start Linux on your computer, but you should know that there are other ways to fire up your system.

Instead of using LILO, you can start Linux from DOS with LOADLIN.EXE, which is included on your CD-ROM under the Dosutils directory. I'll discuss LOADLIN.EXE later in this chapter in the section "Using LOADLIN.EXE to Boot Linux."

You can also use your computer as a diskless workstation by booting Linux over a network. A discussion on this subject is beyond the scope of this chapter, but you'll find the details on how to do this in Robert Nemkin's Diskless-HOWTO, under the /usr/doc/HOWTO/mini directory after you install Linux.

Yet another approach is to use a commercial boot loader, such as V Communications, Inc.'s System Commander, which can come in handy if you need to run other operating systems such as OS/2, Solaris, or Windows NT on your computer.

LILO has capabilities similar to commercial solutions, but it's free. For now, I'll assume that you're going to use LILO to boot in one of three traditional ways. You can use LILO to start Linux

In the following section, I'll show you a list of LILO's configuration parameters and its
command-line arguments, and I'll point out some special features.

Installing and Configuring LILO

Although LILO is easy to install by using the lilo command (located under the /sbin directory), you should first take the time to read its documentation, which you'll find under /usr/doc. Along with the documentation, you'll also find a shell script called QuickInst, which can be used to replace an existing LILO installation or for a first-time install. LILO's documentation contains details of its features and provides important tips and workarounds for special problems, such as installing boot loaders on very large capacity hard drives or booting from other operating systems.

Page 29

WARNING
Before trying anything with LILO, you should have an emergency boot disk. Having a system that won't boot is not much fun, and if you don't have a boot disk, you might think that there is no possible way to get back in and change things. Spending a few minutes to make yourself a boot disk can save you a big headache down the road. Whatever happens, don't panic! If you need to rescue your system, see Chapter 4, "System Startup and Shutdown," for details.

If you don't install LILO during your Red Hat install or decide not to use the QuickInst script, there are two basic steps to install LILO:

  1. Configure /etc/lilo.conf.
  2. Run /sbin/lilo to install LILO and make it active.

This discussion describes modifying an existing lilo.conf file. Before making any changes, do yourself a favor and create a backup of the file either in the same directory or on a separate disk. Several files are important to LILO and are created during an initial install:

Configuring LILO

Under Linux, your hard drives are abstracted to device files under the /dev directory. If you have one or more IDE drives, your first hard drive is referred to as /dev/hda, and your second hard drive is /dev/hdb. SCSI drives are referred to as /dev/sda and /dev/sdb. When you installed Linux, you most likely partitioned your hard drive. The first partition on your first drive would be /dev/hda1 or /dev/sda1. Consequently, your second partition would be /dev/hda2 or /dev/sda2, and so on.

Before configuring LILO, you should know which partitions have what operating system on them. You should also know where you want to install LILO. In almost all cases, you will want to put LILO on the MBR. You shouldn't do this, however, if you run OS/2. OS/2's boot loader should go on the MBR, and LILO should then be installed on the superblock of the root partition.

Before installing LILO, you should know where your Linux partition is, and if you have other operating systems, you must know where they are located. For example, your Linux partition might be at /dev/hda1, and your Windows 95 partition might be at /dev/hda2.

Page 30

If Linux is the only operating system on your computer or if you have Windows 95 or Windows NT, you will want to install LILO as the MBR of the drive. If you have OS/2 also, you will want to install LILO on the root partition of your hard drive and use OS/2's boot loader on the MBR.

LILO is normally installed after you have partitioned your hard drives and after you have installed either Linux or other operating systems.

Armed with your information, you are now ready to edit LILO's configuration file, /etc/lilo.conf.

Editing lilo.conf

Editing lilo.conf is easy. Make sure that you're logged in as root, and load the file into your favorite editor, making sure to save your changes and to save the file as ASCII text. You'll edit lilo.conf for a number of reasons:

Listing 3.1 shows a sample lilo.conf file.

Listing 3.1. A sample lilo.conf.


# Start LILO global section

Boot = /dev/hda

Prompt

Vga = normal

Ramdisk = 0

# End LILO global section

image = /vmlinuz

  root = /dev/hda3

  label = linux

  read-only  # Non-UMSDOS filesystems should be mounted read-only for checking

other = /dev/hda1

  label = dos

  table = /dev/hda

You can add the parameters listed in Table 3.1 to your /etc/lilo.conf file. They could also be given at the boot prompt, but it is much simpler for them to reside in your /etc/lilo.conf file. Note that only 13 of LILO's 23 different options are listed here. See LILO's documentation for details.

Table 3.1. /etc/lilo.conf configuration parameters.

Previous | Table of Contents | Next