Interview Prep/Linux/Packages, kernel and boot

You need to rebuild the initramfs after adding a storage driver required for boot. How?

IntermediateScenarioPackages, kernel and boot
Answer

Situation read → Boot-critical drivers must be in the initramfs.

What I'd do →

  • RHEL: echo 'add_drivers+=" vendor_drv "' | sudo tee /etc/dracut.conf.d/vendor.conf then sudo dracut -f --kver $(uname -r).
  • Debian/Ubuntu: add vendor_drv to /etc/initramfs-tools/modules then sudo update-initramfs -u -k all.
  • Check: lsinitrd | grep vendor_drv or lsinitramfs /boot/initrd.img-$(uname -r) | grep vendor_drv.

Why → If the root disk driver isn't in the initramfs, the kernel can't find root and drops to a dracut shell.

Interview tip → Also needed when moving a VM to hardware with different storage controllers.

All Linux questions Roadmap: Linux

More on Packages, kernel and boot