The GRUB2 boot loader can seem confusing at first. Instead of one configuration file, there are several. You run one command
update-grub to update the configuration file, another command (
grub-install) to write the configuration to the Master Boot Record (MBR) on your hard drive.
On the plus side, GRUB2 can make life much easier if you're running a dual or multiple boot system -- say, switching between Linux and Windows, or hopping between multiple distros.
update-grub scans your partitions, automatically detects operating systems, and adds them to the configuration. Yet, the choice of which OS to boot by default remains stupid: in Ubuntu 10.04, the menu highlights the first operating system listed (usually the latest kernel installed by Synaptic or Update Manager). If you don't select another one within 10 seconds, the Ubuntu OS will boot with that kernel. I think most users want a "sticky" menu selection that boots the very last OS they chose. If you were running Windows XP last night, that's probably what you want to boot this morning.
It's very easy to make GRUB2 remember your last OS choice. First, edit the file
/etc/default/grub.cfg. Change the
GRUB_DEFAULT line and add a new line,
#GRUB_DEFAULT=0 GRUB_DEFAULT=saved GRUB_SAVEDEFAULT=true
Then run the two usual commands to update the configuration file
/boot/grub/grub.cfg and write it to the MBR:
sudo update-grub sudo grub-install /dev/sda1
This post was originally published on my other blog, https://tech.surveypoint.com