home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Linux in a NutshellLinux in a NutshellSearch this book

4.4. GRUB Commands

The following sections describe two sets of commands. Both can be used at the GRUB command line. In addition, the first set can be used in the global section of the menu, and the second can be used in individual menu entries. A few commands can be used only on the GRUB shell command line; this is noted in the command entry. The commands default, fallback, hiddenmenu, timeout, and title are available only in the configuration file, for use with the menu interface. They are described in Section 4.3.2.

When running commands, if you find that you aren't sure how to complete a pathname, you can use the Tab key to find the possible completions. For example:

grub> blocklist (hd0,1)/grub/[Tab]
Possible files are: grub.conf splash.xpm.gz menu.lst device.map stage1 
stage2 e2fs_stage1_5 fat_stage1_5 ffs_stage1_5 jfs_stage1_5 minix_stage1_5 
reiserfs_stage1_5 vstafs_stage1_5 xfs_stage1_5
grub> blocklist (hd0,1)/grub/stage2
(hd0,1)33306+24,33332+231

4.4.1. Command-Line and Global Menu Commands

The commands available at the command line and in the global section of the configuration file are as follows.

None

0

FAT 16, lt 32M

4

FAT 16, gt 32M

6

FAT 32

0xb

FAT 32, with LBA

0xc

WIN 95, extended

0xf

EXT2FS

0x83

Linux extended

0x85

Linux RAID

0xfd

FreeBSD

0xa5

OpenBSD

0xa6

NetBSD

0xfd

Key Value

Character

Key Value

Character

ampersand

&

asterisk

*

at

@

backquote

`

backslash

\

bar

|

braceleft

{

braceright

}

bracketleft

[

bracketright

]

caret

^

colon

:

comma

,

dollar

$

doublequote

"

equal

=

exclam

!

greater

>

less

<

minus

-

numbersign

#

parenleft

(

parenright

)

percent

%

period

.

plus

+

question

?

quote

`

semicolon

;

slash

/

space

tilde

~

underscore

_

4.4.2. Command-Line and Menu Entry Commands

The commands available at the command line and in the individual menu entries of the configuration file are as follows.

install

install [options] stage1_file [d] dest_dev stage2_file [addr] [p] 
[config_file] [real_config_file]

Perform a full GRUB install. See also the setup command, which acts as a frontend to install and is easier to use. The Stage 2 or Stage 1.5 file (both referred to as stage2_file here because they are loaded the same way) must be in its final install location (e.g., in the /boot/grub directory). install loads and validates stage1_file, installs a blocklist in the Stage 1 file for loading stage2_file as Stage 2 or Stage 1.5, and writes the completed Stage 1 file to the first block of the device dest_dev.

Options

--force-lba
If the BIOS has LBA support but might return the incorrect LBA bitmap (which sometimes happens), --force-lba forces install to ignore the incorrect bitmap.

--stage2=os_stage2_file
This option is required to specify the operating system name of the Stage 2 file if the filesystem where it is located cannot be unmounted.

Parameters

addr
Specify the address at which Stage 1 is to load Stage 2 or Stage 1.5. The possible values are 0x8000 for Stage 2 and 0x2000 for Stage 1.5. If omitted, GRUB determines the address automatically.

config_file
Specify the location of the configuration file for Stage 2.

d
Tell Stage 1 to look for the actual disk on which stage2_file was installed if it's not on the boot drive.

dest_dev
Specify the destination device. The final Stage 1 file is written to this device.

p
If present, the partition where stage2_file is located is written into the first block of Stage 2.

real_config_file
If stage2_file is really a Stage 1.5 file, real_config_file specifies the real configuration file name and is written into the Stage 2 configuration file.

stage1_file
Specify the Stage 1 file to be written.

stage2_file
Specify the file that Stage 1 is to load for Stage 2.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.