GRUB – configuration
Welcome to the tutorial guide. The tutorial will provide a user with guidance and instructions on how to configure GRUB.
A user will note that several commands have to be typed to boot the Operating System. GRUB provides a menu interface from which a user can select an item (using arrow keys) that will do everything to boot an Operating System.
If a user wants to enable the menu, then he/she will need a configuration file, menu.lst under the boot directory. An example will help regarding this. As a user will be aware that the file first contains some general settings, the menu interface related options. A user can put the commands before any of the items (starting with title).
#
# Sample boot menu configuration file
#
As user should note that these lines are comments and the lines starting with a hash character (`#’), and blank lines, are ignored by GRUB.
# By default, boot the first entry.
default 0
The first entry where counting starts with number zero is the default choice.
# Boot automatically after 30 secs.
timeout 30
According to the comment, it is easy to understand that GRUB will boot automatically in 30 seconds, unless interrupted with a keypress.
# Fallback to the second entry.
fallback 1
If, for any reason, the default entry doesn’t work, a user can fall back to the second one.
If a user wants to have a look at the actual OS definitions, then he/she will note that each entry begins with a special command, title, and the action is described after it. A user will also note that there is no command boot at the end of each item. That is because GRUB automatically executes boot if it loads other commands successfully.
The argument for the command title is used to display a short title/description of the entry in the menu. Since title displays the argument as is, a user can write basically anything there.
# For booting GNU/Hurd
title GNU/Hurd
root (hd0,0)
kernel /boot/gnumach.gz root=hd0s1
module /boot/serverboot.gz
This boots GNU/Hurd from the first hard disk.
# For booting GNU/Linux
title GNU/Linux
kernel (hd1,0)/vmlinuz root=/dev/hdb1
This boots GNU/Linux, but from the second hard disk.
# For booting Mach (getting kernel from floppy)
title Utah Mach4 multiboot
root (hd0,2)
pause Insert the diskette now^G!!
kernel (fd0)/boot/kernel root=hd0s3
module (fd0)/boot/bootstrap
Please note that this boots Mach with a kernel on a floppy, but the root filesystem at hd0s3. It also contains a pause line, which will cause GRUB to display a prompt and delay, before actually executing the rest of the commands and booting.
# For booting FreeBSD
title FreeBSD
root (hd0,2,a)
kernel /boot/loader
This item will boot FreeBSD kernel loaded from the `a’ partition of the third PC slice of the first hard disk.
# For booting OS/2
title OS/2
root (hd0,1)
makeactive
# chainload OS/2 bootloader from the first sector
chainloader +1
# This is similar to “chainload”, but loads a specific file
#chainloader /boot/chain.os2
This will boot OS/2, using a chain-loader.
# For booting Windows NT or Windows95
title Windows NT / Windows 95 boot menu
root (hd0,0)
makeactive
chainloader +1
# For loading DOS if Windows NT is installed
# chainload /bootsect.dos
The same as the above, but for Windows.
# For installing GRUB into the hard disk
title Install GRUB into the hard disk
root (hd0,0)
setup (hd0)
This will reinstall GRUB onto the hard disk.
# Change the colors.
title Change the colors
color light-green/brown blink-red/blue
Please note that in the last entry, the command color is used. The reason for using this is to change the menu colors. This command holds importance because it can be used both in the command-line and in the menu. A user will also note that GRUB has several such commands.
If a user followed this tutorial guide then he/she will understand the GRUB configuration.













