Pages

Modifying GRUB

If you have a dual boot in your system and you might want to modify the grub menu for some of these reasons
1. Change the default boot order
2. Make the grub menu wait for a shorter or longer duration
3.Hide the grub menu completely
etc.

If you are using grub legacy and not grub2 you can look at how to do any of the following.

In the grub legacy, all the grub related settings are in the file "grub.conf"  or "menu.lst" which in turn is placed in the folder /boot/grub.


To modify this file you need to be the superuser or "root". 


1. To change the OS that boots by default open the file menu.lst/grub.conf


Look for the following set of lines

 ## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default         0

the last line "default 0"  specifies as to which option of the grub menu is going to boot by default. The numbering starts from "0". Hence the first option in the grub menu would be numbered "0" the second would be numbered "1" and so on. 


To change the default OS to any of your choice, just change the number in front of the "default "  to which ever number that points to your desired OS. 





2. Make the grub menu wait for a shorter or longer duration

Look for the following lines in the grub.conf/menu.lst file. 

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout         10



The number in front of "timeout" in the last line specifies the number of seconds the grub menu waits for the user to make a choice before it starts booting the default OS. You can change it to make the grub wait longer or shorter. 



3.Hide the grub menu completely 

To not display the grub menu at all, unless you press the "esc" key look for the following lines in the grub.conf/menu.lst file.


## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu



 Remove the "#" before the last line ,and from the next boot the grub menu will not be visible. 


## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

No comments:

Post a Comment