Merge branch 'master' of git://github.com/illumos/illumos-gate
[unleashed.git] / usr / src / grub / grub-0.97 / docs / grub.info-2
blobd6262affb14b2f2ef45a04ed6028cdb8812ac53e
1 This is grub.info, produced by makeinfo version 4.0 from grub.texi.
3 INFO-DIR-SECTION Kernel
4 START-INFO-DIR-ENTRY
5 * GRUB: (grub).                 The GRand Unified Bootloader
6 * grub-install: (grub)Invoking grub-install.    Install GRUB on your drive
7 * grub-md5-crypt: (grub)Invoking grub-md5-crypt.        Encrypt a password
8                                                         in MD5 format
9 * grub-terminfo: (grub)Invoking grub-terminfo.  Generate a terminfo
10                                                 command from a
11                                                 terminfo name
12 * grub-set-default: (grub)Invoking grub-set-default.    Set a default boot
13                                                         entry
14 * mbchk: (grub)Invoking mbchk.  Check for the format of a Multiboot kernel
15 END-INFO-DIR-ENTRY
17    Copyright (C) 1999,2000,2001,2002,2004 Free Software Foundation, Inc.
19    Permission is granted to make and distribute verbatim copies of this
20 manual provided the copyright notice and this permission notice are
21 preserved on all copies.
23    Permission is granted to copy and distribute modified versions of
24 this manual under the conditions for verbatim copying, provided also
25 that the entire resulting derived work is distributed under the terms
26 of a permission notice identical to this one.
28    Permission is granted to copy and distribute translations of this
29 manual into another language, under the above conditions for modified
30 versions.
32 \x1f
33 File: grub.info,  Node: Diskless,  Prev: General usage of network support,  Up: Network
35 Booting from a network
36 ======================
38    It is sometimes very useful to boot from a network, especially when
39 you use a machine which has no local disk. In this case, you need to
40 obtain a kind of Net Boot ROM, such as a PXE ROM or a free software
41 package like Etherboot. Such a Boot ROM first boots the machine, sets
42 up the network card installed into the machine, and downloads a second
43 stage boot image from the network. Then, the second image will try to
44 boot an operating system actually from the network.
46    GRUB provides two second stage images, `nbgrub' and `pxegrub' (*note
47 Images::). These images are the same as the normal Stage 2, except that
48 they set up a network automatically, and try to load a configuration
49 file from the network, if specified. The usage is very simple: If the
50 machine has a PXE ROM, use `pxegrub'. If the machine has an NBI loader
51 such as Etherboot, use `nbgrub'. There is no difference between them
52 except their formats. Since the way to load a second stage image you
53 want to use should be described in the manual on your Net Boot ROM,
54 please refer to the manual, for more information.
56    However, there is one thing specific to GRUB. Namely, how to specify
57 a configuration file in a BOOTP/DHCP server. For now, GRUB uses the tag
58 `150', to get the name of a configuration file. The following is an
59 example with a BOOTP configuration:
61      .allhost:hd=/tmp:bf=null:\
62              :ds=145.71.35.1 145.71.32.1:\
63              :sm=255.255.254.0:\
64              :gw=145.71.35.1:\
65              :sa=145.71.35.5:
66      
67      foo:ht=1:ha=63655d0334a7:ip=145.71.35.127:\
68              :bf=/nbgrub:\
69              :tc=.allhost:\
70              :T150="(nd)/tftpboot/menu.lst.foo":
72    Note that you should specify the drive name `(nd)' in the name of
73 the configuration file. This is because you might change the root drive
74 before downloading the configuration from the TFTP server when the
75 preset menu feature is used (*note Preset Menu::).
77    See the manual of your BOOTP/DHCP server for more information. The
78 exact syntax should differ a little from the example.
80 \x1f
81 File: grub.info,  Node: Serial terminal,  Next: Preset Menu,  Prev: Network,  Up: Top
83 Using GRUB via a serial line
84 ****************************
86    This chapter describes how to use the serial terminal support in
87 GRUB.
89    If you have many computers or computers with no display/keyboard, it
90 could be very useful to control the computers through serial
91 communications. To connect one computer with another via a serial line,
92 you need to prepare a null-modem (cross) serial cable, and you may need
93 to have multiport serial boards, if your computer doesn't have extra
94 serial ports. In addition, a terminal emulator is also required, such as
95 minicom. Refer to a manual of your operating system, for more
96 information.
98    As for GRUB, the instruction to set up a serial terminal is quite
99 simple. First of all, make sure that you haven't specified the option
100 `--disable-serial' to the configure script when you built your GRUB
101 images. If you get them in binary form, probably they have serial
102 terminal support already.
104    Then, initialize your serial terminal after GRUB starts up. Here is
105 an example:
107      grub> serial --unit=0 --speed=9600
108      grub> terminal serial
110    The command `serial' initializes the serial unit 0 with the speed
111 9600bps. The serial unit 0 is usually called `COM1', so, if you want to
112 use COM2, you must specify `--unit=1' instead. This command accepts
113 many other options, so please refer to *Note serial::, for more details.
115    The command `terminal' (*note terminal::) chooses which type of
116 terminal you want to use. In the case above, the terminal will be a
117 serial terminal, but you can also pass `console' to the command, as
118 `terminal serial console'. In this case, a terminal in which you press
119 any key will be selected as a GRUB terminal.
121    However, note that GRUB assumes that your terminal emulator is
122 compatible with VT100 by default. This is true for most terminal
123 emulators nowadays, but you should pass the option `--dumb' to the
124 command if your terminal emulator is not VT100-compatible or implements
125 few VT100 escape sequences. If you specify this option then GRUB
126 provides you with an alternative menu interface, because the normal
127 menu requires several fancy features of your terminal.
129 \x1f
130 File: grub.info,  Node: Preset Menu,  Next: Security,  Prev: Serial terminal,  Up: Top
132 Embedding a configuration file into GRUB
133 ****************************************
135    GRUB supports a "preset menu" which is to be always loaded before
136 starting. The preset menu feature is useful, for example, when your
137 computer has no console but a serial cable. In this case, it is
138 critical to set up the serial terminal as soon as possible, since you
139 cannot see any message until the serial terminal begins to work. So it
140 is good to run the commands `serial' (*note serial::) and `terminal'
141 (*note terminal::) before anything else at the start-up time.
143    How the preset menu works is slightly complicated:
145   1. GRUB checks if the preset menu feature is used, and loads the
146      preset menu, if available. This includes running commands and
147      reading boot entries, like an ordinary configuration file.
149   2. GRUB checks if the configuration file is available. Note that this
150      check is performed *regardless of the existence of the preset
151      menu*. The configuration file is loaded even if the preset menu was
152      loaded.
154   3. If the preset menu includes any boot entries, they are cleared when
155      the configuration file is loaded. It doesn't matter whether the
156      configuration file has any entries or no entry. The boot entries
157      in the preset menu are used only when GRUB fails in loading the
158      configuration file.
160    To enable the preset menu feature, you must rebuild GRUB specifying a
161 file to the configure script with the option `--enable-preset-menu'.
162 The file has the same semantics as normal configuration files (*note
163 Configuration::).
165    Another point you should take care is that the diskless support
166 (*note Diskless::) diverts the preset menu. Diskless images embed a
167 preset menu to execute the command `bootp' (*note bootp::)
168 automatically, unless you specify your own preset menu to the configure
169 script. This means that you must put commands to initialize a network in
170 the preset menu yourself, because diskless images don't set it up
171 implicitly, when you use the preset menu explicitly.
173    Therefore, a typical preset menu used with diskless support would be
174 like this:
176      # Set up the serial terminal, first of all.
177      serial --unit=0 --speed=19200
178      terminal --timeout=0 serial
179      
180      # Initialize the network.
181      dhcp
183 \x1f
184 File: grub.info,  Node: Security,  Next: Images,  Prev: Preset Menu,  Up: Top
186 Protecting your computer from cracking
187 **************************************
189    You may be interested in how to prevent ordinary users from doing
190 whatever they like, if you share your computer with other people. So
191 this chapter describes how to improve the security of GRUB.
193    One thing which could be a security hole is that the user can do too
194 many things with GRUB, because GRUB allows one to modify its
195 configuration and run arbitrary commands at run-time. For example, the
196 user can even read `/etc/passwd' in the command-line interface by the
197 command `cat' (*note cat::). So it is necessary to disable all the
198 interactive operations.
200    Thus, GRUB provides a "password" feature, so that only administrators
201 can start the interactive operations (i.e. editing menu entries and
202 entering the command-line interface). To use this feature, you need to
203 run the command `password' in your configuration file (*note
204 password::), like this:
206      password --md5 PASSWORD
208    If this is specified, GRUB disallows any interactive control, until
209 you press the key <p> and enter a correct password.  The option `--md5'
210 tells GRUB that `PASSWORD' is in MD5 format.  If it is omitted, GRUB
211 assumes the `PASSWORD' is in clear text.
213    You can encrypt your password with the command `md5crypt' (*note
214 md5crypt::). For example, run the grub shell (*note Invoking the grub
215 shell::), and enter your password:
217      grub> md5crypt
218      Password: **********
219      Encrypted: $1$U$JK7xFegdxWH6VuppCUSIb.
221    Then, cut and paste the encrypted password to your configuration
222 file.
224    Also, you can specify an optional argument to `password'. See this
225 example:
227      password PASSWORD /boot/grub/menu-admin.lst
229    In this case, GRUB will load `/boot/grub/menu-admin.lst' as a
230 configuration file when you enter the valid password.
232    Another thing which may be dangerous is that any user can choose any
233 menu entry. Usually, this wouldn't be problematic, but you might want to
234 permit only administrators to run some of your menu entries, such as an
235 entry for booting an insecure OS like DOS.
237    GRUB provides the command `lock' (*note lock::). This command always
238 fails until you enter the valid password, so you can use it, like this:
240      title Boot DOS
241      lock
242      rootnoverify (hd0,1)
243      makeactive
244      chainload +1
246    You should insert `lock' right after `title', because any user can
247 execute commands in an entry until GRUB encounters `lock'.
249    You can also use the command `password' instead of `lock'. In this
250 case the boot process will ask for the password and stop if it was
251 entered incorrectly.  Since the `password' takes its own PASSWORD
252 argument this is useful if you want different passwords for different
253 entries.
255 \x1f
256 File: grub.info,  Node: Images,  Next: Filesystem,  Prev: Security,  Up: Top
258 GRUB image files
259 ****************
261    GRUB consists of several images: two essential stages, optional
262 stages called "Stage 1.5", one image for bootable CD-ROM, and two
263 network boot images. Here is a short overview of them. *Note
264 Internals::, for more details.
266 `stage1'
267      This is an essential image used for booting up GRUB. Usually, this
268      is embedded in an MBR or the boot sector of a partition. Because a
269      PC boot sector is 512 bytes, the size of this image is exactly 512
270      bytes.
272      All `stage1' must do is to load Stage 2 or Stage 1.5 from a local
273      disk. Because of the size restriction, `stage1' encodes the
274      location of Stage 2 (or Stage 1.5) in a block list format, so it
275      never understand any filesystem structure.
277 `stage2'
278      This is the core image of GRUB. It does everything but booting up
279      itself. Usually, this is put in a filesystem, but that is not
280      required.
282 `e2fs_stage1_5'
283 `fat_stage1_5'
284 `ffs_stage1_5'
285 `jfs_stage1_5'
286 `minix_stage1_5'
287 `reiserfs_stage1_5'
288 `vstafs_stage1_5'
289 `xfs_stage1_5'
290      These are called "Stage 1.5", because they serve as a bridge
291      between `stage1' and `stage2', that is to say, Stage 1.5 is loaded
292      by Stage 1 and Stage 1.5 loads Stage 2. The difference between
293      `stage1' and `*_stage1_5' is that the former doesn't understand
294      any filesystem while the latter understands one filesystem (e.g.
295      `e2fs_stage1_5' understands ext2fs). So you can move the Stage 2
296      image to another location safely, even after GRUB has been
297      installed.
299      While Stage 2 cannot generally be embedded in a fixed area as the
300      size is so large, Stage 1.5 can be installed into the area right
301      after an MBR, or the boot loader area of a ReiserFS or a FFS.
303 `stage2_eltorito'
304      This is a boot image for CD-ROMs using the "no emulation mode" in
305      El Torito specification. This is identical to Stage 2, except that
306      this boots up without Stage 1 and sets up a special drive `(cd)'.
308 `nbgrub'
309      This is a network boot image for the Network Image Proposal used
310      by some network boot loaders, such as Etherboot. This is mostly
311      the same as Stage 2, but it also sets up a network and loads a
312      configuration file from the network.
314 `pxegrub'
315      This is another network boot image for the Preboot Execution
316      Environment used by several Netboot ROMs. This is identical to
317      `nbgrub', except for the format.
319 \x1f
320 File: grub.info,  Node: Filesystem,  Next: Interface,  Prev: Images,  Up: Top
322 Filesystem syntax and semantics
323 *******************************
325    GRUB uses a special syntax for specifying disk drives which can be
326 accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish
327 between IDE, ESDI, SCSI, or others. You must know yourself which BIOS
328 device is equivalent to which OS device. Normally, that will be clear if
329 you see the files in a device or use the command `find' (*note find::).
331 * Menu:
333 * Device syntax::               How to specify devices
334 * File name syntax::            How to specify files
335 * Block list syntax::           How to specify block lists
337 \x1f
338 File: grub.info,  Node: Device syntax,  Next: File name syntax,  Up: Filesystem
340 How to specify devices
341 ======================
343    The device syntax is like this:
345      `(DEVICE[,PART-NUM][,BSD-SUBPART-LETTER])'
347    `[]' means the parameter is optional. DEVICE should be either `fd'
348 or `hd' followed by a digit, like `fd0'.  But you can also set DEVICE
349 to a hexadecimal or a decimal number which is a BIOS drive number, so
350 the following are equivalent:
352      (hd0)
353      (0x80)
354      (128)
356    PART-NUM represents the partition number of DEVICE, starting from
357 zero for primary partitions and from four for extended partitions, and
358 BSD-SUBPART-LETTER represents the BSD disklabel subpartition, such as
359 `a' or `e'.
361    A shortcut for specifying BSD subpartitions is
362 `(DEVICE,BSD-SUBPART-LETTER)', in this case, GRUB searches for the
363 first PC partition containing a BSD disklabel, then finds the
364 subpartition BSD-SUBPART-LETTER. Here is an example:
366      (hd0,a)
368    The syntax `(hd0)' represents using the entire disk (or the MBR when
369 installing GRUB), while the syntax `(hd0,0)' represents using the first
370 partition of the disk (or the boot sector of the partition when
371 installing GRUB).
373    If you enabled the network support, the special drive, `(nd)', is
374 also available. Before using the network drive, you must initialize the
375 network. *Note Network::, for more information.
377    If you boot GRUB from a CD-ROM, `(cd)' is available. *Note Making a
378 GRUB bootable CD-ROM::, for details.
380 \x1f
381 File: grub.info,  Node: File name syntax,  Next: Block list syntax,  Prev: Device syntax,  Up: Filesystem
383 How to specify files
384 ====================
386    There are two ways to specify files, by "absolute file name" and by
387 "block list".
389    An absolute file name resembles a Unix absolute file name, using `/'
390 for the directory separator (not `\' as in DOS). One example is
391 `(hd0,0)/boot/grub/menu.lst'. This means the file `/boot/grub/menu.lst'
392 in the first partition of the first hard disk. If you omit the device
393 name in an absolute file name, GRUB uses GRUB's "root device"
394 implicitly. So if you set the root device to, say, `(hd1,0)' by the
395 command `root' (*note root::), then `/boot/kernel' is the same as
396 `(hd1,0)/boot/kernel'.
398 \x1f
399 File: grub.info,  Node: Block list syntax,  Prev: File name syntax,  Up: Filesystem
401 How to specify block lists
402 ==========================
404    A block list is used for specifying a file that doesn't appear in the
405 filesystem, like a chainloader. The syntax is
406 `[OFFSET]+LENGTH[,[OFFSET]+LENGTH]...'.  Here is an example:
408      `0+100,200+1,300+300'
410    This represents that GRUB should read blocks 0 through 99, block 200,
411 and blocks 300 through 599. If you omit an offset, then GRUB assumes
412 the offset is zero.
414    Like the file name syntax (*note File name syntax::), if a blocklist
415 does not contain a device name, then GRUB uses GRUB's "root device". So
416 `(hd0,1)+1' is the same as `+1' when the root device is `(hd0,1)'.
418 \x1f
419 File: grub.info,  Node: Interface,  Next: Commands,  Prev: Filesystem,  Up: Top
421 GRUB's user interface
422 *********************
424    GRUB has both a simple menu interface for choosing preset entries
425 from a configuration file, and a highly flexible command-line for
426 performing any desired combination of boot commands.
428    GRUB looks for its configuration file as soon as it is loaded. If one
429 is found, then the full menu interface is activated using whatever
430 entries were found in the file. If you choose the "command-line" menu
431 option, or if the configuration file was not found, then GRUB drops to
432 the command-line interface.
434 * Menu:
436 * Command-line interface::      The flexible command-line interface
437 * Menu interface::              The simple menu interface
438 * Menu entry editor::           Editing a menu entry
439 * Hidden menu interface::       The hidden menu interface
441 \x1f
442 File: grub.info,  Node: Command-line interface,  Next: Menu interface,  Up: Interface
444 The flexible command-line interface
445 ===================================
447    The command-line interface provides a prompt and after it an editable
448 text area much like a command-line in Unix or DOS. Each command is
449 immediately executed after it is entered(1) (*note Command-line
450 interface-Footnote-1::). The commands (*note Command-line and menu
451 entry commands::) are a subset of those available in the configuration
452 file, used with exactly the same syntax.
454    Cursor movement and editing of the text on the line can be done via a
455 subset of the functions available in the Bash shell:
457 <C-f>
458 <PC right key>
459      Move forward one character.
461 <C-b>
462 <PC left key>
463      Move back one character.
465 <C-a>
466 <HOME>
467      Move to the start of the line.
469 <C-e>
470 <END>
471      Move the the end of the line.
473 <C-d>
474 <DEL>
475      Delete the character underneath the cursor.
477 <C-h>
478 <BS>
479      Delete the character to the left of the cursor.
481 <C-k>
482      Kill the text from the current cursor position to the end of the
483      line.
485 <C-u>
486      Kill backward from the cursor to the beginning of the line.
488 <C-y>
489      Yank the killed text back into the buffer at the cursor.
491 <C-p>
492 <PC up key>
493      Move up through the history list.
495 <C-n>
496 <PC down key>
497      Move down through the history list.
499    When typing commands interactively, if the cursor is within or before
500 the first word in the command-line, pressing the <TAB> key (or <C-i>)
501 will display a listing of the available commands, and if the cursor is
502 after the first word, the `<TAB>' will provide a completion listing of
503 disks, partitions, and file names depending on the context. Note that
504 to obtain a list of drives, one must open a parenthesis, as `root ('.
506    Note that you cannot use the completion functionality in the TFTP
507 filesystem. This is because TFTP doesn't support file name listing for
508 the security.
510 \x1f
511 File: grub.info,  Node: Command-line interface-Footnotes,  Up: Command-line interface
513    (1) However, this behavior will be changed in the future version, in
514 a user-invisible way.
516 \x1f
517 File: grub.info,  Node: Menu interface,  Next: Menu entry editor,  Prev: Command-line interface,  Up: Interface
519 The simple menu interface
520 =========================
522    The menu interface is quite easy to use. Its commands are both
523 reasonably intuitive and described on screen.
525    Basically, the menu interface provides a list of "boot entries" to
526 the user to choose from. Use the arrow keys to select the entry of
527 choice, then press <RET> to run it.  An optional timeout is available
528 to boot the default entry (the first one if not set), which is aborted
529 by pressing any key.
531    Commands are available to enter a bare command-line by pressing <c>
532 (which operates exactly like the non-config-file version of GRUB, but
533 allows one to return to the menu if desired by pressing <ESC>) or to
534 edit any of the "boot entries" by pressing <e>.
536    If you protect the menu interface with a password (*note Security::),
537 all you can do is choose an entry by pressing <RET>, or press <p> to
538 enter the password.
540 \x1f
541 File: grub.info,  Node: Menu entry editor,  Next: Hidden menu interface,  Prev: Menu interface,  Up: Interface
543 Editing a menu entry
544 ====================
546    The menu entry editor looks much like the main menu interface, but
547 the lines in the menu are individual commands in the selected entry
548 instead of entry names.
550    If an <ESC> is pressed in the editor, it aborts all the changes made
551 to the configuration entry and returns to the main menu interface.
553    When a particular line is selected, the editor places the user in a
554 special version of the GRUB command-line to edit that line.  When the
555 user hits <RET>, GRUB replaces the line in question in the boot entry
556 with the changes (unless it was aborted via <ESC>, in which case the
557 changes are thrown away).
559    If you want to add a new line to the menu entry, press <o> if adding
560 a line after the current line or press <O> if before the current line.
562    To delete a line, hit the key <d>. Although GRUB unfortunately does
563 not support "undo", you can do almost the same thing by just returning
564 to the main menu.
566 \x1f
567 File: grub.info,  Node: Hidden menu interface,  Prev: Menu entry editor,  Up: Interface
569 The hidden menu interface
570 =========================
572    When your terminal is dumb or you request GRUB to hide the menu
573 interface explicitly with the command `hiddenmenu' (*note
574 hiddenmenu::), GRUB doesn't show the menu interface (*note Menu
575 interface::) and automatically boots the default entry, unless
576 interrupted by pressing <ESC>.
578    When you interrupt the timeout and your terminal is dumb, GRUB falls
579 back to the command-line interface (*note Command-line interface::).
581 \x1f
582 File: grub.info,  Node: Commands,  Next: Troubleshooting,  Prev: Interface,  Up: Top
584 The list of available commands
585 ******************************
587    In this chapter, we list all commands that are available in GRUB.
589    Commands belong to different groups. A few can only be used in the
590 global section of the configuration file (or "menu"); most of them can
591 be entered on the command-line and can be used either anywhere in the
592 menu or specifically in the menu entries.
594 * Menu:
596 * Menu-specific commands::
597 * General commands::
598 * Command-line and menu entry commands::
600 \x1f
601 File: grub.info,  Node: Menu-specific commands,  Next: General commands,  Up: Commands
603 The list of commands for the menu only
604 ======================================
606    The semantics used in parsing the configuration file are the
607 following:
609    * The menu-specific commands have to be used before any others.
611    * The files _must_ be in plain-text format.
613    * `#' at the beginning of a line in a configuration file means it is
614      only a comment.
616    * Options are separated by spaces.
618    * All numbers can be either decimal or hexadecimal. A hexadecimal
619      number must be preceded by `0x', and is case-insensitive.
621    * Extra options or text at the end of the line are ignored unless
622      otherwise specified.
624    * Unrecognized commands are added to the current entry, except
625      before entries start, where they are ignored.
627    These commands can only be used in the menu:
629 * Menu:
631 * default::                     Set the default entry
632 * fallback::                    Set the fallback entry
633 * hiddenmenu::                  Hide the menu interface
634 * timeout::                     Set the timeout
635 * title::                       Start a menu entry
637 \x1f
638 File: grub.info,  Node: default,  Next: fallback,  Up: Menu-specific commands
640 default
641 -------
643  - Command: default num
644      Set the default entry to the entry number NUM. Numbering starts
645      from 0, and the entry number 0 is the default if the command is not
646      used.
648      You can specify `saved' instead of a number. In this case, the
649      default entry is the entry saved with the command `savedefault'.
650      *Note savedefault::, for more information.
652 \x1f
653 File: grub.info,  Node: fallback,  Next: hiddenmenu,  Prev: default,  Up: Menu-specific commands
655 fallback
656 --------
658  - Command: fallback num...
659      Go into unattended boot mode: if the default boot entry has any
660      errors, instead of waiting for the user to do something,
661      immediately start over using the NUM entry (same numbering as the
662      `default' command (*note default::)). This obviously won't help if
663      the machine was rebooted by a kernel that GRUB loaded. You can
664      specify multiple fallback entry numbers.
666 \x1f
667 File: grub.info,  Node: hiddenmenu,  Next: timeout,  Prev: fallback,  Up: Menu-specific commands
669 hiddenmenu
670 ----------
672  - Command: hiddenmenu
673      Don't display the menu. If the command is used, no menu will be
674      displayed on the control terminal, and the default entry will be
675      booted after the timeout expired. The user can still request the
676      menu to be displayed by pressing <ESC> before the timeout expires.
677      See also *Note Hidden menu interface::.
679 \x1f
680 File: grub.info,  Node: timeout,  Next: title,  Prev: hiddenmenu,  Up: Menu-specific commands
682 timeout
683 -------
685  - Command: timeout sec
686      Set a timeout, in SEC seconds, before automatically booting the
687      default entry (normally the first entry defined).
689 \x1f
690 File: grub.info,  Node: title,  Prev: timeout,  Up: Menu-specific commands
692 title
693 -----
695  - Command: title name ...
696      Start a new boot entry, and set its name to the contents of the
697      rest of the line, starting with the first non-space character.
699 \x1f
700 File: grub.info,  Node: General commands,  Next: Command-line and menu entry commands,  Prev: Menu-specific commands,  Up: Commands
702 The list of general commands
703 ============================
705    Commands usable anywhere in the menu and in the command-line.
707 * Menu:
709 * bootp::                       Initialize a network device via BOOTP
710 * color::                       Color the menu interface
711 * device::                      Specify a file as a drive
712 * dhcp::                        Initialize a network device via DHCP
713 * hide::                        Hide a partition
714 * ifconfig::                    Configure a network device manually
715 * pager::                       Change the state of the internal pager
716 * partnew::                     Make a primary partition
717 * parttype::                    Change the type of a partition
718 * password::                    Set a password for the menu interface
719 * rarp::                        Initialize a network device via RARP
720 * serial::                      Set up a serial device
721 * setkey::                      Configure the key map
722 * terminal::                    Choose a terminal
723 * terminfo::                    Define escape sequences for a terminal
724 * tftpserver::                  Specify a TFTP server
725 * unhide::                      Unhide a partition
727 \x1f
728 File: grub.info,  Node: bootp,  Next: color,  Up: General commands
730 bootp
731 -----
733  - Command: bootp [`--with-configfile']
734      Initialize a network device via the "BOOTP" protocol. This command
735      is only available if GRUB is compiled with netboot support. See
736      also *Note Network::.
738      If you specify `--with-configfile' to this command, GRUB will
739      fetch and load a configuration file specified by your BOOTP server
740      with the vendor tag `150'.
742 \x1f
743 File: grub.info,  Node: color,  Next: device,  Prev: bootp,  Up: General commands
745 color
746 -----
748  - Command: color normal [highlight]
749      Change the menu colors. The color NORMAL is used for most lines in
750      the menu (*note Menu interface::), and the color HIGHLIGHT is used
751      to highlight the line where the cursor points. If you omit
752      HIGHLIGHT, then the inverted color of NORMAL is used for the
753      highlighted line. The format of a color is
754      `FOREGROUND/BACKGROUND'. FOREGROUND and BACKGROUND are symbolic
755      color names. A symbolic color name must be one of these:
757         * black
759         * blue
761         * green
763         * cyan
765         * red
767         * magenta
769         * brown
771         * light-gray
773           *These below can be specified only for the foreground.*
775         * dark-gray
777         * light-blue
779         * light-green
781         * light-cyan
783         * light-red
785         * light-magenta
787         * yellow
789         * white
791      But only the first eight names can be used for BACKGROUND. You can
792      prefix `blink-' to FOREGROUND if you want a blinking foreground
793      color.
795      This command can be used in the configuration file and on the
796      command line, so you may write something like this in your
797      configuration file:
799           # Set default colors.
800           color light-gray/blue black/light-gray
801           
802           # Change the colors.
803           title OS-BS like
804           color magenta/blue black/magenta
806 \x1f
807 File: grub.info,  Node: device,  Next: dhcp,  Prev: color,  Up: General commands
809 device
810 ------
812  - Command: device drive file
813      In the grub shell, specify the file FILE as the actual drive for a
814      BIOS drive DRIVE. You can use this command to create a disk image,
815      and/or to fix the drives guessed by GRUB when GRUB fails to
816      determine them correctly, like this:
818           grub> device (fd0) /floppy-image
819           grub> device (hd0) /dev/sd0
821      This command can be used only in the grub shell (*note Invoking
822      the grub shell::).
824 \x1f
825 File: grub.info,  Node: dhcp,  Next: hide,  Prev: device,  Up: General commands
827 dhcp
828 ----
830  - Command: dhcp [--with-configfile]
831      Initialize a network device via the "DHCP" protocol. Currently,
832      this command is just an alias for `bootp', since the two protocols
833      are very similar. This command is only available if GRUB is
834      compiled with netboot support. See also *Note Network::.
836      If you specify `--with-configfile' to this command, GRUB will
837      fetch and load a configuration file specified by your DHCP server
838      with the vendor tag `150'.
840 \x1f
841 File: grub.info,  Node: hide,  Next: ifconfig,  Prev: dhcp,  Up: General commands
843 hide
844 ----
846  - Command: hide partition
847      Hide the partition PARTITION by setting the "hidden" bit in its
848      partition type code. This is useful only when booting DOS or
849      Windows and multiple primary FAT partitions exist in one disk. See
850      also *Note DOS/Windows::.
852 \x1f
853 File: grub.info,  Node: ifconfig,  Next: pager,  Prev: hide,  Up: General commands
855 ifconfig
856 --------
858  - Command: ifconfig [`--server=server'] [`--gateway=gateway']
859           [`--mask=mask'] [`--address=address']
860      Configure the IP address, the netmask, the gateway, and the server
861      address of a network device manually. The values must be in dotted
862      decimal format, like `192.168.11.178'. The order of the options is
863      not important. This command shows current network configuration,
864      if no option is specified. See also *Note Network::.
866 \x1f
867 File: grub.info,  Node: pager,  Next: partnew,  Prev: ifconfig,  Up: General commands
869 pager
870 -----
872  - Command: pager [flag]
873      Toggle or set the state of the internal pager. If FLAG is `on',
874      the internal pager is enabled. If FLAG is `off', it is disabled.
875      If no argument is given, the state is toggled.
877 \x1f
878 File: grub.info,  Node: partnew,  Next: parttype,  Prev: pager,  Up: General commands
880 partnew
881 -------
883  - Command: partnew part type from len
884      Create a new primary partition. PART is a partition specification
885      in GRUB syntax (*note Naming convention::); TYPE is the partition
886      type and must be a number in the range `0-0xff'; FROM is the
887      starting address and LEN is the length, both in sector units.
889 \x1f
890 File: grub.info,  Node: parttype,  Next: password,  Prev: partnew,  Up: General commands
892 parttype
893 --------
895  - Command: parttype part type
896      Change the type of an existing partition.  PART is a partition
897      specification in GRUB syntax (*note Naming convention::); TYPE is
898      the new partition type and must be a number in the range 0-0xff.
900 \x1f
901 File: grub.info,  Node: password,  Next: rarp,  Prev: parttype,  Up: General commands
903 password
904 --------
906  - Command: password [`--md5'] passwd [new-config-file]
907      If used in the first section of a menu file, disable all
908      interactive editing control (menu entry editor and command-line)
909      and entries protected by the command `lock'. If the password
910      PASSWD is entered, it loads the NEW-CONFIG-FILE as a new config
911      file and restarts the GRUB Stage 2, if NEW-CONFIG-FILE is
912      specified. Otherwise, GRUB will just unlock the privileged
913      instructions.  You can also use this command in the script
914      section, in which case it will ask for the password, before
915      continuing.  The option `--md5' tells GRUB that PASSWD is
916      encrypted with `md5crypt' (*note md5crypt::).
918 \x1f
919 File: grub.info,  Node: rarp,  Next: serial,  Prev: password,  Up: General commands
921 rarp
922 ----
924  - Command: rarp
925      Initialize a network device via the "RARP" protocol.  This command
926      is only available if GRUB is compiled with netboot support. See
927      also *Note Network::.
929 \x1f
930 File: grub.info,  Node: serial,  Next: setkey,  Prev: rarp,  Up: General commands
932 serial
933 ------
935  - Command: serial [`--unit=unit'] [`--port=port'] [`--speed=speed']
936           [`--word=word'] [`--parity=parity'] [`--stop=stop']
937           [`--device=dev']
938      Initialize a serial device. UNIT is a number in the range 0-3
939      specifying which serial port to use; default is 0, which
940      corresponds to the port often called COM1. PORT is the I/O port
941      where the UART is to be found; if specified it takes precedence
942      over UNIT.  SPEED is the transmission speed; default is 9600. WORD
943      and STOP are the number of data bits and stop bits. Data bits must
944      be in the range 5-8 and stop bits must be 1 or 2. Default is 8 data
945      bits and one stop bit. PARITY is one of `no', `odd', `even' and
946      defaults to `no'. The option `--device' can only be used in the
947      grub shell and is used to specify the tty device to be used in the
948      host operating system (*note Invoking the grub shell::).
950      The serial port is not used as a communication channel unless the
951      `terminal' command is used (*note terminal::).
953      This command is only available if GRUB is compiled with serial
954      support. See also *Note Serial terminal::.
956 \x1f
957 File: grub.info,  Node: setkey,  Next: terminal,  Prev: serial,  Up: General commands
959 setkey
960 ------
962  - Command: setkey [to_key from_key]
963      Change the keyboard map. The key FROM_KEY is mapped to the key
964      TO_KEY. If no argument is specified, reset key mappings. Note that
965      this command _does not_ exchange the keys. If you want to exchange
966      the keys, run this command again with the arguments exchanged,
967      like this:
969           grub> setkey capslock control
970           grub> setkey control capslock
972      A key must be an alphabet letter, a digit, or one of these symbols:
973      `escape', `exclam', `at', `numbersign', `dollar', `percent',
974      `caret', `ampersand', `asterisk', `parenleft', `parenright',
975      `minus', `underscore', `equal', `plus', `backspace', `tab',
976      `bracketleft', `braceleft', `bracketright', `braceright', `enter',
977      `control', `semicolon', `colon', `quote', `doublequote',
978      `backquote', `tilde', `shift', `backslash', `bar', `comma',
979      `less', `period', `greater', `slash', `question', `alt', `space',
980      `capslock', `FX' (`X' is a digit), and `delete'. This table
981      describes to which character each of the symbols corresponds:
983     `exclam'
984           `!'
986     `at'
987           `@'
989     `numbersign'
990           `#'
992     `dollar'
993           `$'
995     `percent'
996           `%'
998     `caret'
999           `^'
1001     `ampersand'
1002           `&'
1004     `asterisk'
1005           `*'
1007     `parenleft'
1008           `('
1010     `parenright'
1011           `)'
1013     `minus'
1014           `-'
1016     `underscore'
1017           `_'
1019     `equal'
1020           `='
1022     `plus'
1023           `+'
1025     `bracketleft'
1026           `['
1028     `braceleft'
1029           `{'
1031     `bracketright'
1032           `]'
1034     `braceright'
1035           `}'
1037     `semicolon'
1038           `;'
1040     `colon'
1041           `:'
1043     `quote'
1044           `''
1046     `doublequote'
1047           `"'
1049     `backquote'
1050           ``'
1052     `tilde'
1053           `~'
1055     `backslash'
1056           `\'
1058     `bar'
1059           `|'
1061     `comma'
1062           `,'
1064     `less'
1065           `<'
1067     `period'
1068           `.'
1070     `greater'
1071           `>'
1073     `slash'
1074           `/'
1076     `question'
1077           `?'
1079     `space'
1080           ` '
1082 \x1f
1083 File: grub.info,  Node: terminal,  Next: terminfo,  Prev: setkey,  Up: General commands
1085 terminal
1086 --------
1088  - Command: terminal [`--dumb'] [`--no-echo'] [`--no-edit']
1089           [`--timeout=secs'] [`--lines=lines'] [`--silent'] [`console']
1090           [`serial'] [`hercules']
1091      Select a terminal for user interaction. The terminal is assumed to
1092      be VT100-compatible unless `--dumb' is specified. If both
1093      `console' and `serial' are specified, then GRUB will use the one
1094      where a key is entered first or the first when the timeout
1095      expires. If neither are specified, the current setting is
1096      reported. This command is only available if GRUB is compiled with
1097      serial support. See also *Note Serial terminal::.
1099      This may not make sense for most users, but GRUB supports Hercules
1100      console as well. Hercules console is usable like the ordinary
1101      console, and the usage is quite similar to that for serial
1102      terminals: specify `hercules' as the argument.
1104      The option `--lines' defines the number of lines in your terminal,
1105      and it is used for the internal pager function. If you don't
1106      specify this option, the number is assumed as 24.
1108      The option `--silent' suppresses the message to prompt you to hit
1109      any key. This might be useful if your system has no terminal
1110      device.
1112      The option `--no-echo' has GRUB not to echo back input characters.
1113      This implies the option `--no-edit'.
1115      The option `--no-edit' disables the BASH-like editing feature.
1117 \x1f
1118 File: grub.info,  Node: terminfo,  Next: tftpserver,  Prev: terminal,  Up: General commands
1120 terminfo
1121 --------
1123  - Command: terminfo `--name=name' `--cursor-address=seq'
1124           [`--clear-screen=seq'] [`--enter-standout-mode=seq']
1125           [`--exit-standout-mode=seq']
1126      Define the capabilities of your terminal. Use this command to
1127      define escape sequences, if it is not vt100-compatible. You may
1128      use `\e' for <ESC> and `^X' for a control character.
1130      You can use the utility `grub-terminfo' to generate appropriate
1131      arguments to this command. *Note Invoking grub-terminfo::.
1133      If no option is specified, the current settings are printed.
1135 \x1f
1136 File: grub.info,  Node: tftpserver,  Next: unhide,  Prev: terminfo,  Up: General commands
1138 tftpserver
1139 ----------
1141  - Command: tftpserver ipaddr
1142      *Caution:* This command exists only for backward compatibility.
1143      Use `ifconfig' (*note ifconfig::) instead.
1145      Override a TFTP server address returned by a BOOTP/DHCP/RARP
1146      server. The argument IPADDR must be in dotted decimal format, like
1147      `192.168.0.15'.  This command is only available if GRUB is compiled
1148      with netboot support. See also *Note Network::.
1150 \x1f
1151 File: grub.info,  Node: unhide,  Prev: tftpserver,  Up: General commands
1153 unhide
1154 ------
1156  - Command: unhide partition
1157      Unhide the partition PARTITION by clearing the "hidden" bit in its
1158      partition type code. This is useful only when booting DOS or
1159      Windows and multiple primary partitions exist on one disk. See also
1160      *Note DOS/Windows::.
1162 \x1f
1163 File: grub.info,  Node: Command-line and menu entry commands,  Prev: General commands,  Up: Commands
1165 The list of command-line and menu entry commands
1166 ================================================
1168    These commands are usable in the command-line and in menu entries.
1169 If you forget a command, you can run the command `help' (*note help::).
1171 * Menu:
1173 * blocklist::                   Get the block list notation of a file
1174 * boot::                        Start up your operating system
1175 * cat::                         Show the contents of a file
1176 * chainloader::                 Chain-load another boot loader
1177 * cmp::                         Compare two files
1178 * configfile::                  Load a configuration file
1179 * debug::                       Toggle the debug flag
1180 * displayapm::                  Display APM information
1181 * displaymem::                  Display memory configuration
1182 * embed::                       Embed Stage 1.5
1183 * find::                        Find a file
1184 * fstest::                      Test a filesystem
1185 * geometry::                    Manipulate the geometry of a drive
1186 * halt::                        Shut down your computer
1187 * help::                        Show help messages
1188 * impsprobe::                   Probe SMP
1189 * initrd::                      Load an initrd
1190 * install::                     Install GRUB
1191 * ioprobe::                     Probe I/O ports used for a drive
1192 * kernel::                      Load a kernel
1193 * lock::                        Lock a menu entry
1194 * makeactive::                  Make a partition active
1195 * map::                         Map a drive to another
1196 * md5crypt::                    Encrypt a password in MD5 format
1197 * module::                      Load a module
1198 * modulenounzip::               Load a module without decompression
1199 * pause::                       Wait for a key press
1200 * quit::                        Exit from the grub shell
1201 * reboot::                      Reboot your computer
1202 * read::                        Read data from memory
1203 * root::                        Set GRUB's root device
1204 * rootnoverify::                Set GRUB's root device without mounting
1205 * savedefault::                 Save current entry as the default entry
1206 * setup::                       Set up GRUB's installation automatically
1207 * testload::                    Load a file for testing a filesystem
1208 * testvbe::                     Test VESA BIOS EXTENSION
1209 * uppermem::                    Set the upper memory size
1210 * vbeprobe::                    Probe VESA BIOS EXTENSION
1212 \x1f
1213 File: grub.info,  Node: blocklist,  Next: boot,  Up: Command-line and menu entry commands
1215 blocklist
1216 ---------
1218  - Command: blocklist file
1219      Print the block list notation of the file FILE. *Note Block list
1220      syntax::.
1222 \x1f
1223 File: grub.info,  Node: boot,  Next: cat,  Prev: blocklist,  Up: Command-line and menu entry commands
1225 boot
1226 ----
1228  - Command: boot
1229      Boot the OS or chain-loader which has been loaded. Only necessary
1230      if running the fully interactive command-line (it is implicit at
1231      the end of a menu entry).
1233 \x1f
1234 File: grub.info,  Node: cat,  Next: chainloader,  Prev: boot,  Up: Command-line and menu entry commands
1239  - Command: cat file
1240      Display the contents of the file FILE. This command may be useful
1241      to remind you of your OS's root partition:
1243           grub> cat /etc/fstab
1245 \x1f
1246 File: grub.info,  Node: chainloader,  Next: cmp,  Prev: cat,  Up: Command-line and menu entry commands
1248 chainloader
1249 -----------
1251  - Command: chainloader [`--force'] file
1252      Load FILE as a chain-loader. Like any other file loaded by the
1253      filesystem code, it can use the blocklist notation to grab the
1254      first sector of the current partition with `+1'. If you specify the
1255      option `--force', then load FILE forcibly, whether it has a
1256      correct signature or not. This is required when you want to load a
1257      defective boot loader, such as SCO UnixWare 7.1 (*note SCO
1258      UnixWare::).
1260 \x1f
1261 File: grub.info,  Node: cmp,  Next: configfile,  Prev: chainloader,  Up: Command-line and menu entry commands
1266  - Command: cmp file1 file2
1267      Compare the file FILE1 with the file FILE2. If they differ in
1268      size, print the sizes like this:
1270           Differ in size: 0x1234 [foo], 0x4321 [bar]
1272      If the sizes are equal but the bytes at an offset differ, then
1273      print the bytes like this:
1275           Differ at the offset 777: 0xbe [foo], 0xef [bar]
1277      If they are completely identical, nothing will be printed.
1279 \x1f
1280 File: grub.info,  Node: configfile,  Next: debug,  Prev: cmp,  Up: Command-line and menu entry commands
1282 configfile
1283 ----------
1285  - Command: configfile file
1286      Load FILE as a configuration file.
1288 \x1f
1289 File: grub.info,  Node: debug,  Next: displayapm,  Prev: configfile,  Up: Command-line and menu entry commands
1291 debug
1292 -----
1294  - Command: debug
1295      Toggle debug mode (by default it is off). When debug mode is on,
1296      some extra messages are printed to show disk activity. This global
1297      debug flag is mainly useful for GRUB developers when testing new
1298      code.
1300 \x1f
1301 File: grub.info,  Node: displayapm,  Next: displaymem,  Prev: debug,  Up: Command-line and menu entry commands
1303 displayapm
1304 ----------
1306  - Command: displayapm
1307      Display APM BIOS information.
1309 \x1f
1310 File: grub.info,  Node: displaymem,  Next: embed,  Prev: displayapm,  Up: Command-line and menu entry commands
1312 displaymem
1313 ----------
1315  - Command: displaymem
1316      Display what GRUB thinks the system address space map of the
1317      machine is, including all regions of physical RAM installed. GRUB's
1318      "upper/lower memory" display uses the standard BIOS interface for
1319      the available memory in the first megabyte, or "lower memory", and
1320      a synthesized number from various BIOS interfaces of the memory
1321      starting at 1MB and going up to the first chipset hole for "upper
1322      memory" (the standard PC "upper memory" interface is limited to
1323      reporting a maximum of 64MB).
1325 \x1f
1326 File: grub.info,  Node: embed,  Next: find,  Prev: displaymem,  Up: Command-line and menu entry commands
1328 embed
1329 -----
1331  - Command: embed stage1_5 device
1332      Embed the Stage 1.5 STAGE1_5 in the sectors after the MBR if
1333      DEVICE is a drive, or in the "boot loader" area if DEVICE is a FFS
1334      partition or a ReiserFS partition.(1) (*note embed-Footnote-1::)
1335      Print the number of sectors which STAGE1_5 occupies, if successful.
1337      Usually, you don't need to run this command directly. *Note
1338      setup::.
1340 \x1f
1341 File: grub.info,  Node: embed-Footnotes,  Up: embed
1343    (1) The latter feature has not been implemented yet.
1345 \x1f
1346 File: grub.info,  Node: find,  Next: fstest,  Prev: embed,  Up: Command-line and menu entry commands
1348 find
1349 ----
1351  - Command: find filename
1352      Search for the file name FILENAME in all mountable partitions and
1353      print the list of the devices which contain the file. The file
1354      name FILENAME should be an absolute file name like
1355      `/boot/grub/stage1'.
1357 \x1f
1358 File: grub.info,  Node: fstest,  Next: geometry,  Prev: find,  Up: Command-line and menu entry commands
1360 fstest
1361 ------
1363  - Command: fstest
1364      Toggle filesystem test mode.  Filesystem test mode, when turned
1365      on, prints out data corresponding to all the device reads and what
1366      values are being sent to the low-level routines. The format is
1367      `<PARTITION-OFFSET-SECTOR, BYTE-OFFSET, BYTE-LENGTH>' for
1368      high-level reads inside a partition, and `[DISK-OFFSET-SECTOR]'
1369      for low-level sector requests from the disk.  Filesystem test mode
1370      is turned off by any use of the `install' (*note install::) or
1371      `testload' (*note testload::) commands.
1373 \x1f
1374 File: grub.info,  Node: geometry,  Next: halt,  Prev: fstest,  Up: Command-line and menu entry commands
1376 geometry
1377 --------
1379  - Command: geometry drive [cylinder head sector [total_sector]]
1380      Print the information for the drive DRIVE. In the grub shell, you
1381      can set the geometry of the drive arbitrarily. The number of
1382      cylinders, the number of heads, the number of sectors and the
1383      number of total sectors are set to CYLINDER, HEAD, SECTOR and
1384      TOTAL_SECTOR, respectively. If you omit TOTAL_SECTOR, then it will
1385      be calculated based on the C/H/S values automatically.
1387 \x1f
1388 File: grub.info,  Node: halt,  Next: help,  Prev: geometry,  Up: Command-line and menu entry commands
1390 halt
1391 ----
1393  - Command: halt `--no-apm'
1394      The command halts the computer. If the `--no-apm' option is
1395      specified, no APM BIOS call is performed. Otherwise, the computer
1396      is shut down using APM.
1398 \x1f
1399 File: grub.info,  Node: help,  Next: impsprobe,  Prev: halt,  Up: Command-line and menu entry commands
1401 help
1402 ----
1404  - Command: help `--all' [pattern ...]
1405      Display helpful information about builtin commands. If you do not
1406      specify PATTERN, this command shows short descriptions of most of
1407      available commands. If you specify the option `--all' to this
1408      command, short descriptions of rarely used commands (such as *Note
1409      testload::) are displayed as well.
1411      If you specify any PATTERNS, it displays longer information about
1412      each of the commands which match those PATTERNS.
1414 \x1f
1415 File: grub.info,  Node: impsprobe,  Next: initrd,  Prev: help,  Up: Command-line and menu entry commands
1417 impsprobe
1418 ---------
1420  - Command: impsprobe
1421      Probe the Intel Multiprocessor Specification 1.1 or 1.4
1422      configuration table and boot the various CPUs which are found into
1423      a tight loop. This command can be used only in the Stage 2, but
1424      not in the grub shell.
1426 \x1f
1427 File: grub.info,  Node: initrd,  Next: install,  Prev: impsprobe,  Up: Command-line and menu entry commands
1429 initrd
1430 ------
1432  - Command: initrd file ...
1433      Load an initial ramdisk for a Linux format boot image and set the
1434      appropriate parameters in the Linux setup area in memory. See also
1435      *Note GNU/Linux::.