next up previous contents
Next: 2.2.3.1.5 Creating a GRUB Up: 2.2.3.1 Introduction Previous: 2.2.3.1.3 Loading an operating   Contents

2.2.3.1.4 Configuration

You probably noticed that you need to type several commands to boot your OS. There's a solution to that - GRUB provides a menu interface from which you can select an item (using arrow keys) that will do everything to boot an OS.

To enable the menu, you need a configuration file, `grub.conf' under the boot directory. We'll analyze an example file.

The file first contains some general settings, the menu interface related options. You can put these commands before any of the items (starting with `title' ).

          #

          # Sample boot menu configuration file

          #

As you may have guessed, these lines are comments. Lines starting with a hash character (`#'), and blank lines, are ignored by GRUB.

          # By default, boot the first entry. default 0

The first entry (here, counting starts with number zero, not one!) will be the default choice.

          # Boot automatically after 30 secs. timeout 30

As the comment says, 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, fall back to the second one (this is rarely used, for obvious reasons).

Now, on to the actual OS definitions. You will see that each entry begins with a special command, `title', and the action is described after it. 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, you can write basically anything in there.

           # For booting Linux

           title Linux kernel (hd0,0)/vmlinuz root=/dev/hda1

This boots Linux from the first hard disk.

            # 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

This boots Windows.


next up previous contents
Next: 2.2.3.1.5 Creating a GRUB Up: 2.2.3.1 Introduction Previous: 2.2.3.1.3 Loading an operating   Contents