3.4 Legacy GRUB & Alternative Boot Loaders (102.2)
Key Takeaways
- Legacy GRUB (version 0.97) uses a single static configuration file located at /boot/grub/menu.lst (or /boot/grub/grub.conf) that is edited directly by administrators.
- Legacy GRUB indexes both hard drives and partitions starting at zero: (hd0,0) represents the first partition of the first disk (/dev/sda1).
- In contrast, GRUB 2 indexes hard drives starting at zero but partitions starting at one: (hd0,1) represents /dev/sda1.
- systemd-boot is a lightweight UEFI-only bootloader configured via /boot/loader/loader.conf and individual drop-in entry files in /boot/loader/entries/.
- LILO (Linux Loader) requires running the /sbin/lilo command after any modification to /etc/lilo.conf or kernel updates to rewrite physical sector pointers in the MBR.
3.4 Legacy GRUB & Alternative Boot Loaders (102.2)
Quick Summary: While modern Linux distributions utilize GRUB 2, legacy systems and specialized environments employ alternative boot mechanisms. Legacy GRUB (version 0.97) relies on a directly editable
/boot/grub/menu.lstfile with 0-indexed partitions. Modern lightweight UEFI systems frequently usesystemd-boot(formerly gummiboot), embedded devices use Syslinux/ISOLINUX, and historical servers may run LILO. Understanding partition numbering schemes and bootloader architectures is a core LPIC-1 requirement.
1. Legacy GRUB (GRUB 0.97) Architecture
Legacy GRUB (GRUB version 1 or 0.97) operates using a single, static configuration file. Unlike GRUB 2, there is no configuration generator (grub-mkconfig), and administrators edit the menu file directly.
Primary Configuration File Paths
- Debian / openSUSE / Ubuntu (Legacy):
/boot/grub/menu.lst - Red Hat / CentOS / Fedora (Legacy):
/boot/grub/grub.conf(frequently symlinked from/etc/grub.confand/boot/grub/menu.lst)
# Sample Legacy GRUB configuration (/boot/grub/menu.lst)
default=0
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS Linux (2.6.32-754.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-754.el6.x86_64 ro root=/dev/sda2 quiet rhgb
initrd /initramfs-2.6.32-754.el6.x86_64.img
title CentOS Linux (Rescue Mode)
root (hd0,0)
kernel /vmlinuz-2.6.32-754.el6.x86_64 ro root=/dev/sda2 single
initrd /initramfs-2.6.32-754.el6.x86_64.img
Legacy GRUB Directive Syntax
default=N: Specifies the default boot entry index (0-indexed;0boots the firsttitlestanza).timeout=N: Wait time in seconds before automatically booting the default entry.title <name>: Defines a new boot menu entry and its display label.root (hdX,Y): Defines the GRUB root partition where the kernel and initrd images reside.kernel <path> <options>: Specifies the path to the kernel binary on the GRUB root filesystem, followed by kernel boot arguments.initrd <path>: Specifies the path to the initial RAM disk image.
⚠️ LPIC-1 Trap (Separate
/bootPartition): If/bootresides on a separate partition(hd0,0), the kernel path is/vmlinuz-..., NOT/boot/vmlinuz-.... If/bootis part of the root partition(hd0,1), the path is/boot/vmlinuz-....
2. Partition Numbering Comparison: Legacy GRUB vs. GRUB 2
A critical topic on the LPIC-1 exam is the fundamental difference in disk and partition numbering between Legacy GRUB, GRUB 2, and Linux kernel device nodes.
| Linux Device Node | Legacy GRUB (0.97) Notation | GRUB 2 Notation (MBR / GPT) | Explanation |
|---|---|---|---|
/dev/sda1 | (hd0,0) | (hd0,1) or (hd0,msdos1) / (hd0,gpt1) | 1st disk, 1st partition |
/dev/sda2 | (hd0,1) | (hd0,2) or (hd0,msdos2) / (hd0,gpt2) | 1st disk, 2nd partition |
/dev/sdb1 | (hd1,0) | (hd1,1) or (hd1,msdos1) / (hd1,gpt1) | 2nd disk, 1st partition |
/dev/sdb5 | (hd1,4) | (hd1,5) or (hd1,msdos5) | 2nd disk, 1st logical partition |
/dev/sdc3 | (hd2,2) | (hd2,3) or (hd2,gpt3) | 3rd disk, 3rd partition |
💡 LPIC-1 Rule of Thumb:
- Legacy GRUB: Hard drives start at 0, partitions start at 0.
- GRUB 2: Hard drives start at 0, partitions start at 1.
- Linux OS: Disks use letters (
sda=1st,sdb=2nd), partitions use numbers starting at 1 (sda1).
3. Alternative Bootloader: systemd-boot (gummiboot)
systemd-boot (formerly known as gummiboot) is a simple, lightweight UEFI bootloader integrated into systemd. It does not load filesystem drivers or complex configuration scripts; instead, it relies strictly on UEFI firmware services.
Configuration Structure
- Global Configuration:
/boot/loader/loader.conf(or$ESP/loader/loader.conf) - Boot Entries Directory:
/boot/loader/entries/*.conf
# Global Loader Configuration (/boot/loader/loader.conf)
default arch.conf
timeout 4
console-mode max
editor no
# Drop-in Boot Entry (/boot/loader/entries/arch.conf)
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=UUID=1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d rw quiet
bootctl Management Commands
bootctl status: Displays current firmware, ESP mountpoint, secure boot status, and configured bootloader entries.bootctl install: Installssystemd-bootbinary into the EFI System Partition.bootctl update: Updates installed bootloader binaries.
4. Alternative Bootloader: Syslinux Suite
The Syslinux project is a collection of lightweight bootloaders designed for booting Linux from FAT filesystems, optical discs, and network PXE environments.
| Variant | Target Boot Media / Filesystem | Configuration File Name |
|---|---|---|
| SYSLINUX | FAT12 / FAT16 / FAT32 filesystems (Floppy, USB drives) | syslinux.cfg |
| ISOLINUX | ISO 9660 optical discs (Live CDs, installation media) | isolinux.cfg |
| EXTLINUX | ext2 / ext3 / ext4, Btrfs, and XFS partitions | extlinux.conf |
| PXELINUX | Network booting via DHCP and TFTP (PXE) | pxelinux.cfg/default (or pxelinux.cfg/<MAC>) |
5. Alternative Bootloader: LILO (Linux Loader)
LILO is a classic Linux bootloader used extensively before GRUB. It relies on a single configuration file at /etc/lilo.conf.
# Sample /etc/lilo.conf
boot=/dev/sda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=linux
image=/boot/vmlinuz-2.6.32
label=linux
read-only
root=/dev/sda1
The Critical LILO Mechanism
LILO does not contain filesystem drivers. When LILO boots, it loads kernel sectors directly from raw physical disk block addresses recorded in the boot sector.
⚠️ LPIC-1 Trap: Any time
/etc/lilo.confis edited OR a new kernel image is installed, the administrator MUST execute/sbin/lilo. Runninglilorecalculates physical disk block pointers and writes them to the boot sector. If you fail to runlilo, the system will fail to boot on the next restart!
In a Legacy GRUB (0.97) configuration file, which notation corresponds to the second partition on the first SATA hard drive (/dev/sda2)?
A system administrator modifying an older Linux server running LILO edits /etc/lilo.conf to update a kernel path. What mandatory action must be taken before rebooting to ensure the changes take effect?
Which configuration file is the main configuration file for systemd-boot (formerly gummiboot) on a modern UEFI system?