Pcornel
Linux · Boot Process

initramfs

Cheat sheet · https://pcornel.dk/topic.php?topic=2732

Back to the Topic

Answer

The initramfs is a small filesystem loaded with the kernel that contains the drivers and tools needed to find and mount the real root (storage drivers, LVM, RAID, encryption).

Remember

Rebuild it after changing storage drivers, LVM/RAID/LUKS setup or root device: update-initramfs -u -k all (Debian) or dracut -f --regenerate-all (RHEL). Check its content with lsinitramfs or lsinitrd.

First checks

  • lsinitrd | head — RHEL initramfs content
  • lsinitramfs /boot/initrd.img-$(uname -r) | head — Debian initramfs content
  • systemd-analyze — boot time per stage
  • journalctl -b -p err — errors in this boot
  • journalctl --list-boots — previous boots
  • cat /proc/cmdline — kernel command line used

Verify in this order

initramfs unpacked → drivers loaded → LVM/RAID/LUKS assembled → root found by UUID → switch_root to the real root

Where it usually breaks

First mismatch in persistent unit/config/generator → dependency/order graph → systemd state → process/cgroup → socket/resource dependency → journal → consumer check; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2732

Confirmation

Confirm action

Continue?