What a Bootloader Actually Does

GRUB & Multibooting

Chapter 1 · What a Bootloader Actually Does

linux1-5 walked through a real Debian install, including the moment the installer asks "Install the GRUB boot loader?" and offers to write it to a disk — then moved on, without ever explaining what that step actually does. This chapter is that explanation, from the ground up.

The Boot Sequence — From Power-On to a Running Kernel

  1. The machine's own firmware (BIOS or UEFI) runs first, initializing hardware
  2. Firmware locates and hands control to a bootloader
  3. The bootloader loads the kernel — and usually an initramfs, a small temporary filesystem — into memory
  4. The kernel takes over, mounts the real root filesystem, and starts the init system (systemd on Debian and most modern distros)

The bootloader's own job is narrow and specific: it's the bridge between "firmware has no concept of an operating system" and "the kernel is now running and can take it from here." It does not run the operating system itself — it hands off, once.

BIOS vs. UEFI — Two Different Firmware Models

BIOS (legacy) reads the very first sector of a disk and blindly executes whatever code is there — no awareness of filesystems, no real structure. UEFI (modern) is a genuinely more capable environment: it can read an actual filesystem — specifically a FAT-formatted EFI System Partition — and directly execute a real, named .efi file from it. This distinction gets its own full chapter later (grub1-5); for now, just know the two models exist and behave in fundamentally different ways.

MBR vs. GPT — Previewed

MBR (Master Boot Record) is the legacy partition table format — a maximum of four primary partitions, a 2TB disk-size ceiling, and the natural pairing for BIOS. GPT (GUID Partition Table) is the modern replacement — far more partitions allowed, no meaningful size limit, and the natural pairing for UEFI. Full depth on both is grub1-5's own job; this preview exists purely so the chapters between here and there make sense as you go.

What GRUB's Actual Job Is

GRUB (the GRand Unified Bootloader) is one specific bootloader implementation — the one Debian, and most major Linux distributions, install by default. Its job: find the kernel, find the initramfs, load both into memory with the right parameters, and hand off control. Along the way it offers a menu — letting you choose between multiple installed kernels, or multiple operating systems entirely — and lets kernel parameters be edited live at boot time, previewed here and covered fully in grub1-4.

Resolving linux1-5's Own Installation Screen

That "Install the GRUB boot loader?" prompt is the exact moment GRUB gets written to disk — into the MBR's own boot sector on a BIOS system, or as a real file inside the EFI System Partition on a UEFI system. linux1-5 walked through this operationally, as one screen in an installer wizard, without explaining the mechanism underneath it. That mechanism is now on the table.

Partition table usedFilesystem-aware?Bootloader location
BIOSMBRNo — reads a raw disk sectorThe MBR's own boot sector, not a normal file
UEFIGPTYes — reads FAT on the EFI System PartitionA real, named .efi file, an ordinary file on disk
On UEFI, the bootloader is a genuinely inspectable file
Mount the EFI System Partition (commonly at /boot/efi) and you can ls it directly — the actual .efi bootloader files sit there as ordinary files on an ordinary FAT filesystem. A concrete, inspectable artifact, unlike BIOS's opaque, raw MBR boot sector.
Mixing BIOS and UEFI boot modes is a common, confusing failure
Booting a live USB in the wrong mode, or attempting to UEFI-boot a disk that was partitioned as MBR, is a frequent, genuinely confusing source of "bootloader not found" errors. BIOS and UEFI aren't two flavors of the same thing — they're incompatible models, and a disk/boot-mode mismatch produces failures that look mysterious until this distinction is understood.

Hands-On Exercises

Exercise 1

List, in order, the four steps of the boot sequence from this chapter, and explain in one sentence what would go wrong if the bootloader step were skipped entirely.

📄 View solution
Exercise 2

Explain why a UEFI system's bootloader can be inspected as an ordinary file, while a BIOS system's cannot, referencing the actual filesystem-awareness difference between the two.

📄 View solution
Exercise 3

A USB installer was created in UEFI mode, but the target machine's firmware is set to boot in legacy BIOS mode. Predict what would happen, using this chapter's own warn-box.

📄 View solution

Chapter 1 Quick Reference

  • Boot sequence: firmware → bootloader → kernel + initramfs loaded → kernel mounts root, starts init
  • A bootloader's job is narrow: bridge firmware (no OS concept) to a running kernel, then hand off, once
  • BIOS reads a raw MBR sector, no filesystem awareness; UEFI reads a real FAT filesystem and runs a named .efi file
  • MBR (legacy, 4 partitions, 2TB limit) pairs with BIOS; GPT (modern, no practical limits) pairs with UEFI — full depth in grub1-5
  • GRUB is one specific bootloader: finds the kernel/initramfs, loads them, offers a menu, allows live parameter edits
  • linux1-5's own "Install the GRUB boot loader?" prompt is exactly this — writing GRUB to the MBR or the EFI System Partition
  • BIOS and UEFI are incompatible models — mixing them (wrong-mode USB, mismatched partition table) is a real, common failure source