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.
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.
- Start by creating a backup of the config file with the following command:
sudo cp /etc/default/grub /etc/default/grub.bak
- Now, open the config file with a text editor. We’ll use nano.
sudo nano /etc/default/grub
- 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.
- Press CTRL + O, then Enter to write out the changes to the config file.
- Then, press CTRL + X to exit nano.
- 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:
- First, enter
efibootmgr
and check the current boot order. - Use the
-o
flag to change the boot order as such:sudo efibootmgr -o <order>
- 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:
- When booting, press the BIOS setup key shown on the screen (Function keys or Del).
- 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. - Go to the Boot tab and change the boot order here so that the Linux installation is placed higher than the Windows Boot Manager.
- 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.