LPIC-2 Linux Kernel and System Startup Practice Question
After installing a new kernel on a system using GRUB2, which command should be run to update the boot menu configuration file?
⚠ Common exam trap
Watch out — candidates often confuse `grub-install` (which installs the bootloader to disk) with `grub-mkconfig` (which updates the menu configuration), or they assume distribution-specific wrappers like `update-grub` are the correct answer when the exam expects the generic GRUB2 command.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
grub-mkconfig -o /boot/grub/grub.cfg
After installing a new kernel on a system using GRUB2, the boot menu configuration file must be regenerated to include the new kernel entry. The command `grub-mkconfig -o /boot/grub/grub.cfg` reads the configuration snippets in `/etc/default/grub` and scripts in `/etc/grub.d/`, then writes the updated GRUB2 configuration to the specified output file (`/boot/grub/grub.cfg`). This is the standard method on most Linux distributions that use GRUB2 (e.g., Debian, Ubuntu, RHEL 7+).
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
grub-install /dev/sda
Why it's wrong here
grub-install installs GRUB to a disk's boot sector, but does not update the menu configuration.
- ✓
grub-mkconfig -o /boot/grub/grub.cfg
Why this is correct
This is the standard command to regenerate the GRUB2 configuration file.
- ✗
update-grub
Why it's wrong here
update-grub is a wrapper for grub-mkconfig on some distributions, but the question expects the direct command; it is still plausible but less standard for LPIC-2.
- ✗
grub2-mkconfig -o /boot/grub2/grub.cfg
Why it's wrong here
This is a common path for GRUB2 on some distributions, but the default path on LPI systems is /boot/grub/grub.cfg.
Go deeper
Related to this question
About these practice questions
One of 507 original LPIC-2 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-2 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-2 exam.