xref: /titanic_44/usr/src/grub/grub-0.97/docs/grub.info-2 (revision 2ec7cc7fc084163eaed884efee9bbd322cc8951b)
1This is grub.info, produced by makeinfo version 4.0 from grub.texi.
2
3INFO-DIR-SECTION Kernel
4START-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
15END-INFO-DIR-ENTRY
16
17   Copyright (C) 1999,2000,2001,2002,2004 Free Software Foundation, Inc.
18
19   Permission is granted to make and distribute verbatim copies of this
20manual provided the copyright notice and this permission notice are
21preserved on all copies.
22
23   Permission is granted to copy and distribute modified versions of
24this manual under the conditions for verbatim copying, provided also
25that the entire resulting derived work is distributed under the terms
26of a permission notice identical to this one.
27
28   Permission is granted to copy and distribute translations of this
29manual into another language, under the above conditions for modified
30versions.
31
32
33File: grub.info,  Node: Diskless,  Prev: General usage of network support,  Up: Network
34
35Booting from a network
36======================
37
38   It is sometimes very useful to boot from a network, especially when
39you use a machine which has no local disk. In this case, you need to
40obtain a kind of Net Boot ROM, such as a PXE ROM or a free software
41package like Etherboot. Such a Boot ROM first boots the machine, sets
42up the network card installed into the machine, and downloads a second
43stage boot image from the network. Then, the second image will try to
44boot an operating system actually from the network.
45
46   GRUB provides two second stage images, `nbgrub' and `pxegrub' (*note
47Images::). These images are the same as the normal Stage 2, except that
48they set up a network automatically, and try to load a configuration
49file from the network, if specified. The usage is very simple: If the
50machine has a PXE ROM, use `pxegrub'. If the machine has an NBI loader
51such as Etherboot, use `nbgrub'. There is no difference between them
52except their formats. Since the way to load a second stage image you
53want to use should be described in the manual on your Net Boot ROM,
54please refer to the manual, for more information.
55
56   However, there is one thing specific to GRUB. Namely, how to specify
57a 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
59example with a BOOTP configuration:
60
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":
71
72   Note that you should specify the drive name `(nd)' in the name of
73the configuration file. This is because you might change the root drive
74before downloading the configuration from the TFTP server when the
75preset menu feature is used (*note Preset Menu::).
76
77   See the manual of your BOOTP/DHCP server for more information. The
78exact syntax should differ a little from the example.
79
80
81File: grub.info,  Node: Serial terminal,  Next: Preset Menu,  Prev: Network,  Up: Top
82
83Using GRUB via a serial line
84****************************
85
86   This chapter describes how to use the serial terminal support in
87GRUB.
88
89   If you have many computers or computers with no display/keyboard, it
90could be very useful to control the computers through serial
91communications. To connect one computer with another via a serial line,
92you need to prepare a null-modem (cross) serial cable, and you may need
93to have multiport serial boards, if your computer doesn't have extra
94serial ports. In addition, a terminal emulator is also required, such as
95minicom. Refer to a manual of your operating system, for more
96information.
97
98   As for GRUB, the instruction to set up a serial terminal is quite
99simple. First of all, make sure that you haven't specified the option
100`--disable-serial' to the configure script when you built your GRUB
101images. If you get them in binary form, probably they have serial
102terminal support already.
103
104   Then, initialize your serial terminal after GRUB starts up. Here is
105an example:
106
107     grub> serial --unit=0 --speed=9600
108     grub> terminal serial
109
110   The command `serial' initializes the serial unit 0 with the speed
1119600bps. The serial unit 0 is usually called `COM1', so, if you want to
112use COM2, you must specify `--unit=1' instead. This command accepts
113many other options, so please refer to *Note serial::, for more details.
114
115   The command `terminal' (*note terminal::) chooses which type of
116terminal you want to use. In the case above, the terminal will be a
117serial terminal, but you can also pass `console' to the command, as
118`terminal serial console'. In this case, a terminal in which you press
119any key will be selected as a GRUB terminal.
120
121   However, note that GRUB assumes that your terminal emulator is
122compatible with VT100 by default. This is true for most terminal
123emulators nowadays, but you should pass the option `--dumb' to the
124command if your terminal emulator is not VT100-compatible or implements
125few VT100 escape sequences. If you specify this option then GRUB
126provides you with an alternative menu interface, because the normal
127menu requires several fancy features of your terminal.
128
129
130File: grub.info,  Node: Preset Menu,  Next: Security,  Prev: Serial terminal,  Up: Top
131
132Embedding a configuration file into GRUB
133****************************************
134
135   GRUB supports a "preset menu" which is to be always loaded before
136starting. The preset menu feature is useful, for example, when your
137computer has no console but a serial cable. In this case, it is
138critical to set up the serial terminal as soon as possible, since you
139cannot see any message until the serial terminal begins to work. So it
140is good to run the commands `serial' (*note serial::) and `terminal'
141(*note terminal::) before anything else at the start-up time.
142
143   How the preset menu works is slightly complicated:
144
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.
148
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.
153
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.
159
160   To enable the preset menu feature, you must rebuild GRUB specifying a
161file to the configure script with the option `--enable-preset-menu'.
162The file has the same semantics as normal configuration files (*note
163Configuration::).
164
165   Another point you should take care is that the diskless support
166(*note Diskless::) diverts the preset menu. Diskless images embed a
167preset menu to execute the command `bootp' (*note bootp::)
168automatically, unless you specify your own preset menu to the configure
169script. This means that you must put commands to initialize a network in
170the preset menu yourself, because diskless images don't set it up
171implicitly, when you use the preset menu explicitly.
172
173   Therefore, a typical preset menu used with diskless support would be
174like this:
175
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
182
183
184File: grub.info,  Node: Security,  Next: Images,  Prev: Preset Menu,  Up: Top
185
186Protecting your computer from cracking
187**************************************
188
189   You may be interested in how to prevent ordinary users from doing
190whatever they like, if you share your computer with other people. So
191this chapter describes how to improve the security of GRUB.
192
193   One thing which could be a security hole is that the user can do too
194many things with GRUB, because GRUB allows one to modify its
195configuration and run arbitrary commands at run-time. For example, the
196user can even read `/etc/passwd' in the command-line interface by the
197command `cat' (*note cat::). So it is necessary to disable all the
198interactive operations.
199
200   Thus, GRUB provides a "password" feature, so that only administrators
201can start the interactive operations (i.e. editing menu entries and
202entering the command-line interface). To use this feature, you need to
203run the command `password' in your configuration file (*note
204password::), like this:
205
206     password --md5 PASSWORD
207
208   If this is specified, GRUB disallows any interactive control, until
209you press the key <p> and enter a correct password.  The option `--md5'
210tells GRUB that `PASSWORD' is in MD5 format.  If it is omitted, GRUB
211assumes the `PASSWORD' is in clear text.
212
213   You can encrypt your password with the command `md5crypt' (*note
214md5crypt::). For example, run the grub shell (*note Invoking the grub
215shell::), and enter your password:
216
217     grub> md5crypt
218     Password: **********
219     Encrypted: $1$U$JK7xFegdxWH6VuppCUSIb.
220
221   Then, cut and paste the encrypted password to your configuration
222file.
223
224   Also, you can specify an optional argument to `password'. See this
225example:
226
227     password PASSWORD /boot/grub/menu-admin.lst
228
229   In this case, GRUB will load `/boot/grub/menu-admin.lst' as a
230configuration file when you enter the valid password.
231
232   Another thing which may be dangerous is that any user can choose any
233menu entry. Usually, this wouldn't be problematic, but you might want to
234permit only administrators to run some of your menu entries, such as an
235entry for booting an insecure OS like DOS.
236
237   GRUB provides the command `lock' (*note lock::). This command always
238fails until you enter the valid password, so you can use it, like this:
239
240     title Boot DOS
241     lock
242     rootnoverify (hd0,1)
243     makeactive
244     chainload +1
245
246   You should insert `lock' right after `title', because any user can
247execute commands in an entry until GRUB encounters `lock'.
248
249   You can also use the command `password' instead of `lock'. In this
250case the boot process will ask for the password and stop if it was
251entered incorrectly.  Since the `password' takes its own PASSWORD
252argument this is useful if you want different passwords for different
253entries.
254
255
256File: grub.info,  Node: Images,  Next: Filesystem,  Prev: Security,  Up: Top
257
258GRUB image files
259****************
260
261   GRUB consists of several images: two essential stages, optional
262stages called "Stage 1.5", one image for bootable CD-ROM, and two
263network boot images. Here is a short overview of them. *Note
264Internals::, for more details.
265
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.
271
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.
276
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.
281
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.
298
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.
302
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)'.
307
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.
313
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.
318
319
320File: grub.info,  Node: Filesystem,  Next: Interface,  Prev: Images,  Up: Top
321
322Filesystem syntax and semantics
323*******************************
324
325   GRUB uses a special syntax for specifying disk drives which can be
326accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish
327between IDE, ESDI, SCSI, or others. You must know yourself which BIOS
328device is equivalent to which OS device. Normally, that will be clear if
329you see the files in a device or use the command `find' (*note find::).
330
331* Menu:
332
333* Device syntax::               How to specify devices
334* File name syntax::            How to specify files
335* Block list syntax::           How to specify block lists
336
337
338File: grub.info,  Node: Device syntax,  Next: File name syntax,  Up: Filesystem
339
340How to specify devices
341======================
342
343   The device syntax is like this:
344
345     `(DEVICE[,PART-NUM][,BSD-SUBPART-LETTER])'
346
347   `[]' means the parameter is optional. DEVICE should be either `fd'
348or `hd' followed by a digit, like `fd0'.  But you can also set DEVICE
349to a hexadecimal or a decimal number which is a BIOS drive number, so
350the following are equivalent:
351
352     (hd0)
353     (0x80)
354     (128)
355
356   PART-NUM represents the partition number of DEVICE, starting from
357zero for primary partitions and from four for extended partitions, and
358BSD-SUBPART-LETTER represents the BSD disklabel subpartition, such as
359`a' or `e'.
360
361   A shortcut for specifying BSD subpartitions is
362`(DEVICE,BSD-SUBPART-LETTER)', in this case, GRUB searches for the
363first PC partition containing a BSD disklabel, then finds the
364subpartition BSD-SUBPART-LETTER. Here is an example:
365
366     (hd0,a)
367
368   The syntax `(hd0)' represents using the entire disk (or the MBR when
369installing GRUB), while the syntax `(hd0,0)' represents using the first
370partition of the disk (or the boot sector of the partition when
371installing GRUB).
372
373   If you enabled the network support, the special drive, `(nd)', is
374also available. Before using the network drive, you must initialize the
375network. *Note Network::, for more information.
376
377   If you boot GRUB from a CD-ROM, `(cd)' is available. *Note Making a
378GRUB bootable CD-ROM::, for details.
379
380
381File: grub.info,  Node: File name syntax,  Next: Block list syntax,  Prev: Device syntax,  Up: Filesystem
382
383How to specify files
384====================
385
386   There are two ways to specify files, by "absolute file name" and by
387"block list".
388
389   An absolute file name resembles a Unix absolute file name, using `/'
390for 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'
392in the first partition of the first hard disk. If you omit the device
393name in an absolute file name, GRUB uses GRUB's "root device"
394implicitly. So if you set the root device to, say, `(hd1,0)' by the
395command `root' (*note root::), then `/boot/kernel' is the same as
396`(hd1,0)/boot/kernel'.
397
398
399File: grub.info,  Node: Block list syntax,  Prev: File name syntax,  Up: Filesystem
400
401How to specify block lists
402==========================
403
404   A block list is used for specifying a file that doesn't appear in the
405filesystem, like a chainloader. The syntax is
406`[OFFSET]+LENGTH[,[OFFSET]+LENGTH]...'.  Here is an example:
407
408     `0+100,200+1,300+300'
409
410   This represents that GRUB should read blocks 0 through 99, block 200,
411and blocks 300 through 599. If you omit an offset, then GRUB assumes
412the offset is zero.
413
414   Like the file name syntax (*note File name syntax::), if a blocklist
415does 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)'.
417
418
419File: grub.info,  Node: Interface,  Next: Commands,  Prev: Filesystem,  Up: Top
420
421GRUB's user interface
422*********************
423
424   GRUB has both a simple menu interface for choosing preset entries
425from a configuration file, and a highly flexible command-line for
426performing any desired combination of boot commands.
427
428   GRUB looks for its configuration file as soon as it is loaded. If one
429is found, then the full menu interface is activated using whatever
430entries were found in the file. If you choose the "command-line" menu
431option, or if the configuration file was not found, then GRUB drops to
432the command-line interface.
433
434* Menu:
435
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
440
441
442File: grub.info,  Node: Command-line interface,  Next: Menu interface,  Up: Interface
443
444The flexible command-line interface
445===================================
446
447   The command-line interface provides a prompt and after it an editable
448text area much like a command-line in Unix or DOS. Each command is
449immediately executed after it is entered(1) (*note Command-line
450interface-Footnote-1::). The commands (*note Command-line and menu
451entry commands::) are a subset of those available in the configuration
452file, used with exactly the same syntax.
453
454   Cursor movement and editing of the text on the line can be done via a
455subset of the functions available in the Bash shell:
456
457<C-f>
458<PC right key>
459     Move forward one character.
460
461<C-b>
462<PC left key>
463     Move back one character.
464
465<C-a>
466<HOME>
467     Move to the start of the line.
468
469<C-e>
470<END>
471     Move the the end of the line.
472
473<C-d>
474<DEL>
475     Delete the character underneath the cursor.
476
477<C-h>
478<BS>
479     Delete the character to the left of the cursor.
480
481<C-k>
482     Kill the text from the current cursor position to the end of the
483     line.
484
485<C-u>
486     Kill backward from the cursor to the beginning of the line.
487
488<C-y>
489     Yank the killed text back into the buffer at the cursor.
490
491<C-p>
492<PC up key>
493     Move up through the history list.
494
495<C-n>
496<PC down key>
497     Move down through the history list.
498
499   When typing commands interactively, if the cursor is within or before
500the first word in the command-line, pressing the <TAB> key (or <C-i>)
501will display a listing of the available commands, and if the cursor is
502after the first word, the `<TAB>' will provide a completion listing of
503disks, partitions, and file names depending on the context. Note that
504to obtain a list of drives, one must open a parenthesis, as `root ('.
505
506   Note that you cannot use the completion functionality in the TFTP
507filesystem. This is because TFTP doesn't support file name listing for
508the security.
509
510
511File: grub.info,  Node: Command-line interface-Footnotes,  Up: Command-line interface
512
513   (1) However, this behavior will be changed in the future version, in
514a user-invisible way.
515
516
517File: grub.info,  Node: Menu interface,  Next: Menu entry editor,  Prev: Command-line interface,  Up: Interface
518
519The simple menu interface
520=========================
521
522   The menu interface is quite easy to use. Its commands are both
523reasonably intuitive and described on screen.
524
525   Basically, the menu interface provides a list of "boot entries" to
526the user to choose from. Use the arrow keys to select the entry of
527choice, then press <RET> to run it.  An optional timeout is available
528to boot the default entry (the first one if not set), which is aborted
529by pressing any key.
530
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
533allows one to return to the menu if desired by pressing <ESC>) or to
534edit any of the "boot entries" by pressing <e>.
535
536   If you protect the menu interface with a password (*note Security::),
537all you can do is choose an entry by pressing <RET>, or press <p> to
538enter the password.
539
540
541File: grub.info,  Node: Menu entry editor,  Next: Hidden menu interface,  Prev: Menu interface,  Up: Interface
542
543Editing a menu entry
544====================
545
546   The menu entry editor looks much like the main menu interface, but
547the lines in the menu are individual commands in the selected entry
548instead of entry names.
549
550   If an <ESC> is pressed in the editor, it aborts all the changes made
551to the configuration entry and returns to the main menu interface.
552
553   When a particular line is selected, the editor places the user in a
554special version of the GRUB command-line to edit that line.  When the
555user hits <RET>, GRUB replaces the line in question in the boot entry
556with the changes (unless it was aborted via <ESC>, in which case the
557changes are thrown away).
558
559   If you want to add a new line to the menu entry, press <o> if adding
560a line after the current line or press <O> if before the current line.
561
562   To delete a line, hit the key <d>. Although GRUB unfortunately does
563not support "undo", you can do almost the same thing by just returning
564to the main menu.
565
566
567File: grub.info,  Node: Hidden menu interface,  Prev: Menu entry editor,  Up: Interface
568
569The hidden menu interface
570=========================
571
572   When your terminal is dumb or you request GRUB to hide the menu
573interface explicitly with the command `hiddenmenu' (*note
574hiddenmenu::), GRUB doesn't show the menu interface (*note Menu
575interface::) and automatically boots the default entry, unless
576interrupted by pressing <ESC>.
577
578   When you interrupt the timeout and your terminal is dumb, GRUB falls
579back to the command-line interface (*note Command-line interface::).
580
581
582File: grub.info,  Node: Commands,  Next: Troubleshooting,  Prev: Interface,  Up: Top
583
584The list of available commands
585******************************
586
587   In this chapter, we list all commands that are available in GRUB.
588
589   Commands belong to different groups. A few can only be used in the
590global section of the configuration file (or "menu"); most of them can
591be entered on the command-line and can be used either anywhere in the
592menu or specifically in the menu entries.
593
594* Menu:
595
596* Menu-specific commands::
597* General commands::
598* Command-line and menu entry commands::
599
600
601File: grub.info,  Node: Menu-specific commands,  Next: General commands,  Up: Commands
602
603The list of commands for the menu only
604======================================
605
606   The semantics used in parsing the configuration file are the
607following:
608
609   * The menu-specific commands have to be used before any others.
610
611   * The files _must_ be in plain-text format.
612
613   * `#' at the beginning of a line in a configuration file means it is
614     only a comment.
615
616   * Options are separated by spaces.
617
618   * All numbers can be either decimal or hexadecimal. A hexadecimal
619     number must be preceded by `0x', and is case-insensitive.
620
621   * Extra options or text at the end of the line are ignored unless
622     otherwise specified.
623
624   * Unrecognized commands are added to the current entry, except
625     before entries start, where they are ignored.
626
627   These commands can only be used in the menu:
628
629* Menu:
630
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
636
637
638File: grub.info,  Node: default,  Next: fallback,  Up: Menu-specific commands
639
640default
641-------
642
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.
647
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.
651
652
653File: grub.info,  Node: fallback,  Next: hiddenmenu,  Prev: default,  Up: Menu-specific commands
654
655fallback
656--------
657
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.
665
666
667File: grub.info,  Node: hiddenmenu,  Next: timeout,  Prev: fallback,  Up: Menu-specific commands
668
669hiddenmenu
670----------
671
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::.
678
679
680File: grub.info,  Node: timeout,  Next: title,  Prev: hiddenmenu,  Up: Menu-specific commands
681
682timeout
683-------
684
685 - Command: timeout sec
686     Set a timeout, in SEC seconds, before automatically booting the
687     default entry (normally the first entry defined).
688
689
690File: grub.info,  Node: title,  Prev: timeout,  Up: Menu-specific commands
691
692title
693-----
694
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.
698
699
700File: grub.info,  Node: General commands,  Next: Command-line and menu entry commands,  Prev: Menu-specific commands,  Up: Commands
701
702The list of general commands
703============================
704
705   Commands usable anywhere in the menu and in the command-line.
706
707* Menu:
708
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
726
727
728File: grub.info,  Node: bootp,  Next: color,  Up: General commands
729
730bootp
731-----
732
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::.
737
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'.
741
742
743File: grub.info,  Node: color,  Next: device,  Prev: bootp,  Up: General commands
744
745color
746-----
747
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:
756
757        * black
758
759        * blue
760
761        * green
762
763        * cyan
764
765        * red
766
767        * magenta
768
769        * brown
770
771        * light-gray
772
773          *These below can be specified only for the foreground.*
774
775        * dark-gray
776
777        * light-blue
778
779        * light-green
780
781        * light-cyan
782
783        * light-red
784
785        * light-magenta
786
787        * yellow
788
789        * white
790
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.
794
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:
798
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
805
806
807File: grub.info,  Node: device,  Next: dhcp,  Prev: color,  Up: General commands
808
809device
810------
811
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:
817
818          grub> device (fd0) /floppy-image
819          grub> device (hd0) /dev/sd0
820
821     This command can be used only in the grub shell (*note Invoking
822     the grub shell::).
823
824
825File: grub.info,  Node: dhcp,  Next: hide,  Prev: device,  Up: General commands
826
827dhcp
828----
829
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::.
835
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'.
839
840
841File: grub.info,  Node: hide,  Next: ifconfig,  Prev: dhcp,  Up: General commands
842
843hide
844----
845
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::.
851
852
853File: grub.info,  Node: ifconfig,  Next: pager,  Prev: hide,  Up: General commands
854
855ifconfig
856--------
857
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::.
865
866
867File: grub.info,  Node: pager,  Next: partnew,  Prev: ifconfig,  Up: General commands
868
869pager
870-----
871
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.
876
877
878File: grub.info,  Node: partnew,  Next: parttype,  Prev: pager,  Up: General commands
879
880partnew
881-------
882
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.
888
889
890File: grub.info,  Node: parttype,  Next: password,  Prev: partnew,  Up: General commands
891
892parttype
893--------
894
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.
899
900
901File: grub.info,  Node: password,  Next: rarp,  Prev: parttype,  Up: General commands
902
903password
904--------
905
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::).
917
918
919File: grub.info,  Node: rarp,  Next: serial,  Prev: password,  Up: General commands
920
921rarp
922----
923
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::.
928
929
930File: grub.info,  Node: serial,  Next: setkey,  Prev: rarp,  Up: General commands
931
932serial
933------
934
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::).
949
950     The serial port is not used as a communication channel unless the
951     `terminal' command is used (*note terminal::).
952
953     This command is only available if GRUB is compiled with serial
954     support. See also *Note Serial terminal::.
955
956
957File: grub.info,  Node: setkey,  Next: terminal,  Prev: serial,  Up: General commands
958
959setkey
960------
961
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:
968
969          grub> setkey capslock control
970          grub> setkey control capslock
971
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:
982
983    `exclam'
984          `!'
985
986    `at'
987          `@'
988
989    `numbersign'
990          `#'
991
992    `dollar'
993          `$'
994
995    `percent'
996          `%'
997
998    `caret'
999          `^'
1000
1001    `ampersand'
1002          `&'
1003
1004    `asterisk'
1005          `*'
1006
1007    `parenleft'
1008          `('
1009
1010    `parenright'
1011          `)'
1012
1013    `minus'
1014          `-'
1015
1016    `underscore'
1017          `_'
1018
1019    `equal'
1020          `='
1021
1022    `plus'
1023          `+'
1024
1025    `bracketleft'
1026          `['
1027
1028    `braceleft'
1029          `{'
1030
1031    `bracketright'
1032          `]'
1033
1034    `braceright'
1035          `}'
1036
1037    `semicolon'
1038          `;'
1039
1040    `colon'
1041          `:'
1042
1043    `quote'
1044          `''
1045
1046    `doublequote'
1047          `"'
1048
1049    `backquote'
1050          ``'
1051
1052    `tilde'
1053          `~'
1054
1055    `backslash'
1056          `\'
1057
1058    `bar'
1059          `|'
1060
1061    `comma'
1062          `,'
1063
1064    `less'
1065          `<'
1066
1067    `period'
1068          `.'
1069
1070    `greater'
1071          `>'
1072
1073    `slash'
1074          `/'
1075
1076    `question'
1077          `?'
1078
1079    `space'
1080          ` '
1081
1082
1083File: grub.info,  Node: terminal,  Next: terminfo,  Prev: setkey,  Up: General commands
1084
1085terminal
1086--------
1087
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::.
1098
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.
1103
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.
1107
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.
1111
1112     The option `--no-echo' has GRUB not to echo back input characters.
1113     This implies the option `--no-edit'.
1114
1115     The option `--no-edit' disables the BASH-like editing feature.
1116
1117
1118File: grub.info,  Node: terminfo,  Next: tftpserver,  Prev: terminal,  Up: General commands
1119
1120terminfo
1121--------
1122
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.
1129
1130     You can use the utility `grub-terminfo' to generate appropriate
1131     arguments to this command. *Note Invoking grub-terminfo::.
1132
1133     If no option is specified, the current settings are printed.
1134
1135
1136File: grub.info,  Node: tftpserver,  Next: unhide,  Prev: terminfo,  Up: General commands
1137
1138tftpserver
1139----------
1140
1141 - Command: tftpserver ipaddr
1142     *Caution:* This command exists only for backward compatibility.
1143     Use `ifconfig' (*note ifconfig::) instead.
1144
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::.
1149
1150
1151File: grub.info,  Node: unhide,  Prev: tftpserver,  Up: General commands
1152
1153unhide
1154------
1155
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::.
1161
1162
1163File: grub.info,  Node: Command-line and menu entry commands,  Prev: General commands,  Up: Commands
1164
1165The list of command-line and menu entry commands
1166================================================
1167
1168   These commands are usable in the command-line and in menu entries.
1169If you forget a command, you can run the command `help' (*note help::).
1170
1171* Menu:
1172
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
1211
1212
1213File: grub.info,  Node: blocklist,  Next: boot,  Up: Command-line and menu entry commands
1214
1215blocklist
1216---------
1217
1218 - Command: blocklist file
1219     Print the block list notation of the file FILE. *Note Block list
1220     syntax::.
1221
1222
1223File: grub.info,  Node: boot,  Next: cat,  Prev: blocklist,  Up: Command-line and menu entry commands
1224
1225boot
1226----
1227
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).
1232
1233
1234File: grub.info,  Node: cat,  Next: chainloader,  Prev: boot,  Up: Command-line and menu entry commands
1235
1236cat
1237---
1238
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:
1242
1243          grub> cat /etc/fstab
1244
1245
1246File: grub.info,  Node: chainloader,  Next: cmp,  Prev: cat,  Up: Command-line and menu entry commands
1247
1248chainloader
1249-----------
1250
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::).
1259
1260
1261File: grub.info,  Node: cmp,  Next: configfile,  Prev: chainloader,  Up: Command-line and menu entry commands
1262
1263cmp
1264---
1265
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:
1269
1270          Differ in size: 0x1234 [foo], 0x4321 [bar]
1271
1272     If the sizes are equal but the bytes at an offset differ, then
1273     print the bytes like this:
1274
1275          Differ at the offset 777: 0xbe [foo], 0xef [bar]
1276
1277     If they are completely identical, nothing will be printed.
1278
1279
1280File: grub.info,  Node: configfile,  Next: debug,  Prev: cmp,  Up: Command-line and menu entry commands
1281
1282configfile
1283----------
1284
1285 - Command: configfile file
1286     Load FILE as a configuration file.
1287
1288
1289File: grub.info,  Node: debug,  Next: displayapm,  Prev: configfile,  Up: Command-line and menu entry commands
1290
1291debug
1292-----
1293
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.
1299
1300
1301File: grub.info,  Node: displayapm,  Next: displaymem,  Prev: debug,  Up: Command-line and menu entry commands
1302
1303displayapm
1304----------
1305
1306 - Command: displayapm
1307     Display APM BIOS information.
1308
1309
1310File: grub.info,  Node: displaymem,  Next: embed,  Prev: displayapm,  Up: Command-line and menu entry commands
1311
1312displaymem
1313----------
1314
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).
1324
1325
1326File: grub.info,  Node: embed,  Next: find,  Prev: displaymem,  Up: Command-line and menu entry commands
1327
1328embed
1329-----
1330
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.
1336
1337     Usually, you don't need to run this command directly. *Note
1338     setup::.
1339
1340
1341File: grub.info,  Node: embed-Footnotes,  Up: embed
1342
1343   (1) The latter feature has not been implemented yet.
1344
1345
1346File: grub.info,  Node: find,  Next: fstest,  Prev: embed,  Up: Command-line and menu entry commands
1347
1348find
1349----
1350
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'.
1356
1357
1358File: grub.info,  Node: fstest,  Next: geometry,  Prev: find,  Up: Command-line and menu entry commands
1359
1360fstest
1361------
1362
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.
1372
1373
1374File: grub.info,  Node: geometry,  Next: halt,  Prev: fstest,  Up: Command-line and menu entry commands
1375
1376geometry
1377--------
1378
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.
1386
1387
1388File: grub.info,  Node: halt,  Next: help,  Prev: geometry,  Up: Command-line and menu entry commands
1389
1390halt
1391----
1392
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.
1397
1398
1399File: grub.info,  Node: help,  Next: impsprobe,  Prev: halt,  Up: Command-line and menu entry commands
1400
1401help
1402----
1403
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.
1410
1411     If you specify any PATTERNS, it displays longer information about
1412     each of the commands which match those PATTERNS.
1413
1414
1415File: grub.info,  Node: impsprobe,  Next: initrd,  Prev: help,  Up: Command-line and menu entry commands
1416
1417impsprobe
1418---------
1419
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.
1425
1426
1427File: grub.info,  Node: initrd,  Next: install,  Prev: impsprobe,  Up: Command-line and menu entry commands
1428
1429initrd
1430------
1431
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::.
1436
1437