Change the Default Grub2 Order

Without needing any additional software, the grub boot order can be edited via command line.

Changing the boot order won’t modify the OS list, but will set a different OS to booy by default.

Before you modify the /etc/default/grub file, create a backup:

$ sudo cp /etc/default/grub{,.bak}

To modify the boot order, edit the /etc/default/grub file, with root priviledges:

$ sudo vim /etc/default/grub

Find the line: GRUB_DEFAULT=0.

0 (zero) represents the first OS in the list, 1 represents the second OS in the list, … 4 represents the fifth OS in the list. Replace the number written after GRUB_DEFAULT= with the number representing your desired OS.

To apply the changes, update the grub menu:

$ sudo update-grub

The update-grub command updates the /boot/grub/grub.cfg file.

Tagged with: , , , , ,
Posted in The Linux and Unix Articles!
One comment on “Change the Default Grub2 Order
  1. Joefay says:

    This is great, other option:

    sudo gedit /etc/default/grub

    sudo update-grub

Leave a Reply

Your email address will not be published. Required fields are marked *




Subscribe to get the latest Linux news and how to guides directly on your e-mail!