Configuring LILO

LILO uses a file called /etc/lilo.conf as its configuration tool. To install and use LILO, you must do three things:

1. Install LILO from the lilo package that comes with all major distributions. This job may have already been done when you installed Linux.

2. Edit the /etc/lilo.conf file, as described shortly.

3. As root, type lilo to install the LILO boot loader code in the MBR or partition's boot sector, as defined in /etc/lilo.conf.

Tip If you want to experiment with LILO configurations, try installing LILO to a floppy disk. You can do this by specifying boot=/dev/fdO, instead of the usual hard disk or partition, in /etc/lilo.conf. You can then insert the LILO floppy to test the new LILO configuration without damaging your standard configuration.

Listing 10.2 presents a typical /etc/lilo.conf file, which is similar in functionality to Listing 10.1's GRUB configuration. The first eight lines of Listing 10.2 set global options. These include the timeout period before LILO boots the default OS, in tenths of a second (timeout=100), the device to which the boot loader is installed (boot=/dev/hda—LILO installs in the MBR, as opposed to a partition boot sector such as /dev/hda6), and an option to use linear (or logical) block addressing (LBA) mode (Iba32). The next eight lines (the change-rules section) define partition type codes, which will be used in the DOS and Windows setups. Listing 10.2 defines DOS 16 and DOS32 partition types, each with a normal and hidden variant.

Listing 10.2: Typical lilo.conf LILO Configuration File prompt timeout=100

default=linux boot=/dev/hda map=/boot/map install=/boot/boot.b message=/boot/message


change-rules reset type=DOS16 normal=0x06 hidden=0x16 type=DOS32 normal=0x0b hidden=0x1b image=/boot/bzlmage-2.4.19 labeMinux root=/dev/hda7 read-only other=/dev/hda2 label=windows change partition=/dev/hda2 activate set=DOS32_normal partition=/dev/hda1 set=D0S16_hidden deactivate other=/dev/hda1 label=dos change partition=/dev/hda1 set=D0S16_normal activate partition=/dev/hda2 set=DOS32_hidden deactivate

The four lines beginning with the image= definition specify the Linux kernel image that's to be booted. Unless a default= line appears earlier in the file, the first image= or other= line is the default, so the Linux definition in Listing 10.2 is the default OS. The label= line sets a name for the image. Depending on other options and defaults for your version of LILO, you may type the name at a boot: prompt or select the OS by name from a menu that appears at boot time. The root= option tells LILO what the Linux root partition is, and the read-only option tells the kernel to mount that partition read-only (it's normally remounted read/write after the system reads/etc/fstab). Unlike GRUB, the kernel image specification is a regular Linux filename. Therefore, assuming the kernel image is stored in /boot, you must include that leading directory name whether or not /boot is a separate partition.

The two other= definitions set up Windows and DOS definitions, respectively. If you only have one DOS or Windows partition, these definitions can be much shorter than shown in Listing 10.2, and you can dispense with the earlier change-rules section, as well. The change subsections define how partition types are to be altered when booting one of these OSs. The partition subsections define the partition type to be set for the DOS and Windows partitions and whether to activate or deactivate the partitions (that is, mark them as bootable or not bootable). Listing 10.2 marks the partition that's to be booted as normal and active, and the other partition as hidden and inactive.

Team LiB

1 previous

Team LIB

^ previous

0 0

Post a comment