[ Last edited by 不得不爱 on 2009-6-6 at 23:06 ]作者: wang6610 时间: 2006-7-26 06:51 标题: GRUB Command Index (EN)
Command Index:
background Sets the background color when in graphics mode.
blocklist Print the blocklist notation of the file FILE.
boot Boot the OS/chain-loader which has been loaded.
bootp Initialize a network device via BOOTP.
cat Print the contents of the file FILE.
chainloader Load the chain-loader FILE.
clear Clear the screen
cmp Compare the file FILE1 with the FILE2 and inform the different values if any.
color Change the menu colors.
configfile Load FILE as the configuration file.
debug Turn on/off the debug mode.
default Set the default entry to entry number NUM (if not specified, it is 0, the first entry) or the entry number saved by savedefault.
device Specify DEVICE as the actual drive for a BIOS drive DRIVE.
dhcp Initialize a network device via DHCP.
displayapm Display APM BIOS information.
displaymem Display what GRUB thinks the system address space map of the machine is, including all regions of physical RAM installed.
dump Dump the contents of the file FROM to the file TO.
embed Embed the Stage 1.5 STAGE1_5 in the sectors after MBR.
fallback Go into unattended boot mode.
find Search for the filename FILENAME in all of partitions and print the list of the devices which contain the file.
fontfile Specify the Chinese Font File.
foreground Sets the foreground color when in graphics mode.
fstest Toggle filesystem test mode.
geometry Print the information for a drive DRIVE.
gfxmenu Use the graphical menu from FILE.
halt Halt your system.
help Display helpful information about builtin commands.
hiddenmenu Hide the menu.
hide Hide PARTITION by setting the "hidden" bit in its partition type code.
ifconfig Configure the IP address, the netmask, the gateway and the server address or print current network configuration.
impsprobe Probe the Intel Multiprocessor Specification 1.1 or 1.4 configuration table and boot the various CPUs which are found into a tight loop.
initrd Load an initial ramdisk FILE for a Linux format boot image and set the appropriate parameters in the Linux setup area in memory.
install Install STAGE1 on DEVICE, and install a blocklist for loading STAGE2 as a Stage 2.
ioprobe Probe I/O ports used for the drive DRIVE.
kernel Attempt to load the primary boot image from FILE.
lock Break a command execution unless the user is authenticated.
makeactive Set the active partition on the root disk to GRUB's root device.
map Map the drive FROM_DRIVE to the drive TO_DRIVE.
md5crypt Generate a password in MD5 format.
module Load a boot module FILE for a Multiboot format boot image (no interpretation of the file contents is made, so users of this command must know what the kernel in question expects).
modulenounzip The same as 'module', except that automatic decompression is disabled.
pager Toggle pager mode with no argument.
partnew Create a primary partition at the starting address START with the length LEN, with the type TYPE.
parttype Change the type of the partition PART to TYPE.
password Set password.
pause Print MESSAGE, then wait until a key is pressed.
portmap Do portmap with the prog_number and vers_number
quit Exit from the GRUB shell.
rarp Initialize a network device via RARP.
read Read a 32-bit value from memory at address ADDR and display it in hex format.
reboot Reboot your system.
root Set root device.
rootnoverify Similar to `root', but don't attempt to mount the partition.
run Run a NO-Emul Boot Sector file for CD-ROM Boot
savedefault Save the current entry as the default boot entry.
scdrom Search the 1st CD-ROM Drive on the local system, then init a driver number(0xe0) for it(--install) -OR- boot system with this CD-ROM(--boot).
serial Initialize a serial device.
setkey Change the keyboard map.
setup Set up the installation of GRUB automatically.
splashimage Load FILE as the background image when in graphics mode.
terminal Select a terminal.
terminfo Define the capabilities of your terminal.
testload Read the entire contents of FILE in several different ways and compares them, to test the filesystem code.
testvbe Test the VBE mode MODE. Hit any key to return.
tftpserver Override the TFTP server address.
timeout Set a timeout, in SEC seconds, before automatically booting the default entry (normally the first entry defined).
title Start a new boot entry, and set its name to the contents of the rest of the line, starting with the first non-space character.
unhide Unhide PARTITION by clearing the "hidden" bit in its partition type code.
uppermem Force GRUB to assume that only KBYTES kilobytes of upper memory are installed.
vbeprobe Probe VBE information.
blocklist
Usage: blocklist FILE
Description:
Print the blocklist notation of the file FILE.
--------------------------------------------------------------------------------
boot
Usage: boot
Description:
Boot the OS/chain-loader which has been loaded.
--------------------------------------------------------------------------------
bootp
Usage: bootp [--with-configfile]
Description:
Initialize a network device via BOOTP.If the option `--with-configfile' is given, try to load a configuration file specified by the 150 vendor tag.
cat
Usage: cat FILE
Description:
Print the contents of the file FILE.
--------------------------------------------------------------------------------
chainloader
Usage: chainloader [--force] FILE
Description:
Load the chain-loader FILE. If --force is specified, then load it forcibly, whether the boot loader signature is present or not.
cmp
Usage: cmp FILE1 FILE2
Description:
Compare the file FILE1 with the FILE2 and inform the different values if any.
--------------------------------------------------------------------------------
color
Usage: color NORMAL [HIGHLIGHT]
Description:
Change the menu colors.The color NORMAL is used for most lines in the menu, and the color HIGHLIGHT is used to highlight the line where the cursor points. If you omit HIGHLIGHT, then the inverted color of NORMAL is used for the highlighted line. The format of a color is "FG/BG". FG and BG are symbolic color names. A symbolic color name must be one of these: black, blue, green, cyan, red, magenta, brown, light-gray, dark-gray, light-blue, light-green, light-cyan, light-red, light-magenta, yellow and white. But only the first eight names can be used for BG. You can prefix "blink" to FG if you want a blinking foreground color.
configfile
Usage: configfile FILE
Description:
Load FILE as the configuration file.
--------------------------------------------------------------------------------
debug
Usage: debug
Description:
Turn on/off the debug mode.
--------------------------------------------------------------------------------
default
Usage: default [NUM | `saved']
Description:
Set the default entry to entry number NUM (if not specified, it is 0, the first entry) or the entry number saved by savedefault.
--------------------------------------------------------------------------------
device
Usage: device DRIVE DEVICE
Description:
Specify DEVICE as the actual drive for a BIOS drive DRIVE.This command can be used only in the grub shell.
portmap
Usage: portmap prog_number vers_number
Description:
Do portmap with the prog_number and vers_number
--------------------------------------------------------------------------------
dhcp
Usage: dhcp
Description:
Initialize a network device via DHCP.
--------------------------------------------------------------------------------
splashimage
Usage: splashimage FILE
Description:
Load FILE as the background image when in graphics mode.
--------------------------------------------------------------------------------
foreground
Usage: foreground RRGGBB
Description:
Sets the foreground color when in graphics mode.RR is red, GG is green, and BB blue. Numbers must be in hexadecimal
background
Usage: background RRGGBB
Description:
Sets the background color when in graphics mode.RR is red, GG is green, and BB blue. Numbers must be in hexadecimal.
displaymem
Usage: displaymem
Description:
Display what GRUB thinks the system address space map of the machine is, including all regions of physical RAM installed.
--------------------------------------------------------------------------------
dump
Usage: dump FROM TO
Description:
Dump the contents of the file FROM to the file TO.FROM must be a GRUB file and TO must be an OS file.
embed
Usage: embed STAGE1_5 DEVICE
Description:
Embed the Stage 1.5 STAGE1_5 in the sectors after MBR.If DEVICE is a drive, or in the "bootloader" area if DEVICE is a FFS partition. Print the number of sectors which STAGE1_5 occupies if successful.
fallback
Usage: fallback NUM
Description:
Go into unattended boot mode.If the default boot entry has any errors, instead of waiting for the user to do anything, it immediately starts over using the NUM entry (same numbering as the `default' command). This obviously won't help if the machine was rebooted by a kernel that GRUB loaded.
find
Usage: find [--set-root] FILENAME
Description:
Search for the filename FILENAME in all of partitions and print the list of the devices which contain the file.
--------------------------------------------------------------------------------
fstest
Usage: fstest
Description:
Toggle filesystem test mode.
--------------------------------------------------------------------------------
gfxmenu
Usage: gfxmenu FILE
Description:
Use the graphical menu from FILE.
--------------------------------------------------------------------------------
geometry
Usage: geometry DRIVE [CYLINDER HEAD SECTOR [TOTAL_SECTOR]]
Description:
Print the information for a drive DRIVE.In the grub shell, you can set the geometry of the drive arbitrarily. The number of the cylinders, the one of the heads, the one of the sectors and the one of the total sectors are set to CYLINDER, HEAD, SECTOR and TOTAL_SECTOR, respectively. If you omit TOTAL_SECTOR, then it will be calculated based on the C/H/S values automatically.
halt
Usage: halt [--no-apm]
Description:
Halt your system.If APM is avaiable on it, turn off the power using the APM BIOS, unless you specify the option `--no-apm'.
help
Usage: help [--all] [PATTERN ...]
Description:
Display helpful information about builtin commands.Not all commands aren't shown without the option `--all'.
hiddenmenu
Usage: hiddenmenu
Description:
Hide the menu.
--------------------------------------------------------------------------------
hide
Usage: hide PARTITION
Description:
Hide PARTITION by setting the "hidden" bit in its partition type code.
--------------------------------------------------------------------------------
ifconfig
Usage: ifconfig [--address=IP] [--gateway=IP] [--mask=MASK] [--server=IP]
Description:
Configure the IP address, the netmask, the gateway and the server address or print current network configuration.
--------------------------------------------------------------------------------
impsprobe
Usage: impsprobe
Description:
Probe the Intel Multiprocessor Specification 1.1 or 1.4 configuration table and boot the various CPUs which are found into a tight loop.
--------------------------------------------------------------------------------
initrd
Usage: initrd FILE [ARG ...]
Description:
Load an initial ramdisk FILE for a Linux format boot image and set the appropriate parameters in the Linux setup area in memory.
--------------------------------------------------------------------------------
install
Usage: install [--stage2=STAGE2_FILE] [--force-lba] STAGE1 [d] DEVICE STAGE2 [ADDR] [p] [CONFIG_FILE] [REAL_CONFIG_FILE]
Description:
Install STAGE1 on DEVICE, and install a blocklist for loading STAGE2 as a Stage 2.If the option `d' is present, the Stage 1 will always look for the disk where STAGE2 was installed, rather than using the booting drive. The Stage 2 will be loaded at address ADDR, which will be determined automatically if you don't specify it. If the option `p' or CONFIG_FILE is present, then the first block of Stage 2 is patched with new values of the partition and name of the configuration file used by the true Stage 2 (for a Stage 1.5, this is the name of the true Stage 2) at boot time. If STAGE2 is a Stage 1.5 and REAL_CONFIG_FILE is present, then the Stage 2 CONFIG_FILE is patched with the configuration filename REAL_CONFIG_FILE. If the option `--force-lba' is specified, disable some sanity checks for LBA mode. If the option `--stage2' is specified, rewrite the Stage 2 via your OS's filesystem instead of the raw device.
ioprobe
Usage: ioprobe DRIVE
Description:
Probe I/O ports used for the drive DRIVE.
--------------------------------------------------------------------------------
kernel
Usage: kernel [--no-mem-option] [--type=TYPE] FILE [ARG ...]
Description:
Attempt to load the primary boot image from FILE.The rest of the line is passed verbatim as the "kernel command line". Any modules must be reloaded after using this command. The option --type is used to suggest what type of kernel to be loaded. TYPE must be either of "netbsd", "freebsd", "openbsd", "linux", "biglinux" and "multiboot". The option --no-mem-option tells GRUB not to pass a Linux's mem option automatically.
lock
Usage: lock
Description:
Break a command execution unless the user is authenticated.
--------------------------------------------------------------------------------
makeactive
Usage: makeactive
Description:
Set the active partition on the root disk to GRUB's root device.This command is limited to _primary_ PC partitions on a hard disk.
map
Usage: map [--status] [--hook] [--unhook] [--rehook] [[--read-only] [--fake-write] [--unsafe-boot] [--disable-chs-mode] [--disable-lba-mode] [--heads-per-cylinder=H] [--sectors-per-track=S] TO_DRIVE FROM_DRIVE]
Description:
Map the drive FROM_DRIVE to the drive TO_DRIVE.This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive. TO_DRIVE can be a disk file, this indicates a disk emulation. If TO_DRIVE is a disk file, it must be contiguous(i.e., no holes in it). If --read-only is given, the emulated drive will be write-protected. If --fake-write is given, any write operations to the emulated drive are allowed but the data written will be ignored. The --unsafe-boot switch enables the write to the Master and DOS boot sectors of the emulated disk. If --disable-chs-mode is given, CHS access to the emulated drive will be refused. If --disable-lba-mode is given, LBA access to the emulated drive will be refused. H and S specify the geometry of the emulated drive. If --status, --hook, --unhook or --rehook is given, then any other command-line arguments will be ignored. They either report or change the int13 status.
md5crypt
Usage: md5crypt
Description:
Generate a password in MD5 format.
--------------------------------------------------------------------------------
module
Usage: module FILE [ARG ...]
Description:
Load a boot module FILE for a Multiboot format boot image (no interpretation of the file contents is made, so users of this command must know what the kernel in question expects).The rest of the line is passed as the "module command line", like the `kernel' command.
modulenounzip
Usage: modulenounzip FILE [ARG ...]
Description:
The same as 'module', except that automatic decompression is disabled.
--------------------------------------------------------------------------------
pager
Usage: pager [FLAG]
Description:
Toggle pager mode with no argument.If FLAG is given and its value is `on', turn on the mode. If FLAG is `off', turn off the mode.
partnew
Usage: partnew PART TYPE START LEN
Description:
Create a primary partition at the starting address START with the length LEN, with the type TYPE.START and LEN are in sector units.
parttype
Usage: parttype PART TYPE
Description:
Change the type of the partition PART to TYPE.
--------------------------------------------------------------------------------
password
Usage: password [--md5] PASSWD [FILE]
Description:
Set password.If used in the first section of a menu file, disable all interactive editing control (menu entry editor and command line). If the password PASSWD is entered, it loads the FILE as a new config file and restarts the GRUB Stage 2. If you omit the argument FILE, then GRUB just unlocks privileged instructions. You can also use it in the script section, in which case it will ask for the password, before continueing. The option --md5 tells GRUB that PASSWD is encrypted with md5crypt.
pause
Usage: pause [MESSAGE ...]
Description:
Print MESSAGE, then wait until a key is pressed.
--------------------------------------------------------------------------------
quit
Usage: quit
Description:
Exit from the GRUB shell.
--------------------------------------------------------------------------------
rarp
Usage: rarp
Description:
Initialize a network device via RARP.
--------------------------------------------------------------------------------
read
Usage: read ADDR
Description:
Read a 32-bit value from memory at address ADDR and display it in hex format.
--------------------------------------------------------------------------------
reboot
Usage: reboot
Description:
Reboot your system.
--------------------------------------------------------------------------------
fontfile
Usage: fontfile FILE
Description:
Specify the Chinese Font File.If you want display chinese character, please run splashimage command later.
scdrom
Usage: scdrom [--install], [--bootcd]
Description:
Search the 1st CD-ROM Drive on the local system, then init a driver number(0xe0) for it(--install) -OR- boot system with this CD-ROM(--boot).
--------------------------------------------------------------------------------
run
Usage: run FILE
Description:
Run a NO-Emul Boot Sector file for CD-ROM Boot
--------------------------------------------------------------------------------
root
Usage: root [DEVICE [HDBIAS]]
Description:
Set root device.Set the current "root device" to the device DEVICE, then attempt to mount it to get the partition size (for passing the partition descriptor in `ES:ESI', used by some chain-loaded bootloaders), the BSD drive-type (for booting BSD kernels using their native boot format), and correctly determine the PC partition where a BSD sub-partition is located. The optional HDBIAS parameter is a number to tell a BSD kernel how many BIOS drive numbers are on controllers before the current one. For example, if there is an IDE disk and a SCSI disk, and your FreeBSD root partition is on the SCSI disk, then use a `1' for HDBIAS.
rootnoverify
Usage: rootnoverify [DEVICE [HDBIAS]]
Description:
Similar to `root', but don't attempt to mount the partition.This is useful for when an OS is outside of the area of the disk that GRUB can read, but setting the correct root device is still desired. Note that the items mentioned in `root' which derived from attempting the mount will NOT work correctly.
savedefault
Usage: savedefault
Description:
Save the current entry as the default boot entry.
--------------------------------------------------------------------------------
serial
Usage: serial [--unit=UNIT] [--port=PORT] [--speed=SPEED] [--word=WORD] [--parity=PARITY] [--stop=STOP] [--device=DEV]
Description:
Initialize a serial device.UNIT is a digit that specifies which serial device is used (e.g. 0 == COM1). If you need to specify the port number, set it by --port. SPEED is the DTE-DTE speed. WORD is the word length, PARITY is the type of parity, which is one of `no', `odd' and `even'. STOP is the length of stop bit(s). The option --device can be used only in the grub shell, which specifies the file name of a tty device. The default values are COM1, 9600, 8N1.
setkey
Usage: setkey [TO_KEY FROM_KEY]
Description:
Change the keyboard map.The key FROM_KEY is mapped to the key TO_KEY. A key must be an alphabet, a digit, or one of these: escape, exclam, at, numbersign, dollar, percent, caret, ampersand, asterisk, parenleft, parenright, minus, underscore, equal, plus, backspace, tab, bracketleft, braceleft, bracketright, braceright, enter, control, semicolon, colon, quote, doublequote, backquote, tilde, shift, backslash, bar, comma, less, period, greater, slash, question, alt, space, capslock, FX (X is a digit), and delete. If no argument is specified, reset key mappings.
setup
Usage: setup [--prefix=DIR] [--stage2=STAGE2_FILE] [--force-lba] INSTALL_DEVICE [IMAGE_DEVICE]
Description:
Set up the installation of GRUB automatically.This command uses the more flexible command \"install\" in the backend and installs GRUB into the device INSTALL_DEVICE. If IMAGE_DEVICE is specified, then find the GRUB images in the device IMAGE_DEVICE, otherwise use the current "root device", which can be set by the command "root". If you know that your BIOS should support LBA but GRUB doesn't work in LBA mode, specify the option `--force-lba'. If you install GRUB under the grub shell and you cannot unmount the partition where GRUB images reside, specify the option `--stage2' to tell GRUB the file name under your OS.
terminal
Usage: terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules] [graphics]
Description:
Select a terminal. When multiple terminals are specified, wait until you push any key to continue. If both console and serial are specified, the terminal to which you input a key first will be selected. If no argument is specified, print current setting. The option --dumb specifies that your terminal is dumb, otherwise, vt100-compatibility is assumed. If you specify --no-echo, input characters won't be echoed. If you specify --no-edit, the BASH-like editing feature will be disabled. If --timeout is present, this command will wait at most for SECS seconds. The option --lines specifies the maximum number of lines. The option --silent is used to suppress messages.
terminfo
Usage: terminfo [--name=NAME --cursor-address=SEQ [--clear-screen=SEQ] [--enter-standout-mode=SEQ] [--exit-standout-mode=SEQ]]
Description:
Define the capabilities of your terminal. Use this command to define escape sequences, if it is not vt100-compatible. You may use \e for ESC and ^X for a control character. If no option is specified, the current settings are printed.
testload
Usage: testload FILE
Description:
Read the entire contents of FILE in several different ways and compares them, to test the filesystem code. The output is somewhat cryptic, but if no errors are reported and the final `i=X, filepos=Y' reading has X and Y equal, then it is definitely consistent, and very likely works correctly subject to a consistent offset error. If this test succeeds, then a good next step is to try loading a kernel.
testvbe
Usage: testvbe MODE
Description:
Test the VBE mode MODE. Hit any key to return.
--------------------------------------------------------------------------------
tftpserver
Usage: tftpserver IPADDR
Description:
Override the TFTP server address.
--------------------------------------------------------------------------------
timeout
Usage: timeout SEC
Description:
Set a timeout, in SEC seconds, before automatically booting the default entry (normally the first entry defined).
--------------------------------------------------------------------------------
title
Usage: title [NAME ...]
Description:
Start a new boot entry, and set its name to the contents of the rest of the line, starting with the first non-space character.
--------------------------------------------------------------------------------
unhide
Usage: unhide PARTITION
Description:
Unhide PARTITION by clearing the "hidden" bit in its partition type code.
--------------------------------------------------------------------------------
uppermem
Usage: uppermem KBYTES
Description:
Force GRUB to assume that only KBYTES kilobytes of upper memory are installed. Any system address range maps are discarded.