A system administrator needs to ensure that a recently installed kernel appears in the boot menu. The GRUB2 bootloader is used, and the administrator has copied the new kernel image to /boot. Which of the following commands should be executed to regenerate the GRUB2 configuration so that the new kernel will be listed at boot time?
The correct answer is grub2-mkconfig -o /boot/grub/grub.cfg. When the grub2-mkconfig command is followed by -o (output) option, it directs the command to write the generated configuration to a specified file, which is typically /boot/grub/grub.cfg or /boot/grub2/grub.cfg depending on the distribution. Writing to any other location, as suggested in the incorrect answers, will not influence the boot process, and the command update-grub is a convenience script present in some systems, which essentially calls grub-mkconfig with the appropriate arguments.
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 GRUB2 and why is it important?
Open an interactive chat with Bash
Why is the grub2-mkconfig command necessary, and what does it do?
Open an interactive chat with Bash
What is the difference between grub2-mkconfig and update-grub?