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.

Share and Enjoy

  • Twitter
  • Facebook
  • Google Plus
  • Email
  • RSS
Tagged with: , , , , ,
Posted in The Linux and Unix Articles!

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe

  

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