Explanation: After modifying GNU GRUB’s configuration file, which is usually located at /etc/default/grub, the command that must be run for the changes to take effect is grub-install12. The grub-install command is used to install GRUB on a device or partition, and to update the boot sector and the core image of GRUB3. The command takes the following basic syntax:
$ grub-install [options] install_device
The install_device argument specifies the device or partition where GRUB should be installed, such as /dev/sda or /dev/sda1. The options can be used to control various aspects of the installation, such as the target platform, the boot directory, the force mode, the verbosity level, etc3.
The grub-install command also invokes the grub-mkconfig command, which generates the GRUB configuration file (usually located at /boot/grub/grub.cfg) based on the settings in /etc/default/grub and the scripts in /etc/grub.d4. The grub-mkconfig command can also be run separately to update the GRUB configuration file without reinstalling GRUB on the device or partition4.
The other options in the question are not correct because:
- A. kill -HUP $(pidof grub): This command would send the hangup signal (HUP) to the process ID (PID) of grub, which is a command-line interface for GRUB. This would not update the GRUB configuration file or install GRUB on the device or partition.
- C. grub: This command would run the command-line interface for GRUB, which allows the user to interact with GRUB and execute various commands. This would not update the GRUB configuration file or install GRUB on the device or partition, unless the user explicitly runs the appropriate commands within the interface.
- D. No action is required: This option is false, because modifying the /etc/default/grub file alone does not affect the GRUB configuration file or the GRUB installation. The user needs to run either grub-install or grub-mkconfig to apply the changes.
References:
1: How to Update Grub on Ubuntu and Other Linux Distributions - It’s FOSS 2: How to Configure the GRUB2 Boot Loader’s Settings 3: Ubuntu Manpage: grub-install - install GRUB on a device 4: [GNU GRUB Manual 2.06: Invoking grub-mkconfig] : [GNU GRUB Manual 2.06: Invoking grub] : [kill(1) - Linux manual page] : [pidof(8) - Linux manual page] : [grub(8) - Linux manual page]