Bootloader
A bootloader is the bridge between turning the computer on and the operating system starting. The motherboard firmware does not know how to start Linux or Windows directly. It starts the bootloader, and the bootloader knows where the operating system lives and how to launch it. If you have ever seen a menu at startup asking which system to boot, that menu came from the bootloader.
A bootloader loads an OS kernel into memory, passes it parameters, and jumps to it. On UEFI systems it is an .efi file on the EFI System Partition. On legacy BIOS systems it starts from the disk’s Master Boot Record.
GRUB 2 is the default bootloader for Ubuntu, Debian, Fedora, and most Linux distributions. Others include systemd-boot, rEFInd, and Windows Boot Manager.
Ubuntu UEFI boot chain:
- Firmware loads
shimx64.efi(signed for Secure Boot) - shim loads
grubx64.efi - GRUB reads
/boot/grub/grub.cfg, shows the menu, loads/boot/vmlinuz-*and/boot/initrd.img-* - The kernel starts, mounts the real root filesystem, and launches systemd
Key GRUB files:
/etc/default/grub: settings you edit (timeout, default entry, kernel parameters)/etc/grub.d/: scripts that generate menu entries/boot/grub/grub.cfg: the generated config. Do not edit by hand; runupdate-grub.
At the menu: press e to edit an entry for one boot only (for example, add systemd.unit=rescue.target), then Ctrl+X to boot it. Choose “Advanced options” to start an older kernel or recovery mode.
Source: GNU GRUB Manual
Managing GRUB on Ubuntu
# Show the menu for 5 seconds instead of hiding it
$ sudo nano /etc/default/grub
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=5
# Regenerate grub.cfg after any change
$ sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-7.0.0-15-generic
done
# Reinstall GRUB to the EFI System Partition (from a live USB chroot)
$ sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi
Installation finished. No error reported. Bootloader trouble is one of the classic “the server will not come back” problems. Common causes: a dual-boot Windows update that overwrote the boot order, a deleted EFI entry, a full /boot partition that broke a kernel update, or a typo in /etc/default/grub. The standard fix is to boot a live USB, mount the installed system, chroot into it, and run grub-install and update-grub. Being able to do that calmly is a core Linux admin skill, and it is exactly what BNLC Foundations Phase 4 drills.