202.3 Alternate Bootloaders (weight: 2)

Tech Tutorial: 202.3 Alternate Bootloaders #

Introduction #

In this tutorial, we will explore alternate bootloaders beyond the commonly used GRUB (GRand Unified Bootloader). A bootloader is fundamental in the process of booting up your Linux system as it manages and allows the loading of the operating system kernel. Understanding alternate bootloaders is crucial for system recovery, customization, and optimization.

Exam Objective #

The objective covers the understanding and application of alternate bootloaders, with a specific focus on LILO (Linux Loader) and SYSLINUX. These bootloaders serve as alternatives to GRUB and are used in various scenarios depending on system requirements and constraints.

Key Knowledge Areas: #

  • LILO configuration
  • SYSLINUX configuration
  • PXELINUX for network boot

Utilities: #

  • lilo
  • syslinux
  • pxelinux
  • isolinux

Step-by-Step Guide #

1. LILO (Linux Loader) #

LILO is one of the oldest bootloaders used in Linux systems. Unlike GRUB, LILO does not support booting from a network and must be reinstalled each time you change the configuration file.

LILO Configuration #

Here’s how you can install and configure LILO on a typical Linux system.

Installation:

sudo apt-get update
sudo apt-get install lilo

Configuration:

Edit the /etc/lilo.conf file to set up the boot options.

sudo nano /etc/lilo.conf

Sample lilo.conf:

boot=/dev/sda
vga=normal
read-only

image=/boot/vmlinuz
  label=linux
  initrd=/boot/initrd.img
  read-only

Updating LILO:

Every time you make changes to lilo.conf, you need to update LILO.

sudo lilo

This command will integrate the changes into the bootloader.

2. SYSLINUX #

SYSLINUX is a suite of lightweight bootloaders, designed for simplicity and compatibility, which includes PXELINUX for network boot scenarios.

SYSLINUX Configuration #

Installation:

sudo apt-get install syslinux

Configuration:

Copy the SYSLINUX files to your target directory (usually a USB drive or a specific partition).

sudo syslinux /dev/sdb1

Creating a config file (syslinux.cfg):

mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb
nano /mnt/usb/syslinux.cfg

Sample syslinux.cfg:

DEFAULT linux
LABEL linux
    KERNEL vmlinuz
    APPEND root=/dev/sdb1 ro quiet

Unmount the USB drive:

umount /mnt/usb

3. PXELINUX #

PXELINUX is part of the SYSLINUX suite, designed for booting from a network.

Setting up a PXELINUX boot server:

Install necessary packages:

sudo apt-get install tftp-hpa inetutils-inetd

Configure tftp and place the PXELINUX bootloader and kernel files in the tftp directory.

/etc/inetd.conf entry for tftp:

tftp    dgram   udp     wait    nobody  /usr/sbin/tcpd  /usr/sbin/in.tftpd /tftpboot

Sample PXELINUX configuration (pxelinux.cfg/default):

DEFAULT linux
LABEL linux
    KERNEL vmlinuz
    APPEND root=/dev/nfs nfsroot=192.168.0.1:/path/to/rootfs ip=dhcp rw

Restart the inetd service:

sudo service inetd restart

Conclusion #

Understanding and configuring alternate bootloaders like LILO, SYSLINUX, and PXELINUX can be crucial for customizing your boot process, especially in environments where specific configurations or network booting is required. These tools offer flexibility and a range of options for different scenarios, making them valuable additions to any system administrator’s toolkit.