Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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
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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .