It's quite easy to change the default boot entry through etc/default/grub. However, this only allows for the first entry to be changed. I want to be able to move all the entries in any order I like. What is the best/easiest way to do this?

link|improve this question

75% accept rate
Which version of grub is it? – Keith Jun 19 '11 at 3:21
It's grub2. I know grub is much easier to do this with. – Dennis Hodapp Jun 19 '11 at 3:33
Yep. For this and many other reasons I've decided grub2 is too ugly to live. I use syslinux/extlinux most of the time now. – Keith Jun 19 '11 at 3:36
feedback

1 Answer

up vote 1 down vote accepted

Changing the order of the menu is usually not a requirement,
If you do want to go there, you'd have to re-order the scripts in /etc/grub.d/

The placement of the menu items in the grub.cfg menu is determined by the order in which the files in this directory are run. Files with a leading numeral are executed first, beginning with the lowest number. 10_linux is run before 20_memtest, which would run before 40_custom. If files with alphabetic names exist, they are run after the numerically-named files.

Once you do these changes, executing "sudo update-grub" will re-generate your menu.

A 'dirtier' way would be to directly 'play' with the 'menuentry' items of /boot/grub/grub.cfg file.
This will give you full control on the order (re-ordering scripts will still force an order on entries generated within each script), but note that, these changes will be wiped off as soon as an update-grub happens again -- like, when your kernel updates. You will have to re-do the ordering in grub.cfg again after that.

IMHO, its not really worth messing with the menu at this 'dirtier' level.
You should find the script re-numbering sufficient for your purposes.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.