Next: , Previous: Invoking grub-terminfo, Up: Top


19 Invoking grub-set-default

The program grub-set-default sets the default boot entry for GRUB. This automatically creates a file named default under your GRUB directory (i.e. /boot/grub), if it is not present. This file is used to determine the default boot entry when GRUB boots up your system when you use `default saved' in your configuration file (see default), and to save next default boot entry when you use `savedefault' in a boot entry (see savedefault).

grub-set-default accepts the following options:

--help
Print a summary of the command-line options and exit.
--version
Print the version information and exit.
--root-directory=dir
Use the directory dir instead of the root directory (i.e. /) to define the location of the default file. This is useful when you mount a disk which is used for another system.

You must specify a single argument to grub-set-default. This argument is normally the number of a default boot entry. For example, if you have this configuration file:

     default saved
     timeout 10
     
     title GNU/Hurd
     root (hd0,0)
     ...
     
     title GNU/Linux
     root (hd0,1)
     ...

and if you want to set the next default boot entry to GNU/Linux, you may execute this command:

     grub-set-default 1

Because the entry for GNU/Linux is `1'. Note that entries are counted from zero. So, if you want to specify GNU/Hurd here, then you should specify `0'.

This feature is very useful if you want to test a new kernel or to make your system quite robust. See Making your system robust, for more hints about how to set up a robust system.