Open In App

How to Change Boot Options on Linux

Last Updated : 26 Dec, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

During the computer startup process, users are presented with boot options in the boot menu. This menu displays all the available bootable partitions on the computer. Users must decide within a specified time frame which operating system (OS) they want to boot into. If no option is selected within this time, the default boot option takes precedence, and the system boots into the specified OS. Typically, boot options become relevant when there are two or more operating systems installed on the system. Many users opt for a dual-boot configuration with Windows and Linux. In such cases, the GRUB boot loader assigns priority to Linux by default. This default setting might be inconvenient for users who primarily use Windows and occasionally switch to Linux. If users aren’t attentive during startup, their device will automatically boot into Linux, potentially causing frustration for those who primarily use Windows.

In this article, we will see how to change boot options by accessing the grub configuration file in Linux.

boot-(1)

Boot options before change

Now, this is what your device’s boot screen looks like before changing the boot options. You can observe the boot options given and their order. (Remember this options given are using zero-based indexing i.e Boot option ‘Ubuntu’ is boot option ‘0’).

Steps to change boot options on Linux:

Follow the given steps to change boot options on your device.

Step 1: Open Terminal in Linux

Boot into your Linux partition and click on show applications and then search for terminal. Once you see this terminal icon, click on that and open terminal which is a command line tool using which we will interact with the Operating System. We will be executing our commands needed to change boot options on this terminal.

linux-terminal

Terminal Icon

Step 2: Open Grub boot-loader configuration

GRUB is the default boot loader for most of the linux distributions. It atomically becomes the default boot-loader once it get installed. To access the GRUB boot config file, you have to enter the superuser mode, for that we will use sudo, which will grant some privileges to access system resources and change things which are not allowed to a normal user. you can learn more about ‘sudo’ command in linux here. Now run the following command in terminal to open the config file in nano editor ( a command-line text editor in linux).

sudo nano /etc/default/grub

Enter your user password and it will open the desired file in nano editor.

Command to open grub config. file in nano editor

Command to open grub config. file in nano editor

Step 3: Change boot configuration

You can observe that GRUB_DEFAULT is set to 0 which is Ubuntu as it is following zero-based indexing. GRUB_TIMEOUT = 10 indicating that boot menu will give 10 sec to toggle between boot options after which computer will boot into default OS which is Ubuntu in this case.

Grub-config-before-change

Grub config file before change

Change GRUB_DEFAULT = 2 to make windows as default (Observe the default boot menu you will see windows option was at number 3, which is no 2 in zero-based indexing). You can also write down the name of boot option in this place to change your boot option. You can also change the time given to choose OS in the boot menu by changing the GRUB_TIMEOUT value , which is set to 10 by default. Let’s change it to 5.

Grub-config-file-after-change

Grub config file after change

Step 4: Save the changes and update Grub

Press Ctrl + O to save the changes in file “/boot/grub/grub.cfg.” and then press Ctrl+X to exit the nano editor.
Once you are back in the terminal, run the following command to update the boot menu and execute the changes made.

sudo update-grub

updating changes made in grub config

Step 5: Restart your Computer and see the changes

Once you have completed the above steps, restart your computer and wait until the boot menu appears, and you should be able to see changes in your boot options. Now the windows partition will be the one to boot by default and menu will disappear in 5 sec.

bootmenu-after-change

Boot menu after changes

Now, you have successfully changed the boot options in your computer, you can change the options in case of multiple boot-able partitions available in your computer. Follow the zero-based indexing and you are good to go.

FAQs on How to change boot options on Linux

1. Is it possible to change boot options on Linux?

Yes, it is possible to change the boot options on Linux, by accessing the grub config file and changing the values in GRUB_DEFAULT . Follow the steps given in this article to change boot options on Linux.

2.Can we use any other editor to open the configuration file?

Yes, you can use other editors like ‘Vim’ instead of using ‘nano’ , mention the editor name before opening the file and use the editor to change the required.

3.How to increase the boot menu time-out duration?

Use terminal in superuser mode and open grub config file and change GRUB_TIMEOUT value in seconds as per your requirement.

4. What is boot-loader is Linux?

Boot loader is the program that helps in starting the Operating system by loading the /boot files into the main memory along with other necessary file and checks.

5. Do I need to install GRUB Boot loader in my computer?

There is no need if one of your installed OS is Linux. All popular linux distributions like mint, Ubuntu uses GRUB as their default boot loader. Once grub is available in your system, it becomes the default Boot-loader on it’s own. Otherwise you can get the Grub boot-loader installed from PPA Repository.

Conclusion

In this article we discussed how to change boot options and default settings in the boot menu. It addresses the challenges faced by users with multiple operating systems, such as a Windows-Linux dual-boot setup. The article provides a step-by-step guide on changing boot options in Linux by accessing the GRUB configuration file. Users are instructed to open the terminal, modify the configuration, save changes, and update the boot menu. The article concludes with frequently asked questions, offering additional insights into customizing boot options. This concise guide serves as a valuable resource for Linux users looking to optimize their system configurations.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads