When we open a boot menu, different options or settings are present there which can be used to configure the boot loader, in this write-up, we will discuss these grub boot options and how to modify them.
How do I change GRUB boot options
We have a GRUB boot configuration file at the path of /etc/default/grub, we can open it with any editor, before opening it, create the backup of this file by using the command:
To confirm the execution of the above command, display the contents of /etc/default/grub.bak using:
To save the changes, update the GRUB using the command:
For convenience we will open it with the help of a nano text editor using the command:
The first line “GRUB_DEFAULT” is the option to set the preference of choosing the operating system if you have more than one. If you set the value of this option to “0” then it will choose the first operating system present in the boot menu and if you set it “1” then it will choose the second operating system among the list.
Another option is GRUB_TIMEOUT_STYLE which is in our case set to the hidden, which implies it will not display the boot menu until the boot menu key is pressed, if it is set to “menu”, then it will display the Grub boot menu.
The next option in the boot menu is for “GRUB_TIMEOUT”. It is for boot time; how much time will it take to boot the operating system, in our case it is set to “0” which means it will boot the operating system immediately but you can increase this time according to your requirement.
To add the image in the background of the boot menu, download the image of your choice and then copy it to “/boot/grub” using the command:
Again open the configuration file of GRUB boot:
Add the following line in the file:
Save the file and exit the editor, and update the GRUB boot settings using the command:
The output is showing that the background image has been added, now rebooted Linux.
Press the GRUB MENU key (Shift) to open the boot menu:
We can see that the background of the GRUB boot menu has been changed.
Conclusion
GRUB menu is useful if you have more than one operating system, it will ask you which operating system you want to run on the computer, in the Linux operating system, the operating system is booted by the GRUB boot loader. GRUB menu options can be modified through the terminal in Linux. In this write-up, we have discussed how the grub boot options are changed through the command-line in Linux. In the Ubuntu-based distributions, the configurations of the GRUB menu are stored in /etc/default/grub and they can be changed by opening the following path with the help of an editor.