APPENDIX - Commands


Use caution when following the built in help information - it is based on GNU GRUB and contains some legacy commands (and information) that do not always apply to Grub4dos. The following example is the output from typing help default -

grub> help default
default: default [NUM ¦ 'saved' ¦ FILE]
   set the default entry to entry number NUM (if not specified, it is 0,
   the first entry), or to the entry number saved by savedefault if the
   key word 'saved' is specified, or to the entry number previously saved
   in the specified file FILE. When FILE is specified, all subsequent
   'savedefault' commands will save default entry numbers into FILE.

Although the default [NUM] parameter works within a configuration file, using default saved does not. In addition the default [FILE] command only works with the default file included in the grub4dos download - e.g. default /default.

The following (66) commands are all recognised by Grub4dos - version 0.4.4 (build 2009-03-31)


background

grub> help background
background: background RRGGBB
   Sets the background color when in graphics mode. RR is red, GG is green,
   and BB blue. Numbers must be in hexadecimal.

blocklist

grub> help blocklist
blocklist: blocklist FILE
   Print the blocklist notation of the file FILE.

boot

grub> help boot
boot: boot
    Boot the OS/chain-loader which has been loaded.

cat

grub> help cat
cat: cat [--hex] [--skip=S] [--length=L] [--locate=STRING] FILE
    Print the contents of the file FILE, or print the locations of the
    string STRING in file.

cdrom

grub> help cdrom
cdrom: cdrom --add-io-ports=P ¦ --init ¦ --stop
    Initialise/stop atapi cdroms or set additional I/O ports for a possible
    atapi cdrom device. The high word of P specifies the base register of
    the control block registers, and the low word of P specifies the base
    register of the command block registers.

chainloader

grub> help chainloader
chainloader: chainloader [--force] [--load-segment=LS] [--load offset=LO]
 [--load-length=LL] [--skip-length=SL] [--boot-cs=CS] [--boot-ip=IP]
 [--ebx=EBX] [--edx=EDX] [--sdi] [--disable-a20] FILE
    Load the chain-loader FILE. If --force is specified, then load it
    forcibly, whether the boot loader signature is present or not. LS:LO
    specifies the load address other than 0000:7C00. LL specifies the
    length of the boot image(between 512 and 640k). CS:IP specifies the
    address where the boot image will gain control. EBX/EDX specifies the
    EBX/EDX register value when the boot image gets control. Use --sdi if
    FILE is a System Deployment Image, which is of the Windows XP RAM boot
    file format. Use --disable-a20 if you wish to turn off A20 when
    transferring control to the boot image. SL specifies length in bytes at
    the beginning of the image to be skipped when loading.

checkrange

grub> help checkrange
checkrange: checkrange RANGE COMMAND
    Return true if the return value of COMMAND is in RANGE and false
    otherwise.

checktime

grub> help checktime
checktime: checktime min hour dom month dow
    Check time.

clear

grub> help clear
clear: clear
    Clear the screen

cmp

grub> help cmp
cmp: cmp FILE1 FILE2
    Compare the file FILE1 with the file FILE2 and inform the different values
    if any.

color

grub> help color
color: color NORMAL [HIGHLIGHT [HELPTEXT [HEADING]]]
   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. If you omit HELPTEXT and/or HEADING,
   then NORMAL is used. 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-grey, dark-gray,
   light-blue, light-green, light-cyan, light-red, light-magenta, yellow
   and white. You can prefix "blink-" to FG if you want a blinking
   foreground color.

commandline

grub> help commandline
commandline: commandline
   Enter the command-line prompt mode.

configfile

grub> help configfile
configfile: configfile FILE
    Load FILE as the configuration file.

debug

grub> help debug
debug: debug [on ¦ off ¦ normal ¦ status ¦ INTERGER]
    Turn on/off or display/set the debug level.

dd

grub> help dd
dd: dd if=IF of=OF [bs=BS] [count=C] [skip=IN] [seek=OUT] [buf=ADDR] [buflen=SI
ZE]
    Copy file IF to OF. BS is blocksize, default to 512. C is blocks to
    copy, default is total blocks in IF. IN specifies number of blocks to
    skip when read, default is 0. OUT specifies number of blocks to skip
    when write, default is 0. Skipped blocks are not touched. Both IF and
    OF must exist. dd can neither enlarge nor reduce the size OF, the
    leftover tail of IF will be discarded. OF cannot be a gzipped file. If
    IF is a gzipped file, it will be decompressed automatically when
    copying. dd is dangerous, use at your own risk. To be on the safe side,
    you should only use dd to write a file in memory. ADDR and SIZE are
    used for user-defined buffer.

default

grub> help default
default: default [NUM ¦ 'saved' ¦ FILE]
   set the default entry to entry number NUM (if not specified, it is 0,
   the first entry), or to the entry number saved by savedefault if the
   key word 'saved' is specified, or to the entry number previously saved
   in the specified file FILE. When FILE is specified, all subsequent
   'savedefault' commands will save default entry numbers into FILE.

displaymem

grub> help displaymem
displaymem: displaymem
   Display what GRUB thinks the system address space map of the machine
   is, including all regions of physical RAM installed.

embed

grub> help embed
embed: embed STAGE1_5 DEVICE
   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.

errnum

grub> help errnum
errnum: errnum
   Return the error number.

errorcheck

grub> help errorcheck
errorcheck: errorcheck [on ¦ off ¦ status]
   Turn on/off or display the error check mode, or toggle it if no
   argument.

fallback

grub> help fallback
fallback: fallback NUM...
   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

grub> help find
find: find [--set-root[=DIR]] [--ignore-floppies] [--ignore-cd] FILENAME [CON
DITION]
   Search for the filename FILENAME in all partitions and print the
   list of the devices which contain the file and suffice CONDITION.
   CONDITION is a normal grub command, which return non-zero for TRUE and
   zero for FALSE. If option --set-root is used and FILENAME is found
   on a device, then stop the find immediately and set the sevice as new
   root. If the option --ignore-floppies is present, the search will
   bypass all floppies. And --ignore-cd will skip (cd).

foreground

grub> help foreground
foreground: foreground RRGGBB
   Sets the foreground color when in graphics mode. RR is red, GG is green,
   and BB blue. Numbers must be in hexadecimal.

fstest

grub> help fstest
fstest: fstest [on ¦ off ¦ status]
   Turn on/off or display the fstest mode, or toggle it if no argument.

geometry

grub> help geometry
geometry: geometry [--tune] [--sync] [DRIVE]
   Print the information for drive DRIVE or the current root device if
   DRIVE is not specified. If --tune is specified, the geometry will
   change to the tuned value. If --sync is specified, the C/H/S values in
   partition table of DRIVE and H/S values in BPD of each primary
   partition of DRIVE(or BPB of floppy DRIVE) will be updated according to
   the current geometry of DRIVE in use.

halt

grub> help halt
halt: halt [--no-apm]
   Halt your system. If APM is available on it, turn off the power using
   the APM BIOS, unless you specify the option '--no-apm'.

help

grub> help help
help: help [--all] [PATTERN...]
   Display helpful information about builtin commands. Not all commands
   aren't shown without the option '--all'.

hiddenflag

grub> help hiddenflag
hiddenflag: hiddenflag [--set ¦ --clear] [PARTITION]
   Hide/unhide PARTITION by setting/clearing the "hidden" bit in its
   partition type code, or report the hidden status. The default partition
   is the current root device.

hide

grub> help hide
hide: hide [PARTITION]
   Hide PARTITION by setting the "hidden" bit in its partition type code.
   The default partition is the current root device.

initrd

grub> help initrd
initrd: initrd FILE [FILE...]
   Load an initial ramdisk FILE for a Linux format boot image and set the
   appropriate parameters in the Linux setup area in memory. For Linux
   2.6+ kernels, multiple cpio files can be loaded.

install

grub> help install
install: install [--stage2=STAGE2_FILE] [--force-lba] STAGE1 [d] DEVICE
 STAGE2 [ADDR] [p] [CONFIG_FILE] [REAL_CONFIG_FILE]
   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 the 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.

is64bit

grub> help is64bit
is64bit: is64bit
   Return true if CPU is 64-bit and false if not.

kernel

grub> help kernel
 kernel: kernel [--no-mem-option] [--type=TYPE] FILE [ARG...]
   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

grub> help lock
lock: lock
   Break a command execution unless the user is authenticated.

ls

grub> help ls
ls: ls [FILE_OR_DIR]
    List file or directory.

makeactive

grub> help makeactive
makeactive: makeactive [--status] [PART]
   Activate the partition PART. PART defaults to the current root device.
   This command is limited to _primary_ PC partitions on a hard disk.

map

grub> help map
map: map [--status] [--mem[=RESERV]] [--hook] [--unhook] [--unmap=DRIVES]
 [--rehook] [--floppies=M] [harddrives=N] [--memdisk-raw=RAW]
 [--a20-keep-on=AKO] [--safe-mbr-hook=SMH] [--int13-scheme=SCH]
 [--ram-drive=RD] [--rd-base=ADDR] [--rd-size=SIZE] [[--read-only]
 [--fake-write] [--unsafe-boot] [--disable-chs-mode] [--disable-lba-mode]
 [--heads=H] [--sectors-per-track=S] TO_DRIVE FROM_DRIVE]
   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 --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
   discarded. 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. If RAW=1,
   all memdrives will be accessed without using int15/ah=87h. If RAW=0,
   then int15/ah=87h will be used to access memdrives. If one of --status,
   --hook, --unhook, --rehook, --floppies, --harddrives, memdisk-raw,
   --a20-keep-on, --safe-mbr-hook, --int13-scheme, --ram-drive, --rd-base
   or --rd-size is given, then any other command-line arguments will be
   ignored. The --mem option indicates a drive in memory. if RESERV is
   used and <= 0, the minimum memory occupied by the memdrive is (-RESERV)
   in 512-byte-sectors. if RESERV is used and > 0, the memdrive will
   occupy the mem area starting at absolute physical address RESERV in
   512-byte-sectors and ending at the end of this mem block(usually the
   end of physical mem).

md5crypt

grub> help md5crypt
md5crypt: md5crypt
   Generate a password in MD5 format.

module

grub> help module
module: module FILE [ARG...]
   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

grub> help modulenounzip
modulenounzip: modulenounzip FILE [ARG...]
   The same as 'module', except that automatic decompression is disabled.

outline

grub> help outline
outline: outline [on ¦ off ¦ status]
   Turn on/off or display the outline mode, or toggle it if no argument.

pager

grub> help pager
pager: pager [on ¦ off ¦ status]
   Turn on/off or display the pager mode, or toggle it if no argument.

partnew

grub> help partnew
partnew: partnew [--active] PART TYPE START [LEN]
   Create a primary partition at the starting address START with the
   length LEN, with the type TYPE. START and LEN are in sector units. If
   --active is used, the new partition will be active. START can be a
   contiguous file that will be used as the content/data of the new
   partition, in which case the LEN parameter is ignored, and TYPE can be
   either 0x00 for auto or 0x10 for hidden-auto.

parttype

grub> help parttype
parttype: parttype [PART] [TYPE]
   Change the type of the partition PART to TYPE. If TYPE is omitted,
   return the partition type of the specified device(instead of changing
   it). PART default to the current root device.

password

grub> help password
password: password [--md5] PASSWD [FILE]
   If used in the first section of a menu file, disable all interactive
   editing control (menu entry editor and command line). If the password
   PASSWRD 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

grub> help pause
pause: pause [--wait=T] [MESSAGE...]
   Print MESSAGE, then wait until a key is pressed or T seconds has passed.

pxe

grub> help pxe
pxe: pxe [cmd] [parameters]
   Call PXE command.

quit

grub> help quit
quit: quit [--disable-a20]
    Go back to DOS if GRUB was previously launched from DOS.

read

grub> help read
read: read ADDR
   Read a 32-bit value from memory at address ADDR and display it in hex
   format.

reboot

grub> help reboot
reboot: reboot
   Reboot your system.

root

grub> help root
root: root [DEVICE [HDBIAS]]
   Set the current "root device" to the device DEVICE, then attempt to
   mount it to get the partition size (for passing the partition
   descripter 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 befor 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

grub> help rootnoverify
rootnoverify: rootnoverify [DEVICE [HDBIAS]]
   similar to 'root', but don't atttempt to mount the partition. This is
   useful for when an OS is outside 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

grub> help savedefault
savedefault: savedefault[--wait=T] [NUM ¦ 'fallback']
   Save the current entry as the default boot entry if no argument is
   specified. If a number is specified, this number is saved. If
   'fallback' is used, next fallback entry is saved. If T is not 0, prompt
   the user to confirm the write operation by pressing the Y key, and if
   no key-press detected within T seconds, the write will be discarded.

serial

grub> help serial
serial: serial [--unit=UNIT] [--port=PORT] [--speed=SPEED] [--word=WORD]
 [parity=PARITY] [--stop=STOP] [--device=DEV]
   Initialise 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

grub> help setkey
setkey: setkey [TO_KEY FROM_KEY]
    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,
    spcae, capslock, FX (X is a digit), and delete. If no argument is
    specified, reset key mappings.

setup

grub> help setup
setup: setup [--prefix=DIR] [--stage2=STAGE2_FILE] [--force-lba]
 INSTALL_DEVICE [IMAGE_DEVICE]
   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.

setvbe

grub> help setvbe
setvbe: setvbe MODE_3D
   Set the VBE mode MODE_3D(which is of the form 1024x768x32) for each
   subsequent kernel command-line. If no argument is specified,
   clear(nullify, invalidate) the video option string setup by the
   previous setvbe command.

splashimage

grub> help splashimage
splashimage: splashimage FILE
   Load FILE as the background image when in graphics mode.

terminal

grub> help terminal
terminal: terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS]
 [--lines=LINES] [--silent] [console] [serial] [hercules] [graphics]
   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 deiting 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

grub> help terminfo
terminfo: terminfo [--name=NAME --cursor-address=SEQ [--clear-screen=SEQ]
  [--enter-standout-mode=SEQ] [--exit-standout-mode=SEQ]]
    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.

testvbe

grub> help testvbe
testvbe: testvbe MODE
    Test the VBE mode MODE. Hit any key to return.

tpm

grub> help tpm
tpm: tpm --init
    Initialise TPM

unhide

grub> help unhide
unhide: unhide [PARTITION]
    Unhide PARTITION by setting the "hidden" bit in its partition type
    code. The default partition is the current root device.

uuid

grub> help uuid
uuid: uuid [DEVICE] [UUID]
    If DEVICE is not specified, search for filesystem with UUID in all
    partitions and set the partition containing the filesystem as new
    root (if UUID is specified), or just list uuid's of all filesystems on
    all devices (if UUID is not specified). If DEVICE is specified, return
    true or false according to whether or not the DEVICE matches the
    specified UUID (if UUID is specified), or just the uuid of
    DEVICE (if UUID is not specified).

vbeprobe

grub> help vbeprobe
vbeprobe: vbeprobe [MODE]
    Probe VBE information. If the mode number MODE is specified, show only
    the information about only the mode.

write

grub> help write
write: write [--offset=SKIP] ADDR_OR_FILE INTEGER_OR_STRING
    Write a 32-bit value to memory or write a string to file (or device!).