Grub2 Default boot configuration on Ubuntu 9.10

GRUB 2 is the new default boot loader for Ubuntu 9.10. If you would like to change if your pc boots either Ubuntu or Windows by default you have to do the following:

Get an overview of menuentries in /boot/grub/grub.cfg

joerg@phenom:~$ grep “menuentry” /boot/grub/grub.cfg
menuentry “Ubuntu, Linux 2.6.31-20-generic-pae” {
menuentry “Ubuntu, Linux 2.6.31-20-generic-pae (recovery mode)” {
menuentry “Ubuntu, Linux 2.6.31-19-generic-pae” {
menuentry “Ubuntu, Linux 2.6.31-19-generic-pae (recovery mode)” {
menuentry “Ubuntu, Linux 2.6.31-17-generic-pae” {
menuentry “Ubuntu, Linux 2.6.31-17-generic-pae (recovery mode)” {
menuentry “Ubuntu, Linux 2.6.31-16-generic-pae” {
menuentry “Ubuntu, Linux 2.6.31-16-generic-pae (recovery mode)” {
menuentry “Memory test (memtest86+)” {
menuentry “Memory test (memtest86+, serial console 115200)” {
menuentry “Windows 7 (loader) (on /dev/sda1)” {
joerg@phenom:~$

The first entry should be used as the standard.

Edit /etc/default/grub

sudo emacs /etc/default/grub

Search for GRUB_DEFAULT and change it to 0

GRUB_DEFAULT=0

If you would like to use Windows 7 by default the parameter in this example is 10 instead.

Save the file and update the configuration with

joerg@phenom:~$ sudo update-grub
[sudo] password for joerg:
Generating grub.cfg …
Found linux image: /boot/vmlinuz-2.6.31-20-generic-pae
Found initrd image: /boot/initrd.img-2.6.31-20-generic-pae
Found linux image: /boot/vmlinuz-2.6.31-19-generic-pae
Found initrd image: /boot/initrd.img-2.6.31-19-generic-pae
Found linux image: /boot/vmlinuz-2.6.31-17-generic-pae
Found initrd image: /boot/initrd.img-2.6.31-17-generic-pae
Found linux image: /boot/vmlinuz-2.6.31-16-generic-pae
Found initrd image: /boot/initrd.img-2.6.31-16-generic-pae
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done
joerg@phenom:~$

Done.

Much more information about grub2 can be found here

Advertisements