After cloning a Debian-based server to a replacement disk, the first reboot halts with an initramfs emergency prompt reporting that the kernel cannot mount the root filesystem on the UUID supplied in the root= parameter. Investigation shows that GRUB2 (installed in legacy BIOS/MBR mode) is still passing the old UUID to the kernel. The administrator wants to make the new root UUID persist across future kernel updates. Which configuration file should be modified before running update-grub so the correct root= value is passed to the kernel at every boot?
GRUB2 stores the menu that the firmware actually reads in /boot/grub/grub.cfg, but on Debian-based systems that file is regenerated automatically from templates each time update-grub (or a kernel package) is run. Persistent kernel command-line changes are therefore made in /etc/default/grub, usually by editing the GRUB_CMDLINE_LINUX (or GRUB_CMDLINE_LINUX_DEFAULT) variable and then regenerating the menu with update-grub. Editing /boot/grub/grub.cfg directly will work only until the next update overwrites it. The script /etc/grub.d/40_custom is meant for adding entirely new menu entries, not for changing the parameters of the distribution-generated entries. /etc/fstab influences how filesystems are mounted after the kernel has already mounted its root filesystem, so changing it will not fix a root= mismatch during early boot.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the GRUB_CMDLINE_LINUX variable in /etc/default/grub?
Open an interactive chat with Bash
Why shouldn't you edit /boot/grub/grub.cfg directly?
Open an interactive chat with Bash
What role does the UUID play in the root= parameter in GRUB2?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access