
82 Chapter 4. GRUB
to move to the beginning of a line, and [Ctrl]-[e] to move to the end of a line. In addition, the arrow,
[Home], [End], and [Delete] keys work as they do in the bash shell.
4.3.4. Order of Interface Use
When the GRUB environment starts loading the second stage boot loader, it looks for its configuration
file. When found, it uses the configuration file to build the menu list of operating systems to load and
then displays the boot menu interface.
If the configuration file cannot be found, or if the configuration file is unreadable, GRUB will load the
command line interface to allow users to manually type the commands necessary to boot an operating
system.
If the configuration file is not valid, GRUB will print out the error and ask for input. This can be
very helpful, because users will then be able to see precisely where the problem occurred and fix it
in the file. Pressing any key will reload the menu interface, where it is then possible to edit the menu
option and correct the problem based on the error reported by GRUB. If the correction fails, the error
is reported and GRUB will begin again.
4.4. Commands
GRUB contains a number of different commands that may be executed interactively in the command
line interface. Some of the commands accept options after their name, and these options should be
separated from the command and other options on that line by space characters.
The following list gives the most useful commands:
• boot — Boots the operating system or chain loader that has been previously specified and loaded.
• chainloader
file-name — Loads the specified file as a chain loader. To grab the file at the
first sector of the specified partition, use +1 as the file’s name.
• displaymem — Displays the current use of memory, based on information from the BIOS. This is
useful to determine how much RAM a system has prior to booting it.
• initrd
file-name — Enables users to specify an initial RAM disk to use when booting,
necessary when the kernel needs certain modules in order to boot properly.
• install
stage-1 install-disk stage-2 p config-file — Installs
GRUB to the system MBR. This allows the GRUB interfaces to come up when the system is re-
booted.
Warning
The install command will overwrite any other information in the MBR. If executed, any informa-
tion (other than GRUB information) that is used to boot other operating systems, will be lost.
Make sure to have the proper knowledge before executing this command.
This command can be configured in several different ways. However, it is required to specify a
stage-1 , which signifies a device, partition, and file where the first boot loader image can be
found, such as (hd0,0)/grub/stage1. In addition, specify the disk where the stage 1 boot loader
should be installed, such as (hd0).
The stage-2 section tells the stage 1 boot loader where the stage 2 boot loader is located, such
as (hd0,0)/grub/stage2. The p option tells the install command that a menu configuration
file is being specified in the config-file section, such as (hd0,0)/grub/grub.conf.
Commenti su questo manuale