Modifying the GRUB Menu !

Everyone including me uses the term GRUB but when its expansion was asked in my viva voce, I started blinking for the answer so first for its expansion :

GRUB is GRand Unified Bootloader

Now for the content ‘Changing the default timeout time and default OS to boot in GRUB‘ :

  1. Open a Terminal.See Step 11 before continuing.
  2. Type the following line in the terminal
  3. $ sudo gedit /boot/grub/menu.lst

  4. It would prompt you to enter the root password.After you enter the correct password the file ‘menu.lst’ would be opened in gedit.DO NOT CLOSE THE TERMINAL HERE.If the terminal is closed, gedit would also exit.
  5. The file would contain the actual values for variables and also description of them along with some example configuration.The lines of the latter would be prefixed by a # (hash) to specify they are comments just for the sake of user.
  6. Look for something like ‘ default        0 ‘ (not prefixed by #) . This is the default OS to boot after loading the GRUB. 0 indicates that it should boot the first OS in the list (0 denotes first item,1 the second and so on.Like array indexing).
  7. Scroll down further to see the list.My list looks like :
  8. title        Ubuntu 8.04, kernel 2.6.24-16-generic
    root        (hd0,5)
    kernel        /boot/vmlinuz-2.6.24-16-generic root=UUID=8c6e88d3-244d-4811-9c82-9f1120bd9c4c ro quiet splash
    initrd        /boot/initrd.img-2.6.24-16-generic

    title        Ubuntu 8.04, kernel 2.6.24-16-generic (recovery mode)
    root        (hd0,5)
    kernel        /boot/vmlinuz-2.6.24-16-generic root=UUID=8c6e88d3-244d-4811-9c82-9f1120bd9c4c ro single
    initrd        /boot/initrd.img-2.6.24-16-generic

    title        Ubuntu 8.04, memtest86+
    root        (hd0,5)
    kernel        /boot/memtest86+.bin


    # This is a divider, added to separate the menu items below from the Debian
    # ones.
    title        Other operating systems:

    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/sda1
    title        Windows Vista/Longhorn (loader)
    root        (hd0,0)
    chainloader    +1

  9. According my list, my ‘0’ corresponds to ‘Ubuntu 8.04, kernel 2.6.24-16-generic’, ‘1’ to ‘Ubuntu 8.04, kernel 2.6.24-16-generic (recovery mode)’, ‘2’ to ‘Ubuntu 8.04, memtest86+’, ‘3’ to ‘Other operating systems:’ (Here I would like to say something , this ‘3’ is not an OS but an Menu Separator but it still counts as one of the item in the list.) and finally ‘4’ to ‘Windows Vista/Longhorn (loader)’
  10. My ‘ default        0 ‘ will boot my ‘Ubuntu 8.04, kernel 2.6.24-16-generic’ by default.Change it to any valid item you want to change the default OS on boot.Eg: ‘ default       4 ‘ will boot ‘Windows Vista/Longhorn (loader)’ by default.
  11. Scroll Up the file and look for something like ‘ timeout        10 ‘.This indicates the amount of idle time that GRUB should wait before booting the default OS.Here ’10’ indicates 10sec.Change it to any value according to your convenience.Eg: ‘ timeout        5 ‘ will change it to 5sec.
  12. Save the file and close gedit and then the terminal.Reboot to see the changes.
  13. For safety reason it is useful to take a backup of the actual ‘menu.lst’ file before you do any experimenting on it.Issue a
  14. cp /boot/grub/menu.lst /boot/grub/menu.lst.bck

    before you do any changes.


~ by toolweb on May 11, 2008.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: