How to Change Boot Order on Linux

After setting up a dual-boot system, the secondary OS often becomes the default boot option. That’s just one common scenario, but regardless of the exact reasoning, configuring the boot options in Linux is pretty easy.

Linux distros use the GRUB boot loader. As such, you can edit the GRUB config file to set a specific boot entry as the default one. For UEFI systems specifically, the efibootmgr tool works as well.

Or, if you don’t need a Linux-specific solution, you can also change the boot order via the BIOS/UEFI. We’ve covered all these methods with full steps in this article.

Ways to Change Boot Order

The steps covered were tested on Ubuntu, but they’re applicable to most other distros as well. The only thing that might slightly differ is the location of the GRUB config file.

Edit GRUB Config File

You can change the default boot entry on Linux systems by editing the GRUB configuration file. There are various GRUB config files but the one at /etc/default/grub is used for user customization.

Before you begin, you can either use the cat /boot/grub/grub.cfg | grep menuentry command or check the current order of GRUB menu entries when booting.

gnu-grub-menu-entries

The menu items are zero-indexed, so the first entry is represented by 0, the second entry is 1, the third is 2, and so on.

1- Start by creating a backup of the config file with the following command:
sudo cp /etc/default/grub /etc/default/grub.bak

2- Now, open the config file with a text editor. We’ll use nano.
sudo nano /etc/default/grub

3- Change the value of the GRUB_DEFAULT line according to your current boot menu order. Setting it to 0 will set the first entry on the list as the default, 1 will set the second entry as the default, and so on.

See also  How to Install Loupe Image Viewer on Ubuntu: A Step-by-Step Guide for Efficient Image Management

4- Press CTRL + O, then Enter to write out the changes to the config file.

5- Then, press CTRL + X to exit nano.

6- Finally, update GRUB with sudo update-grub.

Use EFI Boot Manager

While we only changed the default boot entry with the previous method, the efibootmgr tool allows you to actually change the boot order. As stated, this method won’t for Legacy BIOS systems. But on UEFI systems, you can use the efibootmgr tool as such:

1- First, enter efibootmgr and check the current boot order.

2- Use the -o flag to change the boot order as such:
sudo efibootmgr -o <order>

3- In our dual-boot system shown above, we set the order so that the boot manager tries booting from removable drives first. If that doesn’t work, it’ll instead boot from Ubuntu.

Change via BIOS/UEFI

In a Windows-Linux dual-boot, if the boot order in the BIOS/UEFI is set to prioritize the Windows Boot Manager, it will run before the GRUB bootloader. As such, GRUB’s boot order would be irrelevant. In such cases, you can access the firmware interface and change the boot order as such:

1- When booting, press the BIOS setup key shown on the screen (Function keys or Del).

2- On systems with Fast Boot enabled, you might not have enough time to see and press this key. In such cases, you can bring up the GRUB menu first.
With BIOS, press and hold Shift. With UEFI, press Esc a few times when booting. Then, select the Firmware Settings option in the GRUB menu.

See also  Rymdport: Securely Share Your Files with Another Wormhole Client

3- Go to the Boot tab and change the boot order here so that the Linux installation is placed higher than the Windows Boot Manager.

4- Press the key shown on the screen (usually F10) to save the changes and exit.

Now, the GRUB bootloader should start by default when booting. If you want to make changes to the GRUB menu entries, you can check the steps from the first method.

Did you like this article? Do not hesitate to share it on social networks and subscribe to Tech To Geek on Google News or our facebook page to not miss any articles!
5/5 - (1 vote)
"Because of the Google update, I, like many other blogs, lost a lot of traffic."

Join the Newsletter

Please, subscribe to get our latest content by email.

Mohamed SAKHRI

I am Mohamed SAKHRI, the creator and editor-in-chief of Tech To Geek, where I've demonstrated my passion for technology through extensive blogging. My expertise spans various operating systems, including Windows, Linux, macOS, and Android, with a focus on providing practical and valuable guides. Additionally, I delve into WordPress-related subjects. You can find more about me on my Linkedin!, Twitter!, Reddit Facebook

Leave a Comment