I ran into this immensely handy command for specifying which OS you want to boot into on your next boot. You simply run “grub-reboot” and specify the menu item (which can be found in /boot/grub/grub.cfg) you want to boot into.
For example, the following command will cause my computer to boot into windows on my next reboot. Note that it does not issue a reboot, it only pre-configures the behaviour for when I decide reboot.
sudo grub-reboot "Windows 7 (loader) (on /dev/sda3)"
What is awesome about this command is it does not modify your default menu item in grub. After one reboot, it will go back to the default. Very nifty.
Please note that this only works on distributions using Grub 2, and your grub configuration must be set to boot to the “saved” entry by default. In Ubuntu 10.10, this is accomplished by replacing the GRUB_DEFAULT line in /etc/default/grub with the following:
Any changes made to /etc/default/grub will need to be followed by running “update-grub”.