RHCE2B.COM
Next Previous Contents

4. Boot Loaders

4.1 Concepts

  1. Invocation

    Invocation of the boot loader usually occurs in one of two ways:

    The first stage boot loader is also known as Initial Program Loader (IPL). It must be less than 512 bytes in size, so it is fairly limited. It's primary job is to load a more functional boot loader (a.k.a. the second stage boot loader).

  2. Configuration

    There are two different ways to configure a boot loader:

4.2 Lilo

  1. Configuration File

  2. Command Line Options

  3. Boot Time arguments

    Command line options can be entered at the boot prompt by appending it to the image that you are booting. For example:

    linux root=/dev/hda5 mem=128M 1

    Tells lilo to boot the kernel with a label of "linux" into runlevel 1 using /dev/hda5 as the root filesystem. It also states the machine has 128 MB of RAM.

    If lilo has been password protected, you will be required to enter the password before booting.

  4. Errors

    The 'LILO' prompt itself can be used to help diagnose boot related errors. The number of letters presented at the LILO prompt can indicate the success or failure of the boot loader.

  5. Limitations

  6. Fixing a corrupt MBR

    Use lilo to fix:

    /sbin/lilo

  7. Uninstalling LILO

    When LILO overwrites an existing boot sector, it saves a copy of the original boot sector in /boot. The name of the original boot sector will be boot.MMmm where 'MM' is the major device number and 'mm' is the minor device number. So, the original boot sector from /dev/hda will be /boot/boot.0300.

    To restore the original boot sector, use the dd command:

    dd if=/boot/boot.0300 of=/dev/hda bs=446 count=1
    

    The original boot sector is actually 512 bytes in length, but the remaining bytes after 446 are part of the partition table and we don't want to overwrite that in case it's changed.

  8. Initial RAM Disk

4.3 Grub

  1. Features

  2. Configuration File

  3. Boot Time arguments

    In order to pass arguments to the image being booted, you must enter menu editing mode, or enter the grub command line. If GRUB has been password protected, you'll need to enter 'p' followed by your password first.

    To enter menu editing mode, select and entry and press 'e'. This will allow you to modify an existing boot setup and pass options to the kernel as well as init.

    The GRUB command line allows you to create boot commands that don't exist in your grub.conf file. You can also run diagnostic tests and view the contents of files on your file systems.

  4. Device Names according to Grub

  5. Fixing a corrupt MBR

    Use grub-install to fix:

    /sbin/grub-install /dev/hda

  6. Multi-disk scenario

    In this situation, we have a nameless OS installed on /dev/hda and Linux installed on /dev/hdb. We need to setup grub to boot both OSes. This involves installing the first stage of grub on the MBR of /dev/hda and the second stage of grub on the /boot partition of /dev/hdb. We will use the grub configuration file listed above. This scenario assumes you either have a working system or are running in rescue mode chroot'd to /mnt/sysimage.

4.4 DOS Based

  1. Loadlin - Capable of booting multiple OSes
  2. Syslinux - Used by RH installation program.


Next Previous Contents
ERROR!!


Linux Waves Banner Exchange
RHCE2B.COM Home Page
RHCE2B.COM Practice Test for the RHCE exam
Legal stuff