Lesson 3 of 9 · 24m
Boot Order, UEFI, and Serial Consoles
Control which device boots, keep UEFI variables predictable, and configure serial output so automated installation remains observable.
Most bare-metal provisioning failures are not exotic. The machine booted the wrong device, booted the right device once and never again, or output everything to a console nobody was watching. Boot behavior is a state machine spread across firmware settings, NVRAM boot entries, controller initialization, bootloader configuration, and kernel command lines. Treat it as one system and it becomes debuggable.
UEFI is not just BIOS with a mouse
UEFI keeps boot entries in firmware NVRAM. Each entry names a bootloader path on an EFI system partition. Linux manipulates these entries with efibootmgr:
efibootmgr -v
efibootmgr --bootorder 0003,0001,0000
efibootmgr -n 0004
efibootmgr -c -d /dev/sda -p 1 -L 'Rocky Linux' -l '\EFI\rocky\shimx64.efi'--bootorder is persistent order; -n is next boot only. That distinction is exactly what you need for provisioning: boot the installer once, then return control to the installed system.
Firmware boot entries drift
Installers create entries. Firmware sometimes reorders them. Duplicate entries survive disk replacement because NVRAM belongs to the motherboard, not the disk. Old entries may point at UUIDs that no longer exist. On a fleet, decide whether firmware boot order is authoritative or whether you intentionally refresh entries during provisioning. Otherwise identical machines diverge every time a disk or NIC is replaced.
Serial output requires configuration at every layer
A typical serial chain for x86 hardware looks like this:
BMC SOL -> physical UART -> firmware -> bootloader -> kernel -> gettyIf one layer is silent, you get a blank console and start imagining hardware faults. Configure GRUB explicitly:
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0"
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"The ordering of console= parameters matters. The last one becomes the primary console for init messages. Keeping tty0 means local KVM still works; keeping ttyS0 means SOL works.
Network boot entries are devices too
UEFI HTTP boot, PXEv4, PXEv6, and legacy network boot are not interchangeable. A machine can have IPv4 PXE enabled, IPv6 PXE disabled, and HTTP boot present but broken by certificate validation. When network boot inexplicably fails, capture which boot entry ran rather than saying "PXE failed." Firmware often skips an entry quietly and moves to the next device.
Make boot state part of acceptance testing
After installation, verify the system boots from local disk without intervention. Power-cycle it cold, not just rebooted warm. Inspect efibootmgr output, confirm serial logs are complete, and test remote console behavior. A server that only boots when the provisioning network is present is not provisioned; it is tethered.
Field notes
- Secure Boot changes which bootloaders can execute; test installer kernels and out-of-tree modules with the intended state enabled.
- Some firmware treats front USB, rear USB, and virtual-media USB as different devices.
- A server can boot UEFI from one disk and legacy BIOS from another. Mixed-mode debugging is misery; standardize early.
- NVRAM boot entries do not move with disks during chassis replacement.
- If SOL freezes at OS handoff, suspect missing kernel console parameters before blaming the BMC.
Was this lesson helpful?