Map the boot chain of your own machine
Foundation20 minYour VMRHEL and Debian families
Objective
Name every stage your system went through on its last boot, with the file or setting behind each one.
Requirements
- Any Linux VM or server you can use with sudo.
- Read-only lab: nothing is changed.
Setup
sudo -vSteps
- Find out whether the machine booted with UEFI or legacy BIOS, and list the firmware boot entries if it is UEFI.
- Show the kernel command line of this boot and the default kernel the boot loader will pick next time.
- List the storage drivers and filesystem modules inside the initramfs of the running kernel.
- Measure how long each phase took and which units sat on the critical chain.
- Write down the default target and how fstab entries became mount units.
Verification
[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
cat /proc/cmdline
systemd-analyze
systemd-analyze critical-chain | head -n 15
systemctl get-default
systemctl list-units --type=mount --no-pagerShow the solution
On UEFI, add the firmware entries and the boot loader:
sudo efibootmgr -v
sudo grubby --default-kernel # RHEL family
grep -E '^GRUB_(DEFAULT|CMDLINE)' /etc/default/grub # Debian and UbuntuInitramfs contents:
sudo lsinitrd /boot/initramfs-$(uname -r).img | grep -E 'nvme|virtio|xfs|ext4|lvm' # RHEL
lsinitramfs /boot/initrd.img-$(uname -r) | grep -E 'nvme|virtio|lvm' # Debian/UbuntuThe mount units come from systemd-fstab-generator:
ls /run/systemd/generator/*.mount
systemctl cat -- -.mount boot.mount 2>/dev/null | headA good write-up names, for each stage, the evidence you used: efibootmgr for the boot manager, /proc/cmdline for GRUB, lsinitrd for the initramfs, systemd-analyze for the timing and the generator directory for fstab.