Saturday, October 13, 2007

Editing GRUB

===GRUB===
[[#Default OS|Default OS]]

[[#Timeout|Timeout]]

[[#HiddenMenu|HiddenMenu]]

[[#Title|Tiitle]]

[[#Graphical Boot|Graphical Boot]]

=====Default OS=====
The default GRUB boot loader configuration gives a timeout of 5 seconds and hides the menu from the user, booting the default operating system. If you need to make changes to this configuration you need to edit the file /boot/grub/menu.lst. To do that, open a terminal as root and type
gedit /boot/grub/menu.lst
The first line
default=0
is the line that determines the default operating system that will be loaded if there is no user interaction. If you boot more than one operation system, as I do, you may want to change this behavior. Here's an example of one of my GRUB menus.
default=2
timeout=30
splashimage=(hd0,5)/boot/grub/splash.xpm.gz
title Fedora7
root (hd0,5)
kernel /boot/vmlinuz-2.6.21-1.3228.fc7 ro root=LABEL=/1 vga=788
initrd /boot/initrd-2.6.21-1.3228.fc7.img
title Fedora Core 6
root (hd0,4)
kernel /boot/vmlinuz-2.6.20-1.2962.fc6 ro root=LABEL=/ vga=788
initrd /boot/initrd-2.6.20-1.2962.fc6.img
title Windows Vista Home Premium
rootnoverify (hd0,1)
chainloader +1
I changed the default to 2 since this is my laptop and it's a family machine. I'm not the only one using it and the others prefer Windows. If I wanted to boot the newest Fedora 7 kernel that is installed I would simple change default=2 to default=0. Changyoue this to suit your needs.

=====Timeout=====
The second line in the /boot/grub/menu.lst file is timeout=x, where x is a number that corresponds to the time in seconds that the menu will wait for user interaction before booting the default operating system. I prefer a timeout of 30 seconds. To change the timeout open a termial as root and type
gedit /boot/grub/menu.lst
Change the line
timeout=5
to
timeout=30 (or whatever you like)
Save the file and close the editor. Then next time you boot your system the timeout will be set to 30 seconds instead of 5 seconds.

=====HiddenMenu=====
HiddenMenu is just that. It's a function that hides the boot menu and counts down the timeout to boot the default operating system. You can press the key during this timeout and the menu will be revealed. This also stops the timeout. The menu will now wait infinitely. If you don't want this feature simply delete the hiddenmenu line completely or comment it out, like this
#hiddenmenu

=====Title=====
The title is what the operating system will be seen as. In my above example, title Fedora 7, means that GRUB will display Fedora 7 as the title of the operating system. I could call it anything I like. It has no effect on the operation of GRUB itself.

=====Graphical Boot=====
At the end of the kernel line
kernel /boot/vmlinuz-2.6.21-1.3228.fc7 ro root=LABEL=/1 rhgb
the rhgb option allows for the graphical boot screen. Some people, myself included, prefer to see what's going on throughout the boot sequence. You can safely remove this part of the kernel line and you will see the boot sequence in all it's glory. You can also replace it with something like vga=788. This gives the same effect as removing the rhgb statement but with a slightly higher resolution.

The G.R.U.B. manual can be found [http://www.gnu.org/software/grub/manual/ here].

Return to [[Fedora 7]]

No comments: