Courseiva

LPIC-1 Linux Installation and Package Management Practice Question

During boot, a server loads the wrong kernel. Which file should the administrator modify to change the default kernel in a standard GRUB 2 configuration?

⚠ Common exam trap

Test-takers frequently confuse the GRUB 2 configuration file (/etc/default/grub) with the GRUB Legacy file (/boot/grub/grub.conf) or the auto-generated runtime file (/boot/grub/grub.cfg), leading them to pick an option that either belongs to an older bootloader version or is not meant for direct editing.

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

✓

/etc/default/grub

In a standard GRUB 2 configuration, the default kernel is selected by setting the GRUB_DEFAULT variable in /etc/default/grub. After modifying this file, the administrator must run update-grub (or grub-mkconfig) to regenerate the /boot/grub/grub.cfg file, which is the actual configuration read by the bootloader. This two-step process separates user-facing settings from the bootloader's runtime configuration.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    /boot/grub/grub.conf

    Why it's wrong here

    GRUB 2 uses /boot/grub2/grub.cfg (or /boot/grub/grub.cfg) plus /etc/default/grub for the default entry; grub.conf belongs to GRUB Legacy. It is tempting because grub.conf was correct on older systems, but GRUB 2 replaced that file, so editing it changes nothing on this server.

  • ✗

    /etc/grub.d/

    Why it's wrong here

    Editing /etc/grub.d/ changes the scripts that regenerate grub.cfg, not the running default; GRUB_DEFAULT in /etc/default/grub is the setting that selects the kernel, applied via update-grub. The directory is tempting because its numbered scripts define menu entries, so it is the right place to add or remove boot options.

  • ✓

    /etc/default/grub

    Why this is correct

    Editing `/etc/default/grub` sets the `GRUB_DEFAULT` variable, which selects the default menu entry by index, title or saved entry. Regenerating `grub.cfg` with `grub-mkconfig` then applies that choice, satisfying the requirement to change the default kernel persistently in a standard GRUB 2 setup.

  • ✗

    /boot/grub/grub.cfg

    Why it's wrong here

    grub.cfg is generated output; manual edits are overwritten the next time update-grub runs, so the default kernel reverts. It is tempting because it visibly contains the menuentry and set default lines that control boot, making it look like the authoritative configuration file rather than a build artefact.

About these practice questions

This LPIC-1 question is part of Courseiva's 402-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LPIC-1 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-1 exam.