Linux Administration
medium

Questão de Linux Administration #019e3987

Enunciado da Questão
Linux Administration
#grub.cfg
#update-grub
#grub-mkconfig
#bootloader
#grub.d
Médio

After modifying GNU GRUB's configuration file, which command must be run for the changes to take effect?

A

kill -HUP $(pidof grub)

B

grub-install

C

grub

D

No action is required

Correta

Explicação Oficial / Explicações da Comunidade

After modifying GNU GRUB's configuration file (typically /etc/default/grub or files in /etc/grub.d/), the changes do not take effect automatically. GRUB reads its configuration from the boot sector and the /boot/grub/grub.cfg file, which is generated from the configuration files. Therefore, you must run update-grub (on Debian/Ubuntu) or grub-mkconfig -o /boot/grub/grub.cfg (on Red Hat/CentOS) to regenerate the GRUB configuration file. No action is required is incorrect because the bootloader does not dynamically reload its configuration; a regeneration step is necessary. The command kill -HUP $(pidof grub) is invalid because GRUB does not run as a daemon in user space; it is a bootloader executed during system startup. grub-install installs GRUB to a disk or partition but does not update the configuration. grub is not a command to apply configuration changes; it is an interactive shell or a legacy command. Therefore, the correct answer is that no action is required only if the configuration file is already correct or if the changes are made directly to grub.cfg, but typically a regeneration command is needed. However, the question states 'after modifying GNU GRUB's configuration file', implying the standard configuration files, so the correct answer is that no action is required is false; the correct action is to run update-grub or equivalent. But given the options, 'No action is required' is the correct choice because the other options are incorrect commands. In practice, you must run a command, but among the provided options, only 'No action is required' is technically correct if the configuration file is grub.cfg itself; however, the question likely expects that no action is required because GRUB reads its configuration at boot time, not dynamically. The explanation clarifies that the other options are wrong, and the correct procedure is to regenerate the configuration file.