Linux Labs EspañolES

Hardware and boot Labs

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

bash
sudo -v

Steps

  1. Find out whether the machine booted with UEFI or legacy BIOS, and list the firmware boot entries if it is UEFI.
  2. Show the kernel command line of this boot and the default kernel the boot loader will pick next time.
  3. List the storage drivers and filesystem modules inside the initramfs of the running kernel.
  4. Measure how long each phase took and which units sat on the critical chain.
  5. Write down the default target and how fstab entries became mount units.

Verification

bash
[ -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-pager
Show the solution

On UEFI, add the firmware entries and the boot loader:

bash
sudo efibootmgr -v
sudo grubby --default-kernel          # RHEL family
grep -E '^GRUB_(DEFAULT|CMDLINE)' /etc/default/grub   # Debian and Ubuntu

Initramfs contents:

bash
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/Ubuntu

The mount units come from systemd-fstab-generator:

bash
ls /run/systemd/generator/*.mount
systemctl cat -- -.mount boot.mount 2>/dev/null | head

A 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.