Editing the default boot item in grub menu, a definitive answer?
The definitive guide is the community wiki (link below).
But in summary - GRUB_DEFAULT
takes either a numeric or a string value. Numeric values reflect the boot order options (menu entry values) described in /boot/grub/grub.cfg
For example - in my grub my GRUB_DEFAULT value is set to the value 6 (six):
If you look at /boot/grub/grub.cfg
and count the lines starting with the the text menuentry where the first entry is zero, the second is one and so on you'll see that the value of six corresponds to what you see in the grub screen.
N.B. I've truncated the file to just show lines starting with the text menuentry
Setting by a string value is useful if you want to make windows the default boot.
You only make changes to GRUB_DEFAULT
in the file /etc/default/grub
In both cases - run sudo update-grub
to regenerate the file /boot/grub/grub.cfg
- this is the file that grub itself uses but you should not change yourself.
Linked Question:
- How do I set Windows to boot as the default in the boot loader?
- https://help.ubuntu.com/community/Grub2