Previous Page | Next Page

  1. Introduction
  2. Abbreviated Boot
  3. The Boot Process
  4. Startup and Run Levels
  5. Initialization Scripts
  6. Runlevel Scripts
  7. Login Process
  8. Bash Shell
  9. Filesystems
  10. LILO, Kernel and Root Filesystem
  11. The Kernel
  12. Passwords, Users, Groups, and Quotas
  13. The Environment
  14. The /etc/sysconfig directory
  15. The /proc filesystem
  16. Process Control
  17. Devices
  18. Daemons Services
  19. Inetd and Network Services
  20. Programs and Libraries
  21. Security and PAM
  22. The printer services
  23. Mouse support with gpm
  24. Mail
  25. News
  26. UUCP
  27. LDAP
  28. NFS and RPC
  29. Samba, NetBIOS, WINS, nmbd
  30. Identd (auth)
  31. Telnet and FTP
  32. Apache web server
  33. DNS and named
  34. How X Works
  35. X Scripts
  36. Support for Text
  37. Keymapping for Programs
  38. Keycode Table
  39. Example Keymap File
  40. Terminfo Commands
  41. VT100 ESC sequences
  42. Kernel Revisited
  43. Configuration Files
  44. Credits
\

The Relationship between LILO, the Kernel and the Linux Root Filesystem

Linux LILO

The program, lilo, which resides on /sbin/lilo is a program that is used to install a boot loader on a boot media such as a hard or floppy drive. If the kernel is modified, lilo must be rerun. The boot loader that lilo creates accesses a map of disk blocks that are in the kernel file. BIOS is used by the boot loader to load the kernel and is therefore subject to the limitations of BIOS. Therefore any disk size limitations that lilo has is usually due to the limitations of an older BIOS. Lilo maintains a file called /boot/map by default which contains the names and locations of the kernel(s) to boot. Typing lilo -q will list the names (which are labels in lilo.conf) in this file. Lilo uses the file /etc/lilo.conf to determine what files to map. Another configuration file can be used by using the -C option with lilo. Lilo can specify a root directory for the system by using the option -r. The default boot file to be used as the boot sector is /boot/boot.b.

There are several important functions that lilo may provide to allow a system to boot.

  • Specify the location of the root filesystem with a command like:

    root=/dev/hda1

    The rdev program can also be used to point the kernel to the root device.

  • Provide an initial RAM disk image for the kernel to boot from. This is necessary if the kernel requires a device supported by a module in order to boot. The following command sets a ram disk image. This image file is generated when the kernel is compiled.

    initrd=/boot/initrd-2.2.14.img

If LILO fails when printing out "LILO", it means the following:

LIGeometry mismatch or /etc/lilo/boot.b was moved without running the map installer
LILGeometry mismatch or media (disk) failure

Geometry failure means the number of cylinders, heads, or sectors in the BIOS configuration did not match the disk.
You can use the command "hdparm g /dev/hda" to determine hard disk geometry.

Starting the Kernel

In order for the kernel to be properly started, it must be in the correct location as pointed to by the lilo boot loader program. This location is specified in the /etc/lilo.conf configuration as described above. Also the kernel must be properly setup after any new compile is done. The compile is done from the directory /usr/src/linux. The boot image for the new kernel should be taken from the file "/usr/src/linux/arch/i386/boot/bzImage" and renamed vmlinuz or vmlinux-2.2.12-20 or whatever it is your intention to call it. Sometimes a softlink file in /boot called vmlinuz points to the kernel that is to be run. If the copy of vmlinuz is copied from the directory /usr/src/linux, the kernel may not load properly. Sometimes the error message states that the kernel is too large.

Loading the Root Device and rdev

Once a kernel is created, it can be further configured with the utility program called "rdev". This program is used to set the image root device, swap device, and RAM disk size. Without using rdev to set the location of the root image, the kernel would need to rely upon the lilo boot loader program to tell it where it is. If this is not setup properly, you would get a message like "kernel panic, unable to mount root device". In a kernel bootable image, there are several pairs of bytes that specify the following characteristics. These pairs of bytes start at decimal offset 498 in the kernel image.

498 Root flags (One sets the root FS to mount in read or read-write mode)
500-502 Reserved
504 RAM disk size
506 Video mode
508 Root device
510 Boot Signature
4. The swap device

To get help using rdev, type "rdev h". Below are formats for making adjustments to the kernel image:

rdev vmlinuz /dev/hda2Sets the kernel image named vmlinuz to mount /dev/hda2 as root filesystem.
rdev -s vmlinuz /dev/hda3Sets the kernel image to mount /dev/hda3 as the swap device.
rdev -r vmlinuz 627Set the RAMDISK size in kilobytes
rdev -v vmlinuz 1Set the bootup video mode 3=ask, -2=extended VGA, -1=Normal VGA, 1=key1 as if 0 pressed at the prompt, 2=key2 as if 1 were pressed.
rdev -R vmlinuz 1Set the rootflags to read only status, a 0 would mount read-write. This means the root partition is read-only at boot time so the filesystem can be checked before being mounted