Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > 7c5827ede0be8872437edc6bc1c71318 > files > 78

grub2-tools-2.0-0.39.fc17.i686.rpm

<html lang="en">
<head>
<title>GNU GRUB Manual 2.00~beta6</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU GRUB Manual 2.00~beta6">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This manual is for GNU GRUB (version 2.00~beta6,
21 May 2012).

Copyright (C) 1999,2000,2001,2002,2004,2006,2008,2009,2010,2011,2012 Free Software Foundation, Inc.

     Permission is granted to copy, distribute and/or modify this
     document under the terms of the GNU Free Documentation License,
     Version 1.2 or any later version published by the Free Software
     Foundation; with no Invariant Sections.
   -->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<h1 class="settitle">GNU GRUB Manual 2.00~beta6</h1>
   <div class="contents">
<h2>Table of Contents</h2>
<ul>
<li><a name="toc_Top" href="#Top">GNU GRUB manual</a>
<li><a name="toc_Introduction" href="#Introduction">1 Introduction to GRUB</a>
<ul>
<li><a href="#Overview">1.1 Overview</a>
<li><a href="#History">1.2 History of GRUB</a>
<li><a href="#Changes-from-GRUB-Legacy">1.3 Differences from previous versions</a>
<li><a href="#Features">1.4 GRUB features</a>
<li><a href="#Role-of-a-boot-loader">1.5 The role of a boot loader</a>
</li></ul>
<li><a name="toc_Naming-convention" href="#Naming-convention">2 Naming convention</a>
<li><a name="toc_Installation" href="#Installation">3 Installation</a>
<ul>
<li><a href="#Installing-GRUB-using-grub_002dinstall">3.1 Installing GRUB using grub2-install</a>
<li><a href="#Making-a-GRUB-bootable-CD_002dROM">3.2 Making a GRUB bootable CD-ROM</a>
<li><a href="#Device-map">3.3 The map between BIOS drives and OS devices</a>
<li><a href="#BIOS-installation">3.4 BIOS installation</a>
</li></ul>
<li><a name="toc_Booting" href="#Booting">4 Booting</a>
<ul>
<li><a href="#General-boot-methods">4.1 How to boot operating systems</a>
<ul>
<li><a href="#Loading-an-operating-system-directly">4.1.1 How to boot an OS directly with GRUB</a>
<li><a href="#Chain_002dloading">4.1.2 Chain-loading an OS</a>
</li></ul>
<li><a href="#Loopback-booting">4.2 Loopback booting</a>
<li><a href="#OS_002dspecific-notes">4.3 Some caveats on OS-specific issues</a>
<ul>
<li><a href="#GNU_002fHurd">4.3.1 GNU/Hurd</a>
<li><a href="#GNU_002fLinux">4.3.2 GNU/Linux</a>
<li><a href="#DOS_002fWindows">4.3.3 DOS/Windows</a>
</li></ul>
</li></ul>
<li><a name="toc_Configuration" href="#Configuration">5 Writing your own configuration file</a>
<ul>
<li><a href="#Simple-configuration">5.1 Simple configuration handling</a>
<li><a href="#Shell_002dlike-scripting">5.2 Writing full configuration files directly</a>
<li><a href="#Embedded-configuration">5.3 Embedding a configuration file into GRUB</a>
</li></ul>
<li><a name="toc_Theme-file-format" href="#Theme-file-format">6 Theme file format</a>
<ul>
<li><a href="#Theme-file-format">6.1 Introduction</a>
<li><a href="#Theme-file-format">6.2 Theme Elements</a>
<ul>
<li><a href="#Theme-file-format">6.2.1 Colors</a>
<li><a href="#Theme-file-format">6.2.2 Fonts</a>
<li><a href="#Theme-file-format">6.2.3 Progress Bar</a>
<li><a href="#Theme-file-format">6.2.4 Circular Progress Indicator</a>
<li><a href="#Theme-file-format">6.2.5 Labels</a>
<li><a href="#Theme-file-format">6.2.6 Boot Menu</a>
<li><a href="#Theme-file-format">6.2.7 Styled Boxes</a>
<li><a href="#Theme-file-format">6.2.8 Creating Styled Box Images</a>
</li></ul>
<li><a href="#Theme-file-format">6.3 Theme File Manual</a>
<ul>
<li><a href="#Theme-file-format">6.3.1 Global Properties</a>
<li><a href="#Theme-file-format">6.3.2 Format</a>
<li><a href="#Theme-file-format">6.3.3 Global Property List</a>
<li><a href="#Theme-file-format">6.3.4 Component Construction</a>
<li><a href="#Theme-file-format">6.3.5 Component List</a>
<li><a href="#Theme-file-format">6.3.6 Common properties</a>
</li></ul>
</li></ul>
<li><a name="toc_Network" href="#Network">7 Booting GRUB from the network</a>
<li><a name="toc_Serial-terminal" href="#Serial-terminal">8 Using GRUB via a serial line</a>
<li><a name="toc_Vendor-power_002don-keys" href="#Vendor-power_002don-keys">9 Using GRUB with vendor power-on keys</a>
<li><a name="toc_Images" href="#Images">10 GRUB image files</a>
<li><a name="toc_Filesystem" href="#Filesystem">11 Filesystem syntax and semantics</a>
<ul>
<li><a href="#Device-syntax">11.1 How to specify devices</a>
<li><a href="#File-name-syntax">11.2 How to specify files</a>
<li><a href="#Block-list-syntax">11.3 How to specify block lists</a>
</li></ul>
<li><a name="toc_Interface" href="#Interface">12 GRUB's user interface</a>
<ul>
<li><a href="#Command_002dline-interface">12.1 The flexible command-line interface</a>
<li><a href="#Menu-interface">12.2 The simple menu interface</a>
<li><a href="#Menu-entry-editor">12.3 Editing a menu entry</a>
</li></ul>
<li><a name="toc_Environment" href="#Environment">13 GRUB environment variables</a>
<ul>
<li><a href="#Special-environment-variables">13.1 Special environment variables</a>
<ul>
<li><a href="#biosnum">13.1.1 biosnum</a>
<li><a href="#chosen">13.1.2 chosen</a>
<li><a href="#color_005fhighlight">13.1.3 color_highlight</a>
<li><a href="#color_005fnormal">13.1.4 color_normal</a>
<li><a href="#debug">13.1.5 debug</a>
<li><a href="#default">13.1.6 default</a>
<li><a href="#fallback">13.1.7 fallback</a>
<li><a href="#gfxmode">13.1.8 gfxmode</a>
<li><a href="#gfxpayload">13.1.9 gfxpayload</a>
<li><a href="#gfxterm_005ffont">13.1.10 gfxterm_font</a>
<li><a href="#icondir">13.1.11 icondir</a>
<li><a href="#lang">13.1.12 lang</a>
<li><a href="#locale_005fdir">13.1.13 locale_dir</a>
<li><a href="#menu_005fcolor_005fhighlight">13.1.14 menu_color_highlight</a>
<li><a href="#menu_005fcolor_005fnormal">13.1.15 menu_color_normal</a>
<li><a href="#net_005fpxe_005fboot_005ffile">13.1.16 net_pxe_boot_file</a>
<li><a href="#net_005fpxe_005fdhcp_005fserver_005fname">13.1.17 net_pxe_dhcp_server_name</a>
<li><a href="#net_005fpxe_005fdomain">13.1.18 net_pxe_domain</a>
<li><a href="#net_005fpxe_005fextensionspath">13.1.19 net_pxe_extensionspath</a>
<li><a href="#net_005fpxe_005fhostname">13.1.20 net_pxe_hostname</a>
<li><a href="#net_005fpxe_005fip">13.1.21 net_pxe_ip</a>
<li><a href="#net_005fpxe_005fmac">13.1.22 net_pxe_mac</a>
<li><a href="#net_005fpxe_005frootpath">13.1.23 net_pxe_rootpath</a>
<li><a href="#pager">13.1.24 pager</a>
<li><a href="#prefix">13.1.25 prefix</a>
<li><a href="#pxe_005fblksize">13.1.26 pxe_blksize</a>
<li><a href="#pxe_005fdefault_005fgateway">13.1.27 pxe_default_gateway</a>
<li><a href="#pxe_005fdefault_005fserver">13.1.28 pxe_default_server</a>
<li><a href="#root">13.1.29 root</a>
<li><a href="#superusers">13.1.30 superusers</a>
<li><a href="#theme">13.1.31 theme</a>
<li><a href="#timeout">13.1.32 timeout</a>
</li></ul>
<li><a href="#Environment-block">13.2 The GRUB environment block</a>
</li></ul>
<li><a name="toc_Commands" href="#Commands">14 The list of available commands</a>
<ul>
<li><a href="#Menu_002dspecific-commands">14.1 The list of commands for the menu only</a>
<ul>
<li><a href="#menuentry">14.1.1 menuentry</a>
<li><a href="#submenu">14.1.2 submenu</a>
</li></ul>
<li><a href="#General-commands">14.2 The list of general commands</a>
<ul>
<li><a href="#serial">14.2.1 serial</a>
<li><a href="#terminal_005finput">14.2.2 terminal_input</a>
<li><a href="#terminal_005foutput">14.2.3 terminal_output</a>
<li><a href="#terminfo">14.2.4 terminfo</a>
</li></ul>
<li><a href="#Command_002dline-and-menu-entry-commands">14.3 The list of command-line and menu entry commands</a>
<ul>
<li><a href="#acpi">14.3.1 acpi</a>
<li><a href="#badram">14.3.2 badram</a>
<li><a href="#blocklist">14.3.3 blocklist</a>
<li><a href="#boot">14.3.4 boot</a>
<li><a href="#cat">14.3.5 cat</a>
<li><a href="#chainloader">14.3.6 chainloader</a>
<li><a href="#cmp">14.3.7 cmp</a>
<li><a href="#configfile">14.3.8 configfile</a>
<li><a href="#cpuid">14.3.9 cpuid</a>
<li><a href="#crc">14.3.10 crc</a>
<li><a href="#date">14.3.11 date</a>
<li><a href="#drivemap">14.3.12 drivemap</a>
<li><a href="#echo">14.3.13 echo</a>
<li><a href="#export">14.3.14 export</a>
<li><a href="#false">14.3.15 false</a>
<li><a href="#gettext">14.3.16 gettext</a>
<li><a href="#gptsync">14.3.17 gptsync</a>
<li><a href="#halt">14.3.18 halt</a>
<li><a href="#help">14.3.19 help</a>
<li><a href="#initrd">14.3.20 initrd</a>
<li><a href="#initrd16">14.3.21 initrd16</a>
<li><a href="#insmod">14.3.22 insmod</a>
<li><a href="#keystatus">14.3.23 keystatus</a>
<li><a href="#linux">14.3.24 linux</a>
<li><a href="#linux16">14.3.25 linux16</a>
<li><a href="#list_005fenv">14.3.26 list_env</a>
<li><a href="#load_005fenv">14.3.27 load_env</a>
<li><a href="#loopback">14.3.28 loopback</a>
<li><a href="#ls">14.3.29 ls</a>
<li><a href="#normal">14.3.30 normal</a>
<li><a href="#normal_005fexit">14.3.31 normal_exit</a>
<li><a href="#parttool">14.3.32 parttool</a>
<li><a href="#password">14.3.33 password</a>
<li><a href="#password_005fpbkdf2">14.3.34 password_pbkdf2</a>
<li><a href="#play">14.3.35 play</a>
<li><a href="#pxe_005funload">14.3.36 pxe_unload</a>
<li><a href="#read">14.3.37 read</a>
<li><a href="#reboot">14.3.38 reboot</a>
<li><a href="#save_005fenv">14.3.39 save_env</a>
<li><a href="#search">14.3.40 search</a>
<li><a href="#sendkey">14.3.41 sendkey</a>
<li><a href="#set">14.3.42 set</a>
<li><a href="#true">14.3.43 true</a>
<li><a href="#unset">14.3.44 unset</a>
<li><a href="#uppermem">14.3.45 uppermem</a>
</li></ul>
</li></ul>
<li><a name="toc_Internationalisation" href="#Internationalisation">15 Charset</a>
<li><a name="toc_Internationalisation" href="#Internationalisation">16 Filesystems</a>
<li><a name="toc_Internationalisation" href="#Internationalisation">17 Output terminal</a>
<li><a name="toc_Internationalisation" href="#Internationalisation">18 Input terminal</a>
<li><a name="toc_Internationalisation" href="#Internationalisation">19 Gettext</a>
<li><a name="toc_Internationalisation" href="#Internationalisation">20 Regexp</a>
<li><a name="toc_Internationalisation" href="#Internationalisation">21 Other</a>
<li><a name="toc_Security" href="#Security">22 Authentication and authorisation</a>
<li><a name="toc_Platform-limitations" href="#Platform-limitations">23 Platform limitations</a>
<li><a name="toc_Platform_002dspecific-operations" href="#Platform_002dspecific-operations">24 Outline</a>
<li><a name="toc_Supported-kernels" href="#Supported-kernels">25 Supported boot targets</a>
<li><a name="toc_Supported-kernels" href="#Supported-kernels">26 Boot tests</a>
<li><a name="toc_Troubleshooting" href="#Troubleshooting">27 Error messages produced by GRUB</a>
<ul>
<li><a href="#GRUB-only-offers-a-rescue-shell">27.1 GRUB only offers a rescue shell</a>
</li></ul>
<li><a name="toc_Invoking-grub_002dinstall" href="#Invoking-grub_002dinstall">28 Invoking grub2-install</a>
<li><a name="toc_Invoking-grub_002dmkconfig" href="#Invoking-grub_002dmkconfig">29 Invoking grub2-mkconfig</a>
<li><a name="toc_Invoking-grub_002dmkpasswd_002dpbkdf2" href="#Invoking-grub_002dmkpasswd_002dpbkdf2">30 Invoking grub2-mkpasswd-pbkdf2</a>
<li><a name="toc_Invoking-grub_002dmkrescue" href="#Invoking-grub_002dmkrescue">31 Invoking grub2-mkrescue</a>
<li><a name="toc_Invoking-grub_002dprobe" href="#Invoking-grub_002dprobe">32 Invoking grub2-probe</a>
<li><a name="toc_Obtaining-and-Building-GRUB" href="#Obtaining-and-Building-GRUB">Appendix A How to obtain and build GRUB</a>
<li><a name="toc_Reporting-bugs" href="#Reporting-bugs">Appendix B Reporting bugs</a>
<li><a name="toc_Future" href="#Future">Appendix C Where GRUB will go</a>
<li><a name="toc_Copying-This-Manual" href="#Copying-This-Manual">Appendix D Copying This Manual</a>
<ul>
<li><a href="#GNU-Free-Documentation-License">D.1 GNU Free Documentation License</a>
<ul>
<li><a href="#GNU-Free-Documentation-License">D.1.1 ADDENDUM: How to use this License for your documents</a>
</li></ul>
</li></ul>
<li><a name="toc_Index" href="#Index">Index</a>
</li></ul>
</div>



<div class="node">
<a name="Top"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Introduction">Introduction</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>

</div>

<h2 class="unnumbered">GNU GRUB manual</h2>

<p>This is the documentation of GNU GRUB, the GRand Unified Bootloader,
a flexible and powerful boot loader program for a wide range of
architectures.

   <p>This edition documents version 2.00~beta6.

   <p>This manual is for GNU GRUB (version 2.00~beta6,
21 May 2012).

   <p>Copyright &copy; 1999,2000,2001,2002,2004,2006,2008,2009,2010,2011,2012 Free Software Foundation, Inc.

   <blockquote>
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections. 
</blockquote>

<ul class="menu">
<li><a accesskey="1" href="#Introduction">Introduction</a>:                 Capturing the spirit of GRUB
<li><a accesskey="2" href="#Naming-convention">Naming convention</a>:            Names of your drives in GRUB
<li><a accesskey="3" href="#Installation">Installation</a>:                 Installing GRUB on your drive
<li><a accesskey="4" href="#Booting">Booting</a>:                      How to boot different operating systems
<li><a accesskey="5" href="#Configuration">Configuration</a>:                Writing your own configuration file
<li><a accesskey="6" href="#Theme-file-format">Theme file format</a>:            Format of GRUB theme files
<li><a accesskey="7" href="#Network">Network</a>:                      Downloading OS images from a network
<li><a accesskey="8" href="#Serial-terminal">Serial terminal</a>:              Using GRUB via a serial line
<li><a accesskey="9" href="#Vendor-power_002don-keys">Vendor power-on keys</a>:         Changing GRUB behaviour on vendor power-on keys
<li><a href="#Images">Images</a>:                       GRUB image files
<li><a href="#Filesystem">Filesystem</a>:                   Filesystem syntax and semantics
<li><a href="#Interface">Interface</a>:                    The menu and the command-line
<li><a href="#Environment">Environment</a>:                  GRUB environment variables
<li><a href="#Commands">Commands</a>:                     The list of available builtin commands
<li><a href="#Internationalisation">Internationalisation</a>:         Topics relating to language support
<li><a href="#Security">Security</a>:                     Authentication and authorisation
<li><a href="#Platform-limitations">Platform limitations</a>:         The list of platform-specific limitations
<li><a href="#Platform_002dspecific-operations">Platform-specific operations</a>:  Platform-specific operations
<li><a href="#Supported-kernels">Supported kernels</a>:            The list of supported kernels
<li><a href="#Troubleshooting">Troubleshooting</a>:              Error messages produced by GRUB
<li><a href="#Invoking-grub_002dinstall">Invoking grub2-install</a>:        How to use the GRUB installer
<li><a href="#Invoking-grub_002dmkconfig">Invoking grub2-mkconfig</a>:       Generate a GRUB configuration file
<li><a href="#Invoking-grub_002dmkpasswd_002dpbkdf2">Invoking grub2-mkpasswd-pbkdf2</a>
                                Generate GRUB password hashes
<li><a href="#Invoking-grub_002dmkrescue">Invoking grub2-mkrescue</a>:       Make a GRUB rescue image
<li><a href="#Invoking-grub_002dprobe">Invoking grub2-probe</a>:          Probe device information for GRUB
<li><a href="#Obtaining-and-Building-GRUB">Obtaining and Building GRUB</a>:  How to obtain and build GRUB
<li><a href="#Reporting-bugs">Reporting bugs</a>:               Where you should send a bug report
<li><a href="#Future">Future</a>:                       Some future plans on GRUB
<li><a href="#Copying-This-Manual">Copying This Manual</a>:          Copying This Manual
<li><a href="#Index">Index</a>
</ul>

<div class="node">
<a name="Introduction"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Naming-convention">Naming convention</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">1 Introduction to GRUB</h2>

<ul class="menu">
<li><a accesskey="1" href="#Overview">Overview</a>:                     What exactly GRUB is and how to use it
<li><a accesskey="2" href="#History">History</a>:                      From maggot to house fly
<li><a accesskey="3" href="#Changes-from-GRUB-Legacy">Changes from GRUB Legacy</a>:     Differences from previous versions
<li><a accesskey="4" href="#Features">Features</a>:                     GRUB features
<li><a accesskey="5" href="#Role-of-a-boot-loader">Role of a boot loader</a>:        The role of a boot loader
</ul>

<div class="node">
<a name="Overview"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#History">History</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>

</div>

<h3 class="section">1.1 Overview</h3>

<p>Briefly, a <dfn>boot loader</dfn> is the first software program that runs when
a computer starts.  It is responsible for loading and transferring
control to an operating system <dfn>kernel</dfn> software (such as Linux or
GNU Mach).  The kernel, in turn, initializes the rest of the operating
system (e.g. a GNU system).

   <p>GNU GRUB is a very powerful boot loader, which can load a wide variety
of free operating systems, as well as proprietary operating systems with
chain-loading<a rel="footnote" href="#fn-1" name="fnd-1"><sup>1</sup></a>. GRUB is designed to
address the complexity of booting a personal computer; both the
program and this manual are tightly bound to that computer platform,
although porting to other platforms may be addressed in the future.

   <p>One of the important features in GRUB is flexibility; GRUB understands
filesystems and kernel executable formats, so you can load an arbitrary
operating system the way you like, without recording the physical
position of your kernel on the disk. Thus you can load the kernel
just by specifying its file name and the drive and partition where the
kernel resides.

   <p>When booting with GRUB, you can use either a command-line interface
(see <a href="#Command_002dline-interface">Command-line interface</a>), or a menu interface (see <a href="#Menu-interface">Menu interface</a>). Using the command-line interface, you type the drive
specification and file name of the kernel manually. In the menu
interface, you just select an OS using the arrow keys. The menu is
based on a configuration file which you prepare beforehand
(see <a href="#Configuration">Configuration</a>). While in the menu, you can switch to the
command-line mode, and vice-versa. You can even edit menu entries
before using them.

   <p>In the following chapters, you will learn how to specify a drive, a
partition, and a file name (see <a href="#Naming-convention">Naming convention</a>) to GRUB, how to
install GRUB on your drive (see <a href="#Installation">Installation</a>), and how to boot your
OSes (see <a href="#Booting">Booting</a>), step by step.

<div class="node">
<a name="History"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Changes-from-GRUB-Legacy">Changes from GRUB Legacy</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Overview">Overview</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>

</div>

<h3 class="section">1.2 History of GRUB</h3>

<p>GRUB originated in 1995 when Erich Boleyn was trying to boot the GNU
Hurd with the University of Utah's Mach 4 microkernel (now known as GNU
Mach).  Erich and Brian Ford designed the Multiboot Specification
(see <a href="multiboot.html#Top">Multiboot Specification</a>), because they were determined not to add to the large
number of mutually-incompatible PC boot methods.

   <p>Erich then began modifying the FreeBSD boot loader so that it would
understand Multiboot. He soon realized that it would be a lot easier
to write his own boot loader from scratch than to keep working on the
FreeBSD boot loader, and so GRUB was born.

   <p>Erich added many features to GRUB, but other priorities prevented him
from keeping up with the demands of its quickly-expanding user base. In
1999, Gordon Matzigkeit and Yoshinori K. Okuji adopted GRUB as an
official GNU package, and opened its development by making the latest
sources available via anonymous CVS. See <a href="#Obtaining-and-Building-GRUB">Obtaining and Building GRUB</a>, for more information.

   <p>Over the next few years, GRUB was extended to meet many needs, but it
quickly became clear that its design was not keeping up with the extensions
being made to it, and we reached the point where it was very difficult to
make any further changes without breaking existing features.  Around 2002,
Yoshinori K. Okuji started work on PUPA (Preliminary Universal Programming
Architecture for GNU GRUB), aiming to rewrite the core of GRUB to make it
cleaner, safer, more robust, and more powerful.  PUPA was eventually renamed
to GRUB 2, and the original version of GRUB was renamed to GRUB Legacy. 
Small amounts of maintenance continued to be done on GRUB Legacy, but the
last release (0.97) was made in 2005 and at the time of writing it seems
unlikely that there will be another.

   <p>By around 2007, GNU/Linux distributions started to use GRUB 2 to limited
extents, and by the end of 2009 multiple major distributions were installing
it by default.

<div class="node">
<a name="Changes-from-GRUB-Legacy"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Features">Features</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#History">History</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>

</div>

<h3 class="section">1.3 Differences from previous versions</h3>

<p>GRUB 2 is a rewrite of GRUB (see <a href="#History">History</a>), although it shares many
characteristics with the previous version, now known as GRUB Legacy.  Users
of GRUB Legacy may need some guidance to find their way around this new
version.

     <ul>
<li>The configuration file has a new name (<samp><span class="file">grub.cfg</span></samp> rather than
<samp><span class="file">menu.lst</span></samp> or <samp><span class="file">grub.conf</span></samp>), new syntax (see <a href="#Configuration">Configuration</a>) and
many new commands (see <a href="#Commands">Commands</a>).  Configuration cannot be copied over
directly, although most GRUB Legacy users should not find the syntax too
surprising.

     <li><samp><span class="file">grub.cfg</span></samp> is typically automatically generated by
<samp><span class="command">grub2-mkconfig</span></samp> (see <a href="#Simple-configuration">Simple configuration</a>).  This makes it
easier to handle versioned kernel upgrades.

     <li>Partition numbers in GRUB device names now start at 1, not 0 (see <a href="#Naming-convention">Naming convention</a>).

     <li>The configuration file is now written in something closer to a full
scripting language: variables, conditionals, and loops are available.

     <li>A small amount of persistent storage is available across reboots, using the
<samp><span class="command">save_env</span></samp> and <samp><span class="command">load_env</span></samp> commands in GRUB and the
<samp><span class="command">grub2-editenv</span></samp> utility.  This is not available in all configurations
(see <a href="#Environment-block">Environment block</a>).

     <li>GRUB 2 has more reliable ways to find its own files and those of target
kernels on multiple-disk systems, and has commands (see <a href="#search">search</a>) to find
devices using file system labels or Universally Unique Identifiers (UUIDs).

     <li>GRUB 2 is available for several other types of system in addition to the PC
BIOS systems supported by GRUB Legacy: PC EFI, PC coreboot, PowerPC, SPARC,
and MIPS Lemote Yeeloong are all supported.

     <li>Many more file systems are supported, including but not limited to ext4,
HFS+, and NTFS.

     <li>GRUB 2 can read files directly from LVM and RAID devices.

     <li>A graphical terminal and a graphical menu system are available.

     <li>GRUB 2's interface can be translated, including menu entry names.

     <li>The image files (see <a href="#Images">Images</a>) that make up GRUB have been reorganised;
Stage 1, Stage 1.5, and Stage 2 are no more.

     <li>GRUB 2 puts many facilities in dynamically loaded modules, allowing the core
image to be smaller, and allowing the core image to be built in more
flexible ways. 
</ul>

<div class="node">
<a name="Features"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Role-of-a-boot-loader">Role of a boot loader</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Changes-from-GRUB-Legacy">Changes from GRUB Legacy</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>

</div>

<h3 class="section">1.4 GRUB features</h3>

<p>The primary requirement for GRUB is that it be compliant with the
<dfn>Multiboot Specification</dfn>, which is described in <a href="multiboot.html#Top">Multiboot Specification</a>.

   <p>The other goals, listed in approximate order of importance, are:

     <ul>
<li>Basic functions must be straightforward for end-users.

     <li>Rich functionality to support kernel experts and designers.

     <li>Backward compatibility for booting FreeBSD, NetBSD, OpenBSD, and
Linux. Proprietary kernels (such as DOS, Windows NT, and OS/2) are
supported via a chain-loading function. 
</ul>

   <p>Except for specific compatibility modes (chain-loading and the Linux
<dfn>piggyback</dfn> format), all kernels will be started in much the same
state as in the Multiboot Specification. Only kernels loaded at 1 megabyte
or above are presently supported. Any attempt to load below that
boundary will simply result in immediate failure and an error message
reporting the problem.

   <p>In addition to the requirements above, GRUB has the following features
(note that the Multiboot Specification doesn't require all the features
that GRUB supports):

     <dl>
<dt>Recognize multiple executable formats<dd>Support many of the <dfn>a.out</dfn> variants plus <dfn>ELF</dfn>. Symbol
tables are also loaded.

     <br><dt>Support non-Multiboot kernels<dd>Support many of the various free 32-bit kernels that lack Multiboot
compliance (primarily FreeBSD, NetBSD, OpenBSD, and
Linux). Chain-loading of other boot loaders is also supported.

     <br><dt>Load multiples modules<dd>Fully support the Multiboot feature of loading multiple modules.

     <br><dt>Load a configuration file<dd>Support a human-readable text configuration file with preset boot
commands. You can also load another configuration file dynamically and
embed a preset configuration file in a GRUB image file. The list of
commands (see <a href="#Commands">Commands</a>) are a superset of those supported on the
command-line. An example configuration file is provided in
<a href="#Configuration">Configuration</a>.

     <br><dt>Provide a menu interface<dd>A menu interface listing preset boot commands, with a programmable
timeout, is available. There is no fixed limit on the number of boot
entries, and the current implementation has space for several hundred.

     <br><dt>Have a flexible command-line interface<dd>A fairly flexible command-line interface, accessible from the menu,
is available to edit any preset commands, or write a new boot command
set from scratch. If no configuration file is present, GRUB drops to
the command-line.

     <p>The list of commands (see <a href="#Commands">Commands</a>) are a subset of those supported
for configuration files. Editing commands closely resembles the Bash
command-line (see <a href="features.html#Command-Line-Editing">Bash</a>), with &lt;TAB&gt;-completion of commands,
devices, partitions, and files in a directory depending on context.

     <br><dt>Support multiple filesystem types<dd>Support multiple filesystem types transparently, plus a useful explicit
blocklist notation. The currently supported filesystem types are <dfn>Amiga
Fast FileSystem (AFFS)</dfn>, <dfn>AtheOS fs</dfn>, <dfn>BeFS</dfn>,
<dfn>BtrFS</dfn> (including raid0, raid1, raid10, gzip and lzo),
<dfn>cpio</dfn> (little- and big-endian bin, odc and newc variants),
<dfn>Linux ext2/ext3/ext4</dfn>, <dfn>DOS FAT12/FAT16/FAT32</dfn>, <dfn>exFAT</dfn>, <dfn>HFS</dfn>,
<dfn>HFS+</dfn>, <dfn>ISO9660</dfn> (including Joliet, Rock-ridge and multi-chunk files),
<dfn>JFS</dfn>, <dfn>Minix fs</dfn> (versions 1, 2 and 3), <dfn>nilfs2</dfn>,
<dfn>NTFS</dfn> (including compression), <dfn>ReiserFS</dfn>, <dfn>ROMFS</dfn>,
<dfn>Amiga Smart FileSystem (SFS)</dfn>, <dfn>Squash4</dfn>, <dfn>tar</dfn>, <dfn>UDF</dfn>,
<dfn>BSD UFS/UFS2</dfn>, <dfn>XFS</dfn>, and <dfn>ZFS</dfn> (including lzjb, gzip,
zle, mirror, stripe, raidz1/2/3 and encryption in AES-CCM and AES-GCM). 
See <a href="#Filesystem">Filesystem</a>, for more information.

     <br><dt>Support automatic decompression<dd>Can decompress files which were compressed by <samp><span class="command">gzip</span></samp> or
<samp><span class="command">xz</span></samp><a rel="footnote" href="#fn-2" name="fnd-2"><sup>2</sup></a>. This function is both automatic and transparent to the user
(i.e. all functions operate upon the uncompressed contents of the specified
files). This greatly reduces a file size and loading time, a
particularly great benefit for floppies.<a rel="footnote" href="#fn-3" name="fnd-3"><sup>3</sup></a>

     <p>It is conceivable that some kernel modules should be loaded in a
compressed state, so a different module-loading command can be specified
to avoid uncompressing the modules.

     <br><dt>Access data on any installed device<dd>Support reading data from any or all floppies or hard disk(s) recognized
by the BIOS, independent of the setting of the root device.

     <br><dt>Be independent of drive geometry translations<dd>Unlike many other boot loaders, GRUB makes the particular drive
translation irrelevant. A drive installed and running with one
translation may be converted to another translation without any adverse
effects or changes in GRUB's configuration.

     <br><dt>Detect all installed <span class="sc">ram</span><dd>GRUB can generally find all the installed <span class="sc">ram</span> on a PC-compatible
machine. It uses an advanced BIOS query technique for finding all
memory regions. As described on the Multiboot Specification (see <a href="multiboot.html#Top">Multiboot Specification</a>), not all kernels make use of this information, but GRUB
provides it for those who do.

     <br><dt>Support Logical Block Address mode<dd>In traditional disk calls (called <dfn>CHS mode</dfn>), there is a geometry
translation problem, that is, the BIOS cannot access over 1024
cylinders, so the accessible space is limited to at least 508 MB and to
at most 8GB. GRUB can't universally solve this problem, as there is no
standard interface used in all machines. However, several newer machines
have the new interface, Logical Block Address (<dfn>LBA</dfn>) mode. GRUB
automatically detects if LBA mode is available and uses it if
available. In LBA mode, GRUB can access the entire disk.

     <br><dt>Support network booting<dd>GRUB is basically a disk-based boot loader but also has network
support. You can load OS images from a network by using the <dfn>TFTP</dfn>
protocol.

     <br><dt>Support remote terminals<dd>To support computers with no console, GRUB provides remote terminal
support, so that you can control GRUB from a remote host. Only serial
terminal support is implemented at the moment. 
</dl>

<div class="node">
<a name="Role-of-a-boot-loader"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Features">Features</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>

</div>

<h3 class="section">1.5 The role of a boot loader</h3>

<p>The following is a quotation from Gordon Matzigkeit, a GRUB fanatic:

   <blockquote>
Some people like to acknowledge both the operating system and kernel when
they talk about their computers, so they might say they use
&ldquo;GNU/Linux&rdquo; or &ldquo;GNU/Hurd&rdquo;.  Other people seem to think that the
kernel is the most important part of the system, so they like to call
their GNU operating systems &ldquo;Linux systems.&rdquo;

   <p>I, personally, believe that this is a grave injustice, because the
<em>boot loader</em> is the most important software of all. I used to
refer to the above systems as either &ldquo;LILO&rdquo;<a rel="footnote" href="#fn-4" name="fnd-4"><sup>4</sup></a> or &ldquo;GRUB&rdquo;
systems.

   <p>Unfortunately, nobody ever understood what I was talking about; now I
just use the word &ldquo;GNU&rdquo; as a pseudonym for GRUB.

   <p>So, if you ever hear people talking about their alleged &ldquo;GNU&rdquo; systems,
remember that they are actually paying homage to the best boot loader
around<small class="dots">...</small> GRUB! 
</blockquote>

   <p>We, the GRUB maintainers, do not (usually) encourage Gordon's level of
fanaticism, but it helps to remember that boot loaders deserve
recognition.  We hope that you enjoy using GNU GRUB as much as we did
writing it.

<div class="node">
<a name="Naming-convention"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Installation">Installation</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">2 Naming convention</h2>

<p>The device syntax used in GRUB is a wee bit different from what you may
have seen before in your operating system(s), and you need to know it so
that you can specify a drive/partition.

   <p>Look at the following examples and explanations:

<pre class="example">     (fd0)
</pre>
   <p>First of all, GRUB requires that the device name be enclosed with
&lsquo;<samp><span class="samp">(</span></samp>&rsquo; and &lsquo;<samp><span class="samp">)</span></samp>&rsquo;. The &lsquo;<samp><span class="samp">fd</span></samp>&rsquo; part means that it is a floppy
disk. The number &lsquo;<samp><span class="samp">0</span></samp>&rsquo; is the drive number, which is counted from
<em>zero</em>. This expression means that GRUB will use the whole floppy
disk.

<pre class="example">     (hd0,msdos2)
</pre>
   <p>Here, &lsquo;<samp><span class="samp">hd</span></samp>&rsquo; means it is a hard disk drive. The first integer
&lsquo;<samp><span class="samp">0</span></samp>&rsquo; indicates the drive number, that is, the first hard disk,
the string &lsquo;<samp><span class="samp">msdos</span></samp>&rsquo; indicates the partition scheme, while
the second integer, &lsquo;<samp><span class="samp">2</span></samp>&rsquo;, indicates the partition number (or the
<span class="sc">pc</span> slice number in the BSD terminology). The partition numbers are
counted from <em>one</em>, not from zero (as was the case in previous
versions of GRUB). This expression means the second partition of the
first hard disk drive. In this case, GRUB uses one partition of the
disk, instead of the whole disk.

<pre class="example">     (hd0,msdos5)
</pre>
   <p>This specifies the first <dfn>extended partition</dfn> of the first hard disk
drive. Note that the partition numbers for extended partitions are
counted from &lsquo;<samp><span class="samp">5</span></samp>&rsquo;, regardless of the actual number of primary
partitions on your hard disk.

<pre class="example">     (hd1,msdos1,bsd1)
</pre>
   <p>This means the BSD &lsquo;<samp><span class="samp">a</span></samp>&rsquo; partition on first <span class="sc">pc</span> slice number
of the second hard disk.

   <p>Of course, to actually access the disks or partitions with GRUB, you
need to use the device specification in a command, like &lsquo;<samp><span class="samp">set
root=(fd0)</span></samp>&rsquo; or &lsquo;<samp><span class="samp">parttool (hd0,msdos3) hidden-</span></samp>&rsquo;. To help you find out
which number specifies a partition you want, the GRUB command-line
(see <a href="#Command_002dline-interface">Command-line interface</a>) options have argument
completion. This means that, for example, you only need to type

<pre class="example">     set root=(
</pre>
   <p>followed by a &lt;TAB&gt;, and GRUB will display the list of drives,
partitions, or file names. So it should be quite easy to determine the
name of your target partition, even with minimal knowledge of the
syntax.

   <p>Note that GRUB does <em>not</em> distinguish IDE from SCSI - it simply
counts the drive numbers from zero, regardless of their type. Normally,
any IDE drive number is less than any SCSI drive number, although that
is not true if you change the boot sequence by swapping IDE and SCSI
drives in your BIOS.

   <p>Now the question is, how to specify a file? Again, consider an
example:

<pre class="example">     (hd0,msdos1)/vmlinuz
</pre>
   <p>This specifies the file named &lsquo;<samp><span class="samp">vmlinuz</span></samp>&rsquo;, found on the first
partition of the first hard disk drive. Note that the argument
completion works with file names, too.

   <p>That was easy, admit it. Now read the next chapter, to find out how to
actually install GRUB on your drive.

<div class="node">
<a name="Installation"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Booting">Booting</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Naming-convention">Naming convention</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">3 Installation</h2>

<p>In order to install GRUB as your boot loader, you need to first
install the GRUB system and utilities under your UNIX-like operating
system (see <a href="#Obtaining-and-Building-GRUB">Obtaining and Building GRUB</a>). You can do this either
from the source tarball, or as a package for your OS.

   <p>After you have done that, you need to install the boot loader on a
drive (floppy or hard disk) by using the utility
<samp><span class="command">grub2-install</span></samp> (see <a href="#Invoking-grub_002dinstall">Invoking grub2-install</a>) on a UNIX-like OS.

   <p>GRUB comes with boot images, which are normally put in the directory
<samp><span class="file">/usr/lib/grub/&lt;cpu&gt;-&lt;platform&gt;</span></samp> (for BIOS-based machines
<samp><span class="file">/usr/lib/grub/i386-pc</span></samp>). Hereafter, the directory where GRUB images are
initially placed (normally <samp><span class="file">/usr/lib/grub/&lt;cpu&gt;-&lt;platform&gt;</span></samp>) will be
called the <dfn>image directory</dfn>, and the directory where the boot
loader needs to find them (usually <samp><span class="file">/boot</span></samp>) will be called
the <dfn>boot directory</dfn>.

<ul class="menu">
<li><a accesskey="1" href="#Installing-GRUB-using-grub_002dinstall">Installing GRUB using grub2-install</a>
<li><a accesskey="2" href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>
<li><a accesskey="3" href="#Device-map">Device map</a>
<li><a accesskey="4" href="#BIOS-installation">BIOS installation</a>
</ul>

<div class="node">
<a name="Installing-GRUB-using-grub-install"></a>
<a name="Installing-GRUB-using-grub_002dinstall"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>

</div>

<h3 class="section">3.1 Installing GRUB using grub2-install</h3>

<p>For information on where GRUB should be installed on PC BIOS platforms,
see <a href="#BIOS-installation">BIOS installation</a>.

   <p>In order to install GRUB under a UNIX-like OS (such
as <span class="sc">gnu</span>), invoke the program <samp><span class="command">grub2-install</span></samp> (see <a href="#Invoking-grub_002dinstall">Invoking grub2-install</a>) as the superuser (<dfn>root</dfn>).

   <p>The usage is basically very simple. You only need to specify one
argument to the program, namely, where to install the boot loader. The
argument has to be either a device file (like &lsquo;<samp><span class="samp">/dev/hda</span></samp>&rsquo;). 
For example, under Linux the following will install GRUB into the MBR
of the first IDE disk:

<pre class="example">     # <kbd>grub2-install /dev/hda</kbd>
</pre>
   <p>Likewise, under GNU/Hurd, this has the same effect:

<pre class="example">     # <kbd>grub2-install /dev/hd0</kbd>
</pre>
   <p>But all the above examples assume that GRUB should put images under
the <samp><span class="file">/boot</span></samp> directory. If you want GRUB to put images under a directory
other than <samp><span class="file">/boot</span></samp>, you need to specify the option
<samp><span class="option">--boot-directory</span></samp>. The typical usage is that you create a GRUB
boot floppy with a filesystem. Here is an example:

<pre class="example">     # <kbd>mke2fs /dev/fd0</kbd>
     # <kbd>mount -t ext2 /dev/fd0 /mnt</kbd>
     # <kbd>mkdir /mnt/boot</kbd>
     # <kbd>grub2-install --boot-directory=/mnt/boot /dev/fd0</kbd>
     # <kbd>umount /mnt</kbd>
</pre>
   <p>Some BIOSes have a bug of exposing the first partition of a USB drive as a
floppy instead of exposing the USB drive as a hard disk (they call it
&ldquo;USB-FDD&rdquo; boot). In such cases, you need to install like this:

<pre class="example">     # <kbd>losetup /dev/loop0 /dev/sdb1</kbd>
     # <kbd>mount /dev/loop0 /mnt/usb</kbd>
     # <kbd>grub2-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0</kbd>
</pre>
   <p>This install doesn't conflict with standard install as long as they are in
separate directories.

   <p>Note that <samp><span class="command">grub2-install</span></samp> is actually just a shell script and the
real task is done by <samp><span class="command">grub2-mkimage</span></samp> and <samp><span class="command">grub2-setup</span></samp>. 
Therefore, you may run those commands directly to install GRUB, without
using <samp><span class="command">grub2-install</span></samp>. Don't do that, however, unless you are very
familiar with the internals of GRUB. Installing a boot loader on a running
OS may be extremely dangerous.

<div class="node">
<a name="Making-a-GRUB-bootable-CD-ROM"></a>
<a name="Making-a-GRUB-bootable-CD_002dROM"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Device-map">Device map</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Installing-GRUB-using-grub_002dinstall">Installing GRUB using grub2-install</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>

</div>

<h3 class="section">3.2 Making a GRUB bootable CD-ROM</h3>

<p>GRUB supports the <dfn>no emulation mode</dfn> in the El Torito
specification<a rel="footnote" href="#fn-5" name="fnd-5"><sup>5</sup></a>. This means that you can use the whole CD-ROM
from GRUB and you don't have to make a floppy or hard disk image file,
which can cause compatibility problems.

   <p>For booting from a CD-ROM, GRUB uses a special image called
<samp><span class="file">cdboot.img</span></samp>, which is concatenated with <samp><span class="file">core.img</span></samp>. The
<samp><span class="file">core.img</span></samp> used for this should be built with at least the
&lsquo;<samp><span class="samp">iso9660</span></samp>&rsquo; and &lsquo;<samp><span class="samp">biosdisk</span></samp>&rsquo; modules. Your bootable CD-ROM will
usually also need to include a configuration file <samp><span class="file">grub.cfg</span></samp> and some
other GRUB modules.

   <p>To make a simple generic GRUB rescue CD, you can use the
<samp><span class="command">grub2-mkrescue</span></samp> program (see <a href="#Invoking-grub_002dmkrescue">Invoking grub2-mkrescue</a>):

<pre class="example">     $ <kbd>grub2-mkrescue -o grub.iso</kbd>
</pre>
   <p>You will often need to include other files in your image. To do this, first
make a top directory for the bootable image, say, &lsquo;<samp><span class="samp">iso</span></samp>&rsquo;:

<pre class="example">     $ <kbd>mkdir iso</kbd>
</pre>
   <p>Make a directory for GRUB:

<pre class="example">     $ <kbd>mkdir -p iso/boot/grub</kbd>
</pre>
   <p>If desired, make the config file <samp><span class="file">grub.cfg</span></samp> under <samp><span class="file">iso/boot/grub</span></samp>
(see <a href="#Configuration">Configuration</a>), and copy any files and directories for the disc to the
directory <samp><span class="file">iso/</span></samp>.

   <p>Finally, make the image:

<pre class="example">     $ <kbd>grub2-mkrescue -o grub.iso iso</kbd>
</pre>
   <p>This produces a file named <samp><span class="file">grub.iso</span></samp>, which then can be burned
into a CD (or a DVD), or written to a USB mass storage device.

   <p>The root device will be set up appropriately on entering your
<samp><span class="file">grub.cfg</span></samp> configuration file, so you can refer to file names on the CD
without needing to use an explicit device name. This makes it easier to
produce rescue images that will work on both optical drives and USB mass
storage devices.

<div class="node">
<a name="Device-map"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#BIOS-installation">BIOS installation</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>

</div>

<h3 class="section">3.3 The map between BIOS drives and OS devices</h3>

<p>If the device map file exists, the GRUB utilities (<samp><span class="command">grub2-probe</span></samp>,
<samp><span class="command">grub2-setup</span></samp>, etc.) read it to map BIOS drives to OS devices.  This
file consists of lines like this:

<pre class="example">     (<var>device</var>) <var>file</var>
</pre>
   <p><var>device</var> is a drive specified in the GRUB syntax (see <a href="#Device-syntax">Device syntax</a>), and <var>file</var> is an OS file, which is normally a device file.

   <p>Historically, the device map file was used because GRUB device names had to
be used in the configuration file, and they were derived from BIOS drive
numbers.  The map between BIOS drives and OS devices cannot always be
guessed correctly: for example, GRUB will get the order wrong if you
exchange the boot sequence between IDE and SCSI in your BIOS.

   <p>Unfortunately, even OS device names are not always stable.  Modern versions
of the Linux kernel may probe drives in a different order from boot to boot,
and the prefix (<samp><span class="file">/dev/hd*</span></samp> versus <samp><span class="file">/dev/sd*</span></samp>) may change depending
on the driver subsystem in use.  As a result, the device map file required
frequent editing on some systems.

   <p>GRUB avoids this problem nowadays by using UUIDs or file system labels when
generating <samp><span class="file">grub.cfg</span></samp>, and we advise that you do the same for any
custom menu entries you write.  If the device map file does not exist, then
the GRUB utilities will assume a temporary device map on the fly.  This is
often good enough, particularly in the common case of single-disk systems.

   <p>However, the device map file is not entirely obsolete yet, and it is
used for overriding when current environment is different from the one on boot. 
Most common case is if you use a partition or logical volume as a disk for
virtual machine.  You can put any comments in the file if needed,
as the GRUB utilities assume that a line is just a comment if
the first character is &lsquo;<samp><span class="samp">#</span></samp>&rsquo;.

<div class="node">
<a name="BIOS-installation"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Device-map">Device map</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>

</div>

<h3 class="section">3.4 BIOS installation</h3>

<h3 class="heading">MBR</h3>

<p>The partition table format traditionally used on PC BIOS platforms is called
the Master Boot Record (MBR) format; this is the format that allows up to
four primary partitions and additional logical partitions.  With this
partition table format, there are two ways to install GRUB: it can be
embedded in the area between the MBR and the first partition (called by
various names, such as the "boot track", "MBR gap", or "embedding area", and
which is usually at least 31 KiB), or the core image can be installed in a
file system and a list of the blocks that make it up can be stored in the
first sector of that partition.

   <p>Each of these has different problems.  There is no way to reserve space in
the embedding area with complete safety, and some proprietary software is
known to use it to make it difficult for users to work around licensing
restrictions; and systems are sometimes partitioned without leaving enough
space before the first partition.  On the other hand, installing to a
filesystem means that GRUB is vulnerable to its blocks being moved around by
filesystem features such as tail packing, or even by aggressive fsck
implementations, so this approach is quite fragile; and this approach can
only be used if the <samp><span class="file">/boot</span></samp> filesystem is on the same disk that the
BIOS boots from, so that GRUB does not have to rely on guessing BIOS drive
numbers.

   <p>The GRUB development team generally recommends embedding GRUB before the
first partition, unless you have special requirements.  You must ensure that
the first partition starts at least 31 KiB (63 sectors) from the start of
the disk; on modern disks, it is often a performance advantage to align
partitions on larger boundaries anyway, so the first partition might start 1
MiB from the start of the disk.

<h3 class="heading">GPT</h3>

<p>Some newer systems use the GUID Partition Table (GPT) format.  This was
specified as part of the Extensible Firmware Interface (EFI), but it can
also be used on BIOS platforms if system software supports it; for example,
GRUB and GNU/Linux can be used in this configuration.  With this format, it
is possible to reserve a whole partition for GRUB, called the BIOS Boot
Partition.  GRUB can then be embedded into that partition without the risk
of being overwritten by other software and without being contained in a
filesystem which might move its blocks around.

   <p>When creating a BIOS Boot Partition on a GPT system, you should make sure
that it is at least 31 KiB in size.  (GPT-formatted disks are not usually
particularly small, so we recommend that you make it larger than the bare
minimum, such as 1 MiB, to allow plenty of room for growth.)  You must also
make sure that it has the proper partition type.  Using GNU Parted, you can
set this using a command such as the following:

<pre class="example">     # <kbd>parted /dev/</kbd><var>disk</var><kbd> set </kbd><var>partition-number</var><kbd> bios_grub on</kbd>
</pre>
   <p>If you are using gdisk, set the partition type to &lsquo;<samp><span class="samp">0xEF02</span></samp>&rsquo;.  With
partitioning programs that require setting the GUID directly, it should be
&lsquo;<samp><span class="samp">21686148-6449-6e6f-744e656564454649</span></samp>&rsquo;.

   <p><strong>Caution:</strong> Be very careful which partition you select!  When GRUB
finds a BIOS Boot Partition during installation, it will automatically
overwrite part of it.  Make sure that the partition does not contain any
other data.

<div class="node">
<a name="Booting"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Configuration">Configuration</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Installation">Installation</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">4 Booting</h2>

<p>GRUB can load Multiboot-compliant kernels in a consistent way,
but for some free operating systems you need to use some OS-specific
magic.

<ul class="menu">
<li><a accesskey="1" href="#General-boot-methods">General boot methods</a>:         How to boot OSes with GRUB generally
<li><a accesskey="2" href="#Loopback-booting">Loopback booting</a>:             Notes on booting from loopbacks
<li><a accesskey="3" href="#OS_002dspecific-notes">OS-specific notes</a>:            Notes on some operating systems
</ul>

<div class="node">
<a name="General-boot-methods"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Loopback-booting">Loopback booting</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Booting">Booting</a>

</div>

<h3 class="section">4.1 How to boot operating systems</h3>

<p>GRUB has two distinct boot methods. One of the two is to load an
operating system directly, and the other is to chain-load another boot
loader which then will load an operating system actually. Generally
speaking, the former is more desirable, because you don't need to
install or maintain other boot loaders and GRUB is flexible enough to
load an operating system from an arbitrary disk/partition. However,
the latter is sometimes required, since GRUB doesn't support all the
existing operating systems natively.

<ul class="menu">
<li><a accesskey="1" href="#Loading-an-operating-system-directly">Loading an operating system directly</a>
<li><a accesskey="2" href="#Chain_002dloading">Chain-loading</a>
</ul>

<div class="node">
<a name="Loading-an-operating-system-directly"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Chain_002dloading">Chain-loading</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#General-boot-methods">General boot methods</a>

</div>

<h4 class="subsection">4.1.1 How to boot an OS directly with GRUB</h4>

<p>Multiboot (see <a href="multiboot.html#Top">Multiboot Specification</a>) is the native format supported by GRUB. 
For the sake of convenience, there is also support for Linux, FreeBSD,
NetBSD and OpenBSD. If you want to boot other operating systems, you
will have to chain-load them (see <a href="#Chain_002dloading">Chain-loading</a>).

   <p>FIXME: this section is incomplete.

     <ol type=1 start=1>
<li>Run the command <samp><span class="command">boot</span></samp> (see <a href="#boot">boot</a>).
        </ol>

   <p>However, DOS and Windows have some deficiencies, so you might have to
use more complicated instructions. See <a href="#DOS_002fWindows">DOS/Windows</a>, for more
information.

<div class="node">
<a name="Chain-loading"></a>
<a name="Chain_002dloading"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Loading-an-operating-system-directly">Loading an operating system directly</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#General-boot-methods">General boot methods</a>

</div>

<h4 class="subsection">4.1.2 Chain-loading an OS</h4>

<p>Operating systems that do not support Multiboot and do not have specific
support in GRUB (specific support is available for Linux, FreeBSD, NetBSD
and OpenBSD) must be chain-loaded, which involves loading another boot
loader and jumping to it in real mode.

   <p>The <samp><span class="command">chainloader</span></samp> command (see <a href="#chainloader">chainloader</a>) is used to set this
up.  It is normally also necessary to load some GRUB modules and set the
appropriate root device.  Putting this together, we get something like this,
for a Windows system on the first partition of the first hard disk:

<pre class="verbatim">menuentry "Windows" {
	insmod chain
	insmod ntfs
	set root=(hd0,1)
	chainloader +1
}
</pre>
<!-- FIXME: document UUIDs. -->

   <p>On systems with multiple hard disks, an additional workaround may be
required.  See <a href="#DOS_002fWindows">DOS/Windows</a>.

   <p>Chain-loading is only supported on PC BIOS and EFI platforms.

<div class="node">
<a name="Loopback-booting"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#OS_002dspecific-notes">OS-specific notes</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#General-boot-methods">General boot methods</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Booting">Booting</a>

</div>

<h3 class="section">4.2 Loopback booting</h3>

<p>GRUB is able to read from an image (be it one of CD or HDD) stored on
any of its accessible storages (refer to see <a href="#loopback">loopback</a> command). 
However the OS itself should be able to find its root. This usually
involves running a userspace program running before the real root
is discovered. This is achieved by GRUB loading a specially made
small image and passing it as ramdisk to the kernel. This is achieved
by commands <samp><span class="command">kfreebsd_module</span></samp>, <samp><span class="command">knetbsd_module_elf</span></samp>,
<samp><span class="command">kopenbsd_ramdisk</span></samp>, <samp><span class="command">initrd</span></samp> (see <a href="#initrd">initrd</a>),
<samp><span class="command">initrd16</span></samp> (see <a href="#initrd">initrd</a>), <samp><span class="command">multiboot_module</span></samp>,
<samp><span class="command">multiboot2_module</span></samp> or <samp><span class="command">xnu_ramdisk</span></samp>
depending on the loader. Note that for knetbsd the image must be put
inside miniroot.kmod and the whole miniroot.kmod has to be loaded. In
kopenbsd payload this is disabled by default. Aditionally behaviour of
initial ramdisk depends on command line options. Several distributors provide
the image for this purpose or it's integrated in their standard ramdisk and
activated by special option. Consult your kernel and distribution manual for
more details. Other loaders like appleloader, chainloader (BIOS, EFI, coreboot),
freedos, ntldr and plan9 provide no possibility of loading initial ramdisk and
as far as author is aware the payloads in question don't support either initial
ramdisk or discovering loopback boot in other way and as such not bootable this
way. Please consider alternative boot methods like copying all files
from the image to actual partition. Consult your OS documentation for
more details

<div class="node">
<a name="OS-specific-notes"></a>
<a name="OS_002dspecific-notes"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Loopback-booting">Loopback booting</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Booting">Booting</a>

</div>

<h3 class="section">4.3 Some caveats on OS-specific issues</h3>

<p>Here, we describe some caveats on several operating systems.

<ul class="menu">
<li><a accesskey="1" href="#GNU_002fHurd">GNU/Hurd</a>
<li><a accesskey="2" href="#GNU_002fLinux">GNU/Linux</a>
<li><a accesskey="3" href="#DOS_002fWindows">DOS/Windows</a>
</ul>

<div class="node">
<a name="GNU%2fHurd"></a>
<a name="GNU_002fHurd"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#GNU_002fLinux">GNU/Linux</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#OS_002dspecific-notes">OS-specific notes</a>

</div>

<h4 class="subsection">4.3.1 GNU/Hurd</h4>

<p>Since GNU/Hurd is Multiboot-compliant, it is easy to boot it; there is
nothing special about it. But do not forget that you have to specify a
root partition to the kernel.

     <ol type=1 start=1>
<li>Set GRUB's root device to the same drive as GNU/Hurd's.  The command
<code>search --file --set /boot/gnumach.gz</code> or similar may help you
(see <a href="#search">search</a>).

     <li>Load the kernel and the modules, like this:

     <pre class="example">          grub&gt; <kbd>multiboot /boot/gnumach.gz root=device:hd0s1</kbd>
          grub&gt; <kbd>module  /hurd/ext2fs.static ext2fs --readonly \
                             --multiboot-command-line='${kernel-command-line}' \
                             --host-priv-port='${host-port}' \
                             --device-master-port='${device-port}' \
                             --exec-server-task='${exec-task}' -T typed '${root}' \
                             '$(task-create)' '$(task-resume)'</kbd>
          grub&gt; <kbd>module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)'</kbd>
</pre>
     <li>Finally, run the command <samp><span class="command">boot</span></samp> (see <a href="#boot">boot</a>).
        </ol>

<div class="node">
<a name="GNU%2fLinux"></a>
<a name="GNU_002fLinux"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#DOS_002fWindows">DOS/Windows</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#GNU_002fHurd">GNU/Hurd</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#OS_002dspecific-notes">OS-specific notes</a>

</div>

<h4 class="subsection">4.3.2 GNU/Linux</h4>

<p>It is relatively easy to boot GNU/Linux from GRUB, because it somewhat
resembles to boot a Multiboot-compliant OS.

     <ol type=1 start=1>
<li>Set GRUB's root device to the same drive as GNU/Linux's.  The command
<code>search --file --set /vmlinuz</code> or similar may help you
(see <a href="#search">search</a>).

     <li>Load the kernel using the command <samp><span class="command">linux</span></samp> (see <a href="#linux">linux</a>):

     <pre class="example">          grub&gt; <kbd>linux /vmlinuz root=/dev/sda1</kbd>
</pre>
     <p>If you need to specify some kernel parameters, just append them to the
command.  For example, to set <samp><span class="option">acpi</span></samp> to &lsquo;<samp><span class="samp">off</span></samp>&rsquo;, do this:

     <pre class="example">          grub&gt; <kbd>linux /vmlinuz root=/dev/sda1 acpi=off</kbd>
</pre>
     <p>See the documentation in the Linux source tree for complete information on
the available options.

     <p>With <samp><span class="command">linux</span></samp> GRUB uses 32-bit protocol. Some BIOS services like APM
or EDD aren't available with this protocol. In this case you need to use
<samp><span class="command">linux16</span></samp>

     <pre class="example">          grub&gt; <kbd>linux16 /vmlinuz root=/dev/sda1 acpi=off</kbd>
</pre>
     <li>If you use an initrd, execute the command <samp><span class="command">initrd</span></samp> (see <a href="#initrd">initrd</a>)
after <samp><span class="command">linux</span></samp>:

     <pre class="example">          grub&gt; <kbd>initrd /initrd</kbd>
</pre>
     <p>If you used <samp><span class="command">linux16</span></samp> you need to use <samp><span class="command">initrd16</span></samp>:

     <pre class="example">          grub&gt; <kbd>initrd16 /initrd</kbd>
</pre>
     <li>Finally, run the command <samp><span class="command">boot</span></samp> (see <a href="#boot">boot</a>).
        </ol>

   <p><strong>Caution:</strong> If you use an initrd and specify the &lsquo;<samp><span class="samp">mem=</span></samp>&rsquo;
option to the kernel to let it use less than actual memory size, you
will also have to specify the same memory size to GRUB. To let GRUB know
the size, run the command <samp><span class="command">uppermem</span></samp> <em>before</em> loading the
kernel. See <a href="#uppermem">uppermem</a>, for more information.

<div class="node">
<a name="DOS%2fWindows"></a>
<a name="DOS_002fWindows"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#GNU_002fLinux">GNU/Linux</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#OS_002dspecific-notes">OS-specific notes</a>

</div>

<h4 class="subsection">4.3.3 DOS/Windows</h4>

<p>GRUB cannot boot DOS or Windows directly, so you must chain-load them
(see <a href="#Chain_002dloading">Chain-loading</a>). However, their boot loaders have some critical
deficiencies, so it may not work to just chain-load them. To overcome
the problems, GRUB provides you with two helper functions.

   <p>If you have installed DOS (or Windows) on a non-first hard disk, you
have to use the disk swapping technique, because that OS cannot boot
from any disks but the first one. The workaround used in GRUB is the
command <samp><span class="command">drivemap</span></samp> (see <a href="#drivemap">drivemap</a>), like this:

<pre class="example">     drivemap -s (hd0) (hd1)
</pre>
   <p>This performs a <dfn>virtual</dfn> swap between your first and second hard
drive.

   <p><strong>Caution:</strong> This is effective only if DOS (or Windows) uses BIOS
to access the swapped disks. If that OS uses a special driver for the
disks, this probably won't work.

   <p>Another problem arises if you installed more than one set of DOS/Windows
onto one disk, because they could be confused if there are more than one
primary partitions for DOS/Windows. Certainly you should avoid doing
this, but there is a solution if you do want to do so. Use the partition
hiding/unhiding technique.

   <p>If GRUB <dfn>hides</dfn> a DOS (or Windows) partition (see <a href="#parttool">parttool</a>), DOS (or
Windows) will ignore the partition. If GRUB <dfn>unhides</dfn> a DOS (or Windows)
partition, DOS (or Windows) will detect the partition. Thus, if you have
installed DOS (or Windows) on the first and the second partition of the
first hard disk, and you want to boot the copy on the first partition, do
the following:

<pre class="example">     parttool (hd0,1) hidden-
     parttool (hd0,2) hidden+
     set root=(hd0,1)
     chainloader +1
     parttool <tt>${root}</tt> boot+
     boot
</pre>
   <div class="node">
<a name="Configuration"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Theme-file-format">Theme file format</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Booting">Booting</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">5 Writing your own configuration file</h2>

<p>GRUB is configured using <samp><span class="file">grub.cfg</span></samp>, usually located under
<samp><span class="file">/boot/grub</span></samp>.  This file is quite flexible, but most users will not
need to write the whole thing by hand.

<ul class="menu">
<li><a accesskey="1" href="#Simple-configuration">Simple configuration</a>:         Recommended for most users
<li><a accesskey="2" href="#Shell_002dlike-scripting">Shell-like scripting</a>:         For power users and developers
<li><a accesskey="3" href="#Embedded-configuration">Embedded configuration</a>:       Embedding a configuration file into GRUB
</ul>

<div class="node">
<a name="Simple-configuration"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Shell_002dlike-scripting">Shell-like scripting</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration">Configuration</a>

</div>

<h3 class="section">5.1 Simple configuration handling</h3>

<p>The program <samp><span class="command">grub2-mkconfig</span></samp> (see <a href="#Invoking-grub_002dmkconfig">Invoking grub2-mkconfig</a>)
generates <samp><span class="file">grub.cfg</span></samp> files suitable for most cases.  It is suitable for
use when upgrading a distribution, and will discover available kernels and
attempt to generate menu entries for them.

   <p><samp><span class="command">grub2-mkconfig</span></samp> does have some limitations.  While adding extra
custom menu entries to the end of the list can be done by editing
<samp><span class="file">/etc/grub.d/40_custom</span></samp> or creating <samp><span class="file">/boot/grub2/custom.cfg</span></samp>,
changing the order of menu entries or changing their titles may require
making complex changes to shell scripts stored in <samp><span class="file">/etc/grub.d/</span></samp>.  This
may be improved in the future.  In the meantime, those who feel that it
would be easier to write <samp><span class="file">grub.cfg</span></samp> directly are encouraged to do so
(see <a href="#Booting">Booting</a>, and <a href="#Shell_002dlike-scripting">Shell-like scripting</a>), and to disable any system
provided by their distribution to automatically run <samp><span class="command">grub2-mkconfig</span></samp>.

   <p>The file <samp><span class="file">/etc/default/grub</span></samp> controls the operation of
<samp><span class="command">grub2-mkconfig</span></samp>.  It is sourced by a shell script, and so must be
valid POSIX shell input; normally, it will just be a sequence of
&lsquo;<samp><span class="samp">KEY=value</span></samp>&rsquo; lines, but if the value contains spaces or other special
characters then it must be quoted.  For example:

<pre class="example">     GRUB_TERMINAL_INPUT="console serial"
</pre>
   <p>Valid keys in <samp><span class="file">/etc/default/grub</span></samp> are as follows:

     <dl>
<dt>&lsquo;<samp><span class="samp">GRUB_DEFAULT</span></samp>&rsquo;<dd>The default menu entry.  This may be a number, in which case it identifies
the Nth entry in the generated menu counted from zero, or the title of a
menu entry, or the special string &lsquo;<samp><span class="samp">saved</span></samp>&rsquo;.  Using the title may be
useful if you want to set a menu entry as the default even though there may
be a variable number of entries before it.

     <p>For example, if you have:

     <pre class="verbatim">     menuentry 'Example GNU/Linux distribution' --class gnu-linux {
     	...
     }
</pre>

     <p>then you can make this the default using:

     <pre class="example">          GRUB_DEFAULT='Example GNU/Linux distribution'
</pre>
     <p>If you set this to &lsquo;<samp><span class="samp">saved</span></samp>&rsquo;, then the default menu entry will be that
saved by &lsquo;<samp><span class="samp">GRUB_SAVEDEFAULT</span></samp>&rsquo;, <samp><span class="command">grub2-set-default</span></samp>, or
<samp><span class="command">grub2-reboot</span></samp>.

     <p>The default is &lsquo;<samp><span class="samp">0</span></samp>&rsquo;.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_SAVEDEFAULT</span></samp>&rsquo;<dd>If this option is set to &lsquo;<samp><span class="samp">true</span></samp>&rsquo;, then, when an entry is selected, save
it as a new default entry for use by future runs of GRUB.  This is only
useful if &lsquo;<samp><span class="samp">GRUB_DEFAULT=saved</span></samp>&rsquo;; it is a separate option because
&lsquo;<samp><span class="samp">GRUB_DEFAULT=saved</span></samp>&rsquo; is useful without this option, in conjunction with
<samp><span class="command">grub2-set-default</span></samp> or <samp><span class="command">grub2-reboot</span></samp>.  Unset by default. 
This option relies on the environment block, which may not be available in
all situations (see <a href="#Environment-block">Environment block</a>).

     <br><dt>&lsquo;<samp><span class="samp">GRUB_TIMEOUT</span></samp>&rsquo;<dd>Boot the default entry this many seconds after the menu is displayed, unless
a key is pressed.  The default is &lsquo;<samp><span class="samp">5</span></samp>&rsquo;.  Set to &lsquo;<samp><span class="samp">0</span></samp>&rsquo; to boot
immediately without displaying the menu, or to &lsquo;<samp><span class="samp">-1</span></samp>&rsquo; to wait
indefinitely.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_HIDDEN_TIMEOUT</span></samp>&rsquo;<dd>Wait this many seconds for a key to be pressed before displaying the menu. 
If no key is pressed during that time, display the menu for the number of
seconds specified in GRUB_TIMEOUT before booting the default entry. We expect
that most people who use GRUB_HIDDEN_TIMEOUT will want to have GRUB_TIMEOUT set
to &lsquo;<samp><span class="samp">0</span></samp>&rsquo; so that the menu is not displayed at all unless a key is pressed. 
Unset by default.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_HIDDEN_TIMEOUT_QUIET</span></samp>&rsquo;<dd>In conjunction with &lsquo;<samp><span class="samp">GRUB_HIDDEN_TIMEOUT</span></samp>&rsquo;, set this to &lsquo;<samp><span class="samp">true</span></samp>&rsquo; to
suppress the verbose countdown while waiting for a key to be pressed before
displaying the menu.  Unset by default.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_DEFAULT_BUTTON</span></samp>&rsquo;<dt>&lsquo;<samp><span class="samp">GRUB_TIMEOUT_BUTTON</span></samp>&rsquo;<dt>&lsquo;<samp><span class="samp">GRUB_HIDDEN_TIMEOUT_BUTTON</span></samp>&rsquo;<dt>&lsquo;<samp><span class="samp">GRUB_BUTTON_CMOS_ADDRESS</span></samp>&rsquo;<dd>Variants of the corresponding variables without the &lsquo;<samp><span class="samp">_BUTTON</span></samp>&rsquo; suffix,
used to support vendor-specific power buttons.  See <a href="#Vendor-power_002don-keys">Vendor power-on keys</a>.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_DISTRIBUTOR</span></samp>&rsquo;<dd>Set by distributors of GRUB to their identifying name.  This is used to
generate more informative menu entry titles.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_TERMINAL_INPUT</span></samp>&rsquo;<dd>Select the terminal input device.  You may select multiple devices here,
separated by spaces.

     <p>Valid terminal input names depend on the platform, but may include
&lsquo;<samp><span class="samp">console</span></samp>&rsquo; (PC BIOS and EFI consoles), &lsquo;<samp><span class="samp">serial</span></samp>&rsquo; (serial terminal),
&lsquo;<samp><span class="samp">ofconsole</span></samp>&rsquo; (Open Firmware console), &lsquo;<samp><span class="samp">at_keyboard</span></samp>&rsquo; (PC AT
keyboard, mainly useful with Coreboot), or &lsquo;<samp><span class="samp">usb_keyboard</span></samp>&rsquo; (USB keyboard
using the HID Boot Protocol, for cases where the firmware does not handle
this).

     <p>The default is to use the platform's native terminal input.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_TERMINAL_OUTPUT</span></samp>&rsquo;<dd>Select the terminal output device.  You may select multiple devices here,
separated by spaces.

     <p>Valid terminal output names depend on the platform, but may include
&lsquo;<samp><span class="samp">console</span></samp>&rsquo; (PC BIOS and EFI consoles), &lsquo;<samp><span class="samp">serial</span></samp>&rsquo; (serial terminal),
&lsquo;<samp><span class="samp">gfxterm</span></samp>&rsquo; (graphics-mode output), &lsquo;<samp><span class="samp">ofconsole</span></samp>&rsquo; (Open Firmware
console), or &lsquo;<samp><span class="samp">vga_text</span></samp>&rsquo; (VGA text output, mainly useful with Coreboot).

     <p>The default is to use the platform's native terminal output.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_TERMINAL</span></samp>&rsquo;<dd>If this option is set, it overrides both &lsquo;<samp><span class="samp">GRUB_TERMINAL_INPUT</span></samp>&rsquo; and
&lsquo;<samp><span class="samp">GRUB_TERMINAL_OUTPUT</span></samp>&rsquo; to the same value.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_SERIAL_COMMAND</span></samp>&rsquo;<dd>A command to configure the serial port when using the serial console. 
See <a href="#serial">serial</a>.  Defaults to &lsquo;<samp><span class="samp">serial</span></samp>&rsquo;.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX</span></samp>&rsquo;<dd>Command-line arguments to add to menu entries for the Linux kernel.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX_DEFAULT</span></samp>&rsquo;<dd>Unless &lsquo;<samp><span class="samp">GRUB_DISABLE_RECOVERY</span></samp>&rsquo; is set to &lsquo;<samp><span class="samp">true</span></samp>&rsquo;, two menu
entries will be generated for each Linux kernel: one default entry and one
entry for recovery mode.  This option lists command-line arguments to add
only to the default menu entry, after those listed in
&lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX</span></samp>&rsquo;.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_CMDLINE_NETBSD</span></samp>&rsquo;<dt>&lsquo;<samp><span class="samp">GRUB_CMDLINE_NETBSD_DEFAULT</span></samp>&rsquo;<dd>As &lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX</span></samp>&rsquo; and &lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX_DEFAULT</span></samp>&rsquo;, but for
NetBSD.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_CMDLINE_GNUMACH</span></samp>&rsquo;<dd>As &lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX</span></samp>&rsquo;, but for GNU Mach.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_CMDLINE_XEN</span></samp>&rsquo;<dt>&lsquo;<samp><span class="samp">GRUB_CMDLINE_XEN_DEFAULT</span></samp>&rsquo;<dd>The values of these options are appended to the values of
&lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX</span></samp>&rsquo; and &lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX_DEFAULT</span></samp>&rsquo; for Linux
and Xen menu entries.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX_XEN_REPLACE</span></samp>&rsquo;<br><dt>&lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT</span></samp>&rsquo;<dd>The values of these options replace the values of &lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX</span></samp>&rsquo;
and &lsquo;<samp><span class="samp">GRUB_CMDLINE_LINUX_DEFAULT</span></samp>&rsquo; for Linux and Xen menu entries.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_DISABLE_LINUX_UUID</span></samp>&rsquo;<dd>Normally, <samp><span class="command">grub2-mkconfig</span></samp> will generate menu entries that use
universally-unique identifiers (UUIDs) to identify the root filesystem to
the Linux kernel, using a &lsquo;<samp><span class="samp">root=UUID=...</span></samp>&rsquo; kernel parameter.  This is
usually more reliable, but in some cases it may not be appropriate.  To
disable the use of UUIDs, set this option to &lsquo;<samp><span class="samp">true</span></samp>&rsquo;.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_DISABLE_RECOVERY</span></samp>&rsquo;<dd>If this option is set to &lsquo;<samp><span class="samp">true</span></samp>&rsquo;, disable the generation of recovery
mode menu entries.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_VIDEO_BACKEND</span></samp>&rsquo;<dd>If graphical video support is required, either because the &lsquo;<samp><span class="samp">gfxterm</span></samp>&rsquo;
graphical terminal is in use or because &lsquo;<samp><span class="samp">GRUB_GFXPAYLOAD_LINUX</span></samp>&rsquo; is set,
then <samp><span class="command">grub2-mkconfig</span></samp> will normally load all available GRUB video
drivers and use the one most appropriate for your hardware.  If you need to
override this for some reason, then you can set this option.

     <p>After <samp><span class="command">grub2-install</span></samp> has been run, the available video drivers are
listed in <samp><span class="file">/boot/grub2/video.lst</span></samp>.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_GFXMODE</span></samp>&rsquo;<dd>Set the resolution used on the &lsquo;<samp><span class="samp">gfxterm</span></samp>&rsquo; graphical terminal.  Note that
you can only use modes which your graphics card supports via VESA BIOS
Extensions (VBE), so for example native LCD panel resolutions may not be
available.  The default is &lsquo;<samp><span class="samp">auto</span></samp>&rsquo;, which tries to select a preferred
resolution.  See <a href="#gfxmode">gfxmode</a>.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_BACKGROUND</span></samp>&rsquo;<dd>Set a background image for use with the &lsquo;<samp><span class="samp">gfxterm</span></samp>&rsquo; graphical terminal. 
The value of this option must be a file readable by GRUB at boot time, and
it must end with <samp><span class="file">.png</span></samp>, <samp><span class="file">.tga</span></samp>, <samp><span class="file">.jpg</span></samp>, or <samp><span class="file">.jpeg</span></samp>. 
The image will be scaled if necessary to fit the screen.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_THEME</span></samp>&rsquo;<dd>Set a theme for use with the &lsquo;<samp><span class="samp">gfxterm</span></samp>&rsquo; graphical terminal.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_GFXPAYLOAD_LINUX</span></samp>&rsquo;<dd>Set to &lsquo;<samp><span class="samp">text</span></samp>&rsquo; to force the Linux kernel to boot in normal text mode,
&lsquo;<samp><span class="samp">keep</span></samp>&rsquo; to preserve the graphics mode set using &lsquo;<samp><span class="samp">GRUB_GFXMODE</span></samp>&rsquo;,
&lsquo;<samp><var>width</var><span class="samp">x</span><var>height</var></samp>&rsquo;[&lsquo;<samp><span class="samp">x</span><var>depth</var></samp>&rsquo;] to set a particular
graphics mode, or a sequence of these separated by commas or semicolons to
try several modes in sequence.  See <a href="#gfxpayload">gfxpayload</a>.

     <p>Depending on your kernel, your distribution, your graphics card, and the
phase of the moon, note that using this option may cause GNU/Linux to suffer
from various display problems, particularly during the early part of the
boot sequence.  If you have problems, set this option to &lsquo;<samp><span class="samp">text</span></samp>&rsquo; and
GRUB will tell Linux to boot in normal text mode.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_DISABLE_OS_PROBER</span></samp>&rsquo;<dd>Normally, <samp><span class="command">grub2-mkconfig</span></samp> will try to use the external
<samp><span class="command">os-prober</span></samp> program, if installed, to discover other operating
systems installed on the same system and generate appropriate menu entries
for them.  Set this option to &lsquo;<samp><span class="samp">true</span></samp>&rsquo; to disable this.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_INIT_TUNE</span></samp>&rsquo;<dd>Play a tune on the speaker when GRUB starts.  This is particularly useful
for users unable to see the screen.  The value of this option is passed
directly to <a href="#play">play</a>.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_BADRAM</span></samp>&rsquo;<dd>If this option is set, GRUB will issue a <a href="#badram">badram</a> command to filter
out specified regions of RAM.

     <br><dt>&lsquo;<samp><span class="samp">GRUB_PRELOAD_MODULES</span></samp>&rsquo;<dd>This option may be set to a list of GRUB module names separated by spaces. 
Each module will be loaded as early as possible, at the start of
<samp><span class="file">grub.cfg</span></samp>.

   </dl>

   <p>For more detailed customisation of <samp><span class="command">grub2-mkconfig</span></samp>'s output, you may
edit the scripts in <samp><span class="file">/etc/grub.d</span></samp> directly. 
<samp><span class="file">/etc/grub.d/40_custom</span></samp> is particularly useful for adding entire custom
menu entries; simply type the menu entries you want to add at the end of
that file, making sure to leave at least the first two lines intact.

<div class="node">
<a name="Shell-like-scripting"></a>
<a name="Shell_002dlike-scripting"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Embedded-configuration">Embedded configuration</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Simple-configuration">Simple configuration</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration">Configuration</a>

</div>

<h3 class="section">5.2 Writing full configuration files directly</h3>

<!-- Some of this section is derived from the GNU Bash manual page, also -->
<!-- copyrighted by the FSF. -->
<p><samp><span class="file">grub.cfg</span></samp> is written in GRUB's built-in scripting language, which has
a syntax quite similar to that of GNU Bash and other Bourne shell
derivatives.

<h3 class="heading">Words</h3>

<p>A <dfn>word</dfn> is a sequence of characters considered as a single unit by
GRUB.  Words are separated by <dfn>metacharacters</dfn>, which are the following
plus space, tab, and newline:

<pre class="example">     { } | &amp; $ ; &lt; &gt;
</pre>
   <p>Quoting may be used to include metacharacters in words; see below.

<h3 class="heading">Reserved words</h3>

<p>Reserved words have a special meaning to GRUB.  The following words are
recognised as reserved when unquoted and either the first word of a simple
command or the third word of a <code>for</code> command:

<pre class="example">     ! [[ ]] { }
     case do done elif else esac fi for function
     if in menuentry select then time until while
</pre>
   <p>Not all of these reserved words have a useful purpose yet; some are reserved
for future expansion.

<h3 class="heading">Quoting</h3>

<p>Quoting is used to remove the special meaning of certain characters or
words.  It can be used to treat metacharacters as part of a word, to prevent
reserved words from being recognised as such, and to prevent variable
expansion.

   <p>There are three quoting mechanisms: the escape character, single quotes, and
double quotes.

   <p>A non-quoted backslash (\) is the <dfn>escape character</dfn>.  It preserves the
literal value of the next character that follows, with the exception of
newline.

   <p>Enclosing characters in single quotes preserves the literal value of each
character within the quotes.  A single quote may not occur between single
quotes, even when preceded by a backslash.

   <p>Enclosing characters in double quotes preserves the literal value of all
characters within the quotes, with the exception of &lsquo;<samp><span class="samp">$</span></samp>&rsquo; and &lsquo;<samp><span class="samp">\</span></samp>&rsquo;. 
The &lsquo;<samp><span class="samp">$</span></samp>&rsquo; character retains its special meaning within double quotes. 
The backslash retains its special meaning only when followed by one of the
following characters: &lsquo;<samp><span class="samp">$</span></samp>&rsquo;, &lsquo;<samp><span class="samp">"</span></samp>&rsquo;, &lsquo;<samp><span class="samp">\</span></samp>&rsquo;, or newline.  A
backslash-newline pair is treated as a line continuation (that is, it is
removed from the input stream and effectively ignored<a rel="footnote" href="#fn-6" name="fnd-6"><sup>6</sup></a>).  A double quote may be quoted within
double quotes by preceding it with a backslash.

<h3 class="heading">Variable expansion</h3>

<p>The &lsquo;<samp><span class="samp">$</span></samp>&rsquo; character introduces variable expansion.  The variable name to
be expanded may be enclosed in braces, which are optional but serve to
protect the variable to be expanded from characters immediately following it
which could be interpreted as part of the name.

   <p>Normal variable names begin with an alphabetic character, followed by zero
or more alphanumeric characters.  These names refer to entries in the GRUB
environment (see <a href="#Environment">Environment</a>).

   <p>Positional variable names consist of one or more digits.  They represent
parameters passed to function calls, with &lsquo;<samp><span class="samp">$1</span></samp>&rsquo; representing the first
parameter, and so on.

   <p>The special variable name &lsquo;<samp><span class="samp">?</span></samp>&rsquo; expands to the exit status of the most
recently executed command.  When positional variable names are active, other
special variable names &lsquo;<samp><span class="samp">@</span></samp>&rsquo;, &lsquo;<samp><span class="samp">*</span></samp>&rsquo; and &lsquo;<samp><span class="samp">#</span></samp>&rsquo; are defined and they
expand to all positional parameters with necessary quoting, positional
parameters without any quoting, and positional parameter count respectively.

<h3 class="heading">Comments</h3>

<p>A word beginning with &lsquo;<samp><span class="samp">#</span></samp>&rsquo; causes that word and all remaining characters
on that line to be ignored.

<h3 class="heading">Simple commands</h3>

<p>A <dfn>simple command</dfn> is a sequence of words separated by spaces or tabs
and terminated by a semicolon or a newline.  The first word specifies the
command to be executed.  The remaining words are passed as arguments to the
invoked command.

   <p>The return value of a simple command is its exit status.  If the reserved
word <code>!</code> precedes the command, then the return value is instead the
logical negation of the command's exit status.

<h3 class="heading">Compound commands</h3>

<p>A <dfn>compound command</dfn> is one of the following:

     <dl>
<dt>for <var>name</var> in <var>word</var> <small class="dots">...</small>; do <var>list</var>; done<dd>The list of words following <code>in</code> is expanded, generating a list of
items.  The variable <var>name</var> is set to each element of this list in turn,
and <var>list</var> is executed each time.  The return value is the exit status
of the last command that executes.  If the expansion of the items following
<code>in</code> results in an empty list, no commands are executed, and the return
status is 0.

     <br><dt>if <var>list</var>; then <var>list</var>; [elif <var>list</var>; then <var>list</var>;] <small class="dots">...</small> [else <var>list</var>;] fi<dd>The <code>if</code> <var>list</var> is executed.  If its exit status is zero, the
<code>then</code> <var>list</var> is executed.  Otherwise, each <code>elif</code> <var>list</var>
is executed in turn, and if its exit status is zero, the corresponding
<code>then</code> <var>list</var> is executed and the command completes.  Otherwise,
the <code>else</code> <var>list</var> is executed, if present.  The exit status is the
exit status of the last command executed, or zero if no condition tested
true.

     <br><dt>while <var>cond</var>; do <var>list</var>; done<dt>until <var>cond</var>; do <var>list</var>; done<dd>The <code>while</code> command continuously executes the <code>do</code> <var>list</var> as
long as the last command in <var>cond</var> returns an exit status of zero.  The
<code>until</code> command is identical to the <code>while</code> command, except that
the test is negated; the <code>do</code> <var>list</var> is executed as long as the
last command in <var>cond</var> returns a non-zero exit status.  The exit status
of the <code>while</code> and <code>until</code> commands is the exit status of the last
<code>do</code> <var>list</var> command executed, or zero if none was executed.

     <br><dt>function <var>name</var> { <var>command</var>; <small class="dots">...</small> }<dd>This defines a function named <var>name</var>.  The <dfn>body</dfn> of the function is
the list of commands within braces, each of which must be terminated with a
semicolon or a newline.  This list of commands will be executed whenever
<var>name</var> is specified as the name of a simple command.  Function
definitions do not affect the exit status in <code>$?</code>.  When executed, the
exit status of a function is the exit status of the last command executed in
the body.

     <br><dt>menuentry <var>title</var> [<samp><span class="option">--class=class</span></samp> <small class="dots">...</small>] [<samp><span class="option">--users=users</span></samp>] [<samp><span class="option">--unrestricted</span></samp>] [<samp><span class="option">--hotkey=key</span></samp>] { <var>command</var>; <small class="dots">...</small> }<dd>See <a href="#menuentry">menuentry</a>. 
</dl>

<h3 class="heading">Built-in Commands</h3>

<p>Some built-in commands are also provided by GRUB script to help script
writers perform actions that are otherwise not possible.  For example, these
include commands to jump out of a loop without fully completing it, etc.

     <dl>
<dt>break [<code>n</code>]<dd>Exit from within a <code>for</code>, <code>while</code>, or <code>until</code> loop.  If
<code>n</code> is specified, break <code>n</code> levels.  <code>n</code> must be greater than
or equal to 1.  If <code>n</code> is greater than the number of enclosing loops,
all enclosing loops are exited.  The return value is 0 unless <code>n</code> is
not greater than or equal to 1.

     <br><dt>continue [<code>n</code>]<dd>Resume the next iteration of the enclosing <code>for</code>, <code>while</code> or
<code>until</code> loop.  If <code>n</code> is specified, resume at the <code>n</code>th
enclosing loop.  <code>n</code> must be greater than or equal to 1.  If <code>n</code>
is greater than the number of enclosing loops, the last enclosing loop (the
<dfn>top-level</dfn> loop) is resumed.  The return value is 0 unless <code>n</code> is
not greater than or equal to 1.

     <br><dt>return [<code>n</code>]<dd>Causes a function to exit with the return value specified by <code>n</code>.  If
<code>n</code> is omitted, the return status is that of the last command executed
in the function body.  If used outside a function the return status is
false.

     <br><dt>shift [<code>n</code>]<dd>The positional parameters from <code>n</code>+1 <small class="dots">...</small> are renamed to
<code>$1</code><small class="dots">...</small>.  Parameters represented by the numbers <code>$#</code> down to
<code>$#</code>-<code>n</code>+1 are unset.  <code>n</code> must be a non-negative number less
than or equal to <code>$#</code>.  If <code>n</code> is 0, no parameters are changed. 
If <code>n</code> is not given, it is assumed to be 1.  If <code>n</code> is greater
than <code>$#</code>, the positional parameters are not changed.  The return
status is greater than zero if <code>n</code> is greater than <code>$#</code> or less
than zero; otherwise 0.

   </dl>

<div class="node">
<a name="Embedded-configuration"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Shell_002dlike-scripting">Shell-like scripting</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Configuration">Configuration</a>

</div>

<h3 class="section">5.3 Embedding a configuration file into GRUB</h3>

<p>GRUB supports embedding a configuration file directly into the core image,
so that it is loaded before entering normal mode.  This is useful, for
example, when it is not straightforward to find the real configuration file,
or when you need to debug problems with loading that file. 
<samp><span class="command">grub2-install</span></samp> uses this feature when it is not using BIOS disk
functions or when installing to a different disk from the one containing
<samp><span class="file">/boot/grub</span></samp>, in which case it needs to use the <samp><span class="command">search</span></samp>
command (see <a href="#search">search</a>) to find <samp><span class="file">/boot/grub</span></samp>.

   <p>To embed a configuration file, use the <samp><span class="option">-c</span></samp> option to
<samp><span class="command">grub2-mkimage</span></samp>.  The file is copied into the core image, so it may
reside anywhere on the file system, and may be removed after running
<samp><span class="command">grub2-mkimage</span></samp>.

   <p>After the embedded configuration file (if any) is executed, GRUB will load
the &lsquo;<samp><span class="samp">normal</span></samp>&rsquo; module (see <a href="#normal">normal</a>), which will then read the real
configuration file from <samp><span class="file">$prefix/grub.cfg</span></samp>.  By this point, the
<code>root</code> variable will also have been set to the root device name.  For
example, <code>prefix</code> might be set to &lsquo;<samp><span class="samp">(hd0,1)/boot/grub</span></samp>&rsquo;, and
<code>root</code> might be set to &lsquo;<samp><span class="samp">hd0,1</span></samp>&rsquo;.  Thus, in most cases, the embedded
configuration file only needs to set the <code>prefix</code> and <code>root</code>
variables, and then drop through to GRUB's normal processing.  A typical
example of this might look like this:

<pre class="example">     search.fs_uuid 01234567-89ab-cdef-0123-456789abcdef root
     set prefix=($root)/boot/grub
</pre>
   <p>(The &lsquo;<samp><span class="samp">search_fs_uuid</span></samp>&rsquo; module must be included in the core image for this
example to work.)

   <p>In more complex cases, it may be useful to read other configuration files
directly from the embedded configuration file.  This allows such things as
reading files not called <samp><span class="file">grub.cfg</span></samp>, or reading files from a directory
other than that where GRUB's loadable modules are installed.  To do this,
include the &lsquo;<samp><span class="samp">configfile</span></samp>&rsquo; and &lsquo;<samp><span class="samp">normal</span></samp>&rsquo; modules in the core image,
and embed a configuration file that uses the <samp><span class="command">configfile</span></samp> command to
load another file.  The following example of this also requires the
<samp><span class="command">echo</span></samp>, <samp><span class="command">search_label</span></samp>, and <samp><span class="command">test</span></samp> modules to be
included in the core image:

<pre class="example">     search.fs_label grub root
     if [ -e /boot/grub2/example/test1.cfg ]; then
         set prefix=($root)/boot/grub
         configfile /boot/grub2/example/test1.cfg
     else
         if [ -e /boot/grub2/example/test2.cfg ]; then
             set prefix=($root)/boot/grub
             configfile /boot/grub2/example/test2.cfg
         else
             echo "Could not find an example configuration file!"
         fi
     fi
</pre>
   <p>The embedded configuration file may not contain menu entries directly, but
may only read them from elsewhere using <samp><span class="command">configfile</span></samp>.

<div class="node">
<a name="Theme-file-format"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Network">Network</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Configuration">Configuration</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">6 Theme file format</h2>

<h3 class="section">6.1 Introduction</h3>

<p>The GRUB graphical menu supports themes that can customize the layout and
appearance of the GRUB boot menu.  The theme is configured through a plain
text file that specifies the layout of the various GUI components (including
the boot menu, timeout progress bar, and text messages) as well as the
appearance using colors, fonts, and images. Example is available in docs/example_theme.txt

<h3 class="section">6.2 Theme Elements</h3>

<h4 class="subsection">6.2.1 Colors</h4>

<p>Colors can be specified in several ways:

     <ul>
<li>HTML-style &ldquo;#RRGGBB&rdquo; or &ldquo;#RGB&rdquo; format, where *R*, *G*, and *B* are hexadecimal digits (e.g., &ldquo;#8899FF&rdquo;)
<li>as comma-separated decimal RGB values (e.g., &ldquo;128, 128, 255&rdquo;)
<li>with &ldquo;SVG 1.0 color names&rdquo; (e.g., &ldquo;cornflowerblue&rdquo;) which must be specified in lowercase. 
</ul>

<h4 class="subsection">6.2.2 Fonts</h4>

<p>The fonts GRUB uses &ldquo;PFF2 font format&rdquo; bitmap fonts.  Fonts are specified
with full font names.  Currently there is no
provision for a preference list of fonts, or deriving one font from another. 
Fonts are loaded with the &ldquo;loadfont&rdquo; command in GRUB.  To see the list of
loaded fonts, execute the &ldquo;lsfonts&rdquo; command.  If there are too many fonts to
fit on screen, do &ldquo;set pager=1&rdquo; before executing &ldquo;lsfonts&rdquo;.

<h4 class="subsection">6.2.3 Progress Bar</h4>

<div class="float">
<a name="Pixmap_002dstyled-progress-bar"></a><!-- @image{Theme_progress_bar,,,,png} -->
<p><strong class="float-caption">Figure    6.1</strong></p></div>

   <div class="float">
<a name="Plain-progress-bar"></a><!-- @image{Theme_progress_bar_filled,,,,png} -->
<p><strong class="float-caption">Figure    6.2</strong></p></div>

   <p>Progress bars are used to display the remaining time before GRUB boots the
default menu entry.  To create a progress bar that will display the remaining
time before automatic boot, simply create a &ldquo;progress_bar&rdquo; component with
the id &ldquo;__timeout__&rdquo;.  This indicates to GRUB that the progress bar should
be updated as time passes, and it should be made invisible if the countdown to
automatic boot is interrupted by the user.

   <p>Progress bars may optionally have text displayed on them.  This text is
controlled by variable &ldquo;text&rdquo; which contains a printf template with the
only argument %d is the number of seconds remaining. Additionally special
values &ldquo;@TIMEOUT_NOTIFICATION_SHORT@&rdquo;, &ldquo;@TIMEOUT_NOTIFICATION_MIDDLE@&rdquo;,
&ldquo;@TIMEOUT_NOTIFICATION_LONG@&rdquo; are replaced with standard and translated
templates.

<h4 class="subsection">6.2.4 Circular Progress Indicator</h4>

<!-- @image{Theme_circular_progress,,,,.png} -->
<p>The circular progress indicator functions similarly to the progress bar.  When
given an id of &ldquo;__timeout__&rdquo;, GRUB updates the circular progress indicator's
value to indicate the time remaining.  For the circular progress indicator,
there are two images used to render it:  the *center* image, and the *tick*
image.  The center image is rendered in the center of the component, while the
tick image is used to render each mark along the circumference of the
indicator.

<h4 class="subsection">6.2.5 Labels</h4>

<p>Text labels can be placed on the boot screen.  The font, color, and horizontal
alignment can be specified for labels.  If a label is given the id
&ldquo;__timeout__&rdquo;, then the &ldquo;text&rdquo; property for that label is also updated
with a message informing the user of the number of seconds remaining until
automatic boot.  This is useful in case you want the text displayed somewhere
else instead of directly on the progress bar.

<h4 class="subsection">6.2.6 Boot Menu</h4>

<!-- @image{Theme_boot_menu,,,,.png} -->
<p>The boot menu where GRUB displays the menu entries from the &ldquo;grub.cfg&rdquo; file. 
It is a list of items, where each item has a title and an optional icon.  The
icon is selected based on the *classes* specified for the menu entry.  If
there is a PNG file named &ldquo;myclass.png&rdquo; in the &ldquo;grub/themes/icons&rdquo;
directory, it will be displayed for items which have the class *myclass*.  The
boot menu can be customized in several ways, such as the font and color used
for the menu entry title, and by specifying styled boxes for the menu itself
and for the selected item highlight.

<h4 class="subsection">6.2.7 Styled Boxes</h4>

<p>One of the most important features for customizing the layout is the use of
 *styled boxes*.  A styled box is composed of 9 rectangular (and potentially
empty) regions, which are used to seamlessly draw the styled box on screen:

   <p><table summary=""><tr align="left"><td valign="top" width="30%">Northwest (nw) </td><td valign="top" width="30%">North (n)  </td><td valign="top" width="30%">Northeast (ne)
<br></td></tr><tr align="left"><td valign="top" width="30%">West (w)       </td><td valign="top" width="30%">Center (c) </td><td valign="top" width="30%">East (e)
<br></td></tr><tr align="left"><td valign="top" width="30%">Southwest (sw) </td><td valign="top" width="30%">South (s)  </td><td valign="top" width="30%">Southeast (se)
   <br></td></tr></table>

   <p>To support any size of box on screen, the center slice and the slices for the
top, bottom, and sides are all scaled to the correct size for the component on
screen, using the following rules:

     <ol type=1 start=1>
<li>The edge slices (north, south, east, and west) are scaled in the direction of the edge they are adjacent to.  For instance, the west slice is scaled vertically. 
<li>The corner slices (northwest, northeast, southeast, and southwest) are not scaled. 
<li>The center slice is scaled to fill the remaining space in the middle.
        </ol>

   <p>As an example of how an image might be sliced up, consider the styled box
used for a terminal view.

   <div class="float">
<a name="An-example-of-the-slices-_0028in-red_0029-used-for-a-terminal-window_002e-This-drawing-was-created-and-sliced-in-Inkscape_005f"></a><!-- @image{Box_slice_example_terminal,,,,.png} -->
<p><strong class="float-caption">Figure    6.3</strong></p></div>

<h4 class="subsection">6.2.8 Creating Styled Box Images</h4>

<p>The Inkscape_ scalable vector graphics editor is a very useful tool for
creating styled box images.  One process that works well for slicing a drawing
into the necessary image slices is:

     <ol type=1 start=1>
<li>Create or open the drawing you'd like use. 
<li>Create a new layer on the top of the layer stack.  Make it visible.  Select this layer as the current layer. 
<li>Draw 9 rectangles on your drawing where you'd like the slices to be.  Clear the fill option, and set the stroke to 1 pixel wide solid stroke.  The corners of the slices must meet precisely; if it is off by a single pixel, it will probably be evident when the styled box is rendered in the GRUB menu.  You should probably go to File | Document Properties | Grids and enable a grid or create a guide (click on one of the rulers next to the drawing and drag over the drawing; release the mouse button to place the guide) to help place the rectangles precisely. 
<li>Right click on the center slice rectangle and choose Object Properties. Change the "Id" to &ldquo;slice_c&ldquo; and click Set.  Repeat this for the remaining 8 rectangles, giving them Id values of &ldquo;slice_n&ldquo;, &ldquo;slice_ne&ldquo;, &ldquo;slice_e&ldquo;, and so on according to the location. 
<li>Save the drawing. 
<li>Select all the slice rectangles.  With the slice layer selected, you can simply press Ctrl+A to select all rectangles.  The status bar should indicate that 9 rectangles are selected. 
<li>Click the layer hide icon for the slice layer in the layer palette.  The rectangles will remain selected, even though they are hidden. 
<li>Choose File | Export Bitmap and check the *Batch export 9 selected objects* box.  Make sure that *Hide all except selected* is unchecked. click *Export*.  This will create PNG files in the same directory as the drawing, named after the slices.  These can now be used for a styled box in a GRUB theme.
        </ol>

<h3 class="section">6.3 Theme File Manual</h3>

<p>The theme file is a plain text file.  Lines that begin with &ldquo;#&ldquo; are ignored
and considered comments.  (Note: This may not be the case if the previous line
ended where a value was expected.)

   <p>The theme file contains two types of statements:
     <ol type=1 start=1>
<li>Global properties. 
<li>Component construction.
        </ol>

<h4 class="subsection">6.3.1 Global Properties</h4>

<h4 class="subsection">6.3.2 Format</h4>

<p>Global properties are specified with the simple format:
     <ul>
<li>name1: value1
<li>name2: "value which may contain spaces"
<li>name3: #88F
</ul>

   <p>In this example, name3 is assigned a color value.

<h4 class="subsection">6.3.3 Global Property List</h4>

<p><table summary=""><tr align="left"><td valign="top" width="30%">title-text </td><td valign="top" width="60%">Specifies the text to display at the top center of the screen as a title. 
<br></td></tr><tr align="left"><td valign="top" width="30%">title-font </td><td valign="top" width="60%">Defines the font used for the title message at the top of the screen. 
<br></td></tr><tr align="left"><td valign="top" width="30%">title-color </td><td valign="top" width="60%">Defines the color of the title message. 
<br></td></tr><tr align="left"><td valign="top" width="30%">message-font </td><td valign="top" width="60%">Defines the font used for messages, such as when GRUB is unable to automatically boot an entry. 
<br></td></tr><tr align="left"><td valign="top" width="30%">message-color </td><td valign="top" width="60%">Defines the color of the message text. 
<br></td></tr><tr align="left"><td valign="top" width="30%">message-bg-color </td><td valign="top" width="60%">Defines the background color of the message text area. 
<br></td></tr><tr align="left"><td valign="top" width="30%">desktop-image </td><td valign="top" width="60%">Specifies the image to use as the background.  It will be scaled to fit the screen size. 
<br></td></tr><tr align="left"><td valign="top" width="30%">desktop-color </td><td valign="top" width="60%">Specifies the color for the background if *desktop-image* is not specified. 
<br></td></tr><tr align="left"><td valign="top" width="30%">terminal-box </td><td valign="top" width="60%">Specifies the file name pattern for the styled box slices used for the command line terminal window.  For example, &ldquo;terminal-box: terminal_*.png&rdquo; will use the images &ldquo;terminal_c.png&ldquo; as the center area, &ldquo;terminal_n.png&ldquo; as the north (top) edge, &ldquo;terminal_nw.png&ldquo; as the northwest (upper left) corner, and so on.  If the image for any slice is not found, it will simply be left empty.
<br></td></tr></table>

<h4 class="subsection">6.3.4 Component Construction</h4>

<p>Greater customizability comes is provided by components.  A tree of components
forms the user interface.  *Containers* are components that can contain other
components, and there is always a single root component which is an instance
of a *canvas* container.

   <p>Components are created in the theme file by prefixing the type of component
with a '+' sign:

   <p><code>   + label { text="GRUB" font="aqui 11" color="#8FF" } </code>

   <p>properties of a component are specified as "name = value" (whitespace
surrounding tokens is optional and is ignored) where *value* may be:
     <ul>
<li>a single word (e.g., &ldquo;align = center&ldquo;, &ldquo;color = #FF8080&ldquo;),
<li>a quoted string (e.g., &ldquo;text = "Hello, World!"&ldquo;), or
<li>a tuple (e.g., &ldquo;preferred_size = (120, 80)&ldquo;). 
</ul>

<h4 class="subsection">6.3.5 Component List</h4>

<p>The following is a list of the components and the properties they support.

     <ul>
<li>label
   A label displays a line of text.

     <p>Properties:
     <p><table summary="">   <tr align="left"><td valign="top" width="20%">text </td><td valign="top" width="70%">The text to display. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">font </td><td valign="top" width="70%">The font to use for text display. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">color </td><td valign="top" width="70%">The color of the text. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">align </td><td valign="top" width="70%">The horizontal alignment of the text within the component. Options are &ldquo;left&ldquo;, &ldquo;center&ldquo;, and &ldquo;right&ldquo;.
     <br></td></tr></table>

     <li>image
   A component that displays an image.  The image is scaled to fit the
   component, although the preferred size defaults to the image's original
   size unless the &ldquo;preferred_size&ldquo; property is explicitly set.

     <p>Properties:

     <p><table summary="">   <tr align="left"><td valign="top" width="20%">file </td><td valign="top" width="70%">The full path to the image file to load.
     <br></td></tr></table>

     <li>progress_bar
   Displays a horizontally oriented progress bar.  It can be rendered using
   simple solid filled rectangles, or using a pair of pixmap styled boxes.

     <p>Properties:

     <p><table summary="">   <tr align="left"><td valign="top" width="20%">fg_color </td><td valign="top" width="70%">The foreground color for plain solid color rendering. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">bg_color </td><td valign="top" width="70%">The background color for plain solid color rendering. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">border_color </td><td valign="top" width="70%">The border color for plain solid color rendering. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">text_color </td><td valign="top" width="70%">The text color. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">show_text </td><td valign="top" width="70%">Boolean value indicating whether or not text should be displayed on the progress bar.  If set to *false*, then no text will be displayed on the bar.  If set to any other value, text will be displayed on the bar. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">bar_style </td><td valign="top" width="70%">The styled box specification for the frame of the progress bar. Example: &ldquo;progress_frame_*.png&ldquo;
   <br></td></tr><tr align="left"><td valign="top" width="20%">highlight_style </td><td valign="top" width="70%">The styled box specification for the highlighted region of the progress bar. This box will be used to paint just the highlighted region of the bar, and will be increased in size as the bar nears completion. Example: &ldquo;progress_hl_*.png&ldquo;. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">text </td><td valign="top" width="70%">The text to display on the progress bar.  If the progress bar's ID is set to &ldquo;__timeout__&ldquo;, then GRUB will updated this property with an informative message as the timeout approaches. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">value </td><td valign="top" width="70%">The progress bar current value.  Normally not set manually. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">start </td><td valign="top" width="70%">The progress bar start value.  Normally not set manually. 
   <br></td></tr><tr align="left"><td valign="top" width="20%">end </td><td valign="top" width="70%">The progress bar end value.  Normally not set manually.
     <br></td></tr></table>

     <li>circular_progress
   Displays a circular progress indicator.  The appearance of this component
   is determined by two images:  the *center* image and the *tick* image.  The
   center image is generally larger and will be drawn in the center of the
   component.  Around the circumference of a circle within the component, the
   tick image will be drawn a certain number of times, depending on the
   properties of the component.

     <p>Properties:

     <p><table summary="">   <tr align="left"><td valign="top" width="30%">center_bitmap
      </td><td valign="top" width="60%">The file name of the image to draw in the center of the component. 
   <br></td></tr><tr align="left"><td valign="top" width="30%">tick_bitmap
      </td><td valign="top" width="60%">The file name of the image to draw for the tick marks. 
   <br></td></tr><tr align="left"><td valign="top" width="30%">num_ticks
      </td><td valign="top" width="60%">The number of ticks that make up a full circle. 
   <br></td></tr><tr align="left"><td valign="top" width="30%">ticks_disappear
      </td><td valign="top" width="60%">Boolean value indicating whether tick marks should progressively appear,
      or progressively disappear as *value* approaches *end*.  Specify
      &ldquo;true&ldquo; or &ldquo;false&ldquo;. 
   <br></td></tr><tr align="left"><td valign="top" width="30%">value
      </td><td valign="top" width="60%">The progress indicator current value.  Normally not set manually. 
   <br></td></tr><tr align="left"><td valign="top" width="30%">start
      </td><td valign="top" width="60%">The progress indicator start value.  Normally not set manually. 
   <br></td></tr><tr align="left"><td valign="top" width="30%">end
      </td><td valign="top" width="60%">The progress indicator end value.  Normally not set manually.
     <br></td></tr></table>
<li>boot_menu
   Displays the GRUB boot menu.  It allows selecting items and executing them.

     <p>Properties:

     <p><table summary="">   <tr align="left"><td valign="top" width="40%">item_font
      </td><td valign="top" width="50%">The font to use for the menu item titles. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">selected_item_font
      </td><td valign="top" width="50%">The font to use for the selected menu item, or &ldquo;inherit&ldquo; (the default)
      to use &ldquo;item_font&ldquo; for the selected menu item as well. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">item_color
      </td><td valign="top" width="50%">The color to use for the menu item titles. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">selected_item_color
      </td><td valign="top" width="50%">The color to use for the selected menu item, or &ldquo;inherit&ldquo; (the default)
      to use &ldquo;item_color&ldquo; for the selected menu item as well. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">icon_width
      </td><td valign="top" width="50%">The width of menu item icons.  Icons are scaled to the specified size. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">icon_height
      </td><td valign="top" width="50%">The height of menu item icons. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">item_height
      </td><td valign="top" width="50%">The height of each menu item in pixels. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">item_padding
      </td><td valign="top" width="50%">The amount of space in pixels to leave on each side of the menu item
      contents. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">item_icon_space
      </td><td valign="top" width="50%">The space between an item's icon and the title text, in pixels. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">item_spacing
      </td><td valign="top" width="50%">The amount of space to leave between menu items, in pixels. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">menu_pixmap_style
      </td><td valign="top" width="50%">The image file pattern for the menu frame styled box. 
      Example:  &ldquo;menu_*.png&ldquo; (this will use images such as &ldquo;menu_c.png&ldquo;,
      &ldquo;menu_w.png&ldquo;, `menu_nw.png&ldquo;, etc.) 
   <br></td></tr><tr align="left"><td valign="top" width="40%">selected_item_pixmap_style
      </td><td valign="top" width="50%">The image file pattern for the selected item highlight styled box. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar
      </td><td valign="top" width="50%">Boolean value indicating whether the scroll bar should be drawn if the
      frame and thumb styled boxes are configured. 
   <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar_frame
      </td><td valign="top" width="50%">The image file pattern for the entire scroll bar. 
      Example:  &ldquo;scrollbar_*.png&ldquo;
   <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar_thumb
      </td><td valign="top" width="50%">The image file pattern for the scroll bar thumb (the part of the scroll
      bar that moves as scrolling occurs). 
      Example:  &ldquo;scrollbar_thumb_*.png&ldquo;
   <br></td></tr><tr align="left"><td valign="top" width="40%">max_items_shown
      </td><td valign="top" width="50%">The maximum number of items to show on the menu.  If there are more than
      *max_items_shown* items in the menu, the list will scroll to make all
      items accessible.
     <br></td></tr></table>

     <li>canvas
   Canvas is a container that allows manual placement of components within it. 
   It does not alter the positions of its child components.  It assigns all
   child components their preferred sizes.

     <li>hbox
   The *hbox* container lays out its children from left to right, giving each
   one its preferred width.  The height of each child is set to the maximum of
   the preferred heights of all children.

     <li>vbox
   The *vbox* container lays out its children from top to bottom, giving each
   one its preferred height.  The width of each child is set to the maximum of
   the preferred widths of all children. 
</ul>

<h4 class="subsection">6.3.6 Common properties</h4>

<p>The following properties are supported by all components:
     <dl>
<dt>&lsquo;<samp><span class="samp">left</span></samp>&rsquo;<dd>     The distance from the left border of container to left border of the object in either of three formats:
     <p><table summary="">             <tr align="left"><td valign="top" width="20%">x </td><td valign="top" width="70%">Value in pixels
             <br></td></tr><tr align="left"><td valign="top" width="20%">p% </td><td valign="top" width="70%">Percentage
             <br></td></tr><tr align="left"><td valign="top" width="20%">p%+x </td><td valign="top" width="70%">mixture of both
     <br></td></tr></table>
<br><dt>&lsquo;<samp><span class="samp">top</span></samp>&rsquo;<dd>      The distance from the left border of container to left border of the object in same format. 
<br><dt>&lsquo;<samp><span class="samp">width</span></samp>&rsquo;<dd>      The width of object in same format. 
<br><dt>&lsquo;<samp><span class="samp">height</span></samp>&rsquo;<dd>      The height of object in same format. 
<br><dt>&lsquo;<samp><span class="samp">id</span></samp>&rsquo;<dd>   The identifier for the component.  This can be any arbitrary string. 
   The ID can be used by scripts to refer to various components in the GUI
   component tree.  Currently, there is one special ID value that GRUB
   recognizes:

     <p><table summary="">   <tr align="left"><td valign="top" width="20%">&ldquo;__timeout__&ldquo; </td><td valign="top" width="70%">Any component with this ID will have its *text*, *start*, *end*, *value*, and *visible* properties set by GRUB when it is counting down to an automatic boot of the default menu entry.
     <br></td></tr></table>
</dl>

<div class="node">
<a name="Network"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Serial-terminal">Serial terminal</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Theme-file-format">Theme file format</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">7 Booting GRUB from the network</h2>

<p>The following instructions only work on PC BIOS systems where the Preboot
eXecution Environment (PXE) is available.

   <p>To generate a PXE boot image, run:

<pre class="example">     grub2-mkimage --format=i386-pc-pxe --output=grub.pxe --prefix='(pxe)/boot/grub' pxe pxecmd
</pre>
   <p>Copy <samp><span class="file">grub.pxe</span></samp>, <samp><span class="file">/boot/grub2/*.mod</span></samp>, and <samp><span class="file">/boot/grub2/*.lst</span></samp>
to the PXE (TFTP) server, ensuring that <samp><span class="file">*.mod</span></samp> and <samp><span class="file">*.lst</span></samp> are
accessible via the <samp><span class="file">/boot/grub2/</span></samp> path from the TFTP server root.  Set
the DHCP server configuration to offer <samp><span class="file">grub.pxe</span></samp> as the boot file (the
&lsquo;<samp><span class="samp">filename</span></samp>&rsquo; option in ISC dhcpd).

   <p>You can also use the <samp><span class="command">grub2-mknetdir</span></samp> utility to generate an image
and a GRUB directory tree, rather than copying files around manually.

   <p>After GRUB has started, files on the TFTP server will be accessible via the
&lsquo;<samp><span class="samp">(pxe)</span></samp>&rsquo; device.

   <p>The server and gateway IP address can be controlled by changing the
&lsquo;<samp><span class="samp">(pxe)</span></samp>&rsquo; device name to &lsquo;<samp><span class="samp">(pxe:</span><var>server-ip</var><span class="samp">)</span></samp>&rsquo; or
&lsquo;<samp><span class="samp">(pxe:</span><var>server-ip</var><span class="samp">:</span><var>gateway-ip</var><span class="samp">)</span></samp>&rsquo;.  Note that this should be
changed both in the prefix and in any references to the device name in the
configuration file.

   <p>GRUB provides several environment variables which may be used to inspect or
change the behaviour of the PXE device:

     <dl>
<dt>&lsquo;<samp><span class="samp">net_pxe_ip</span></samp>&rsquo;<dd>The IP address of this machine.  Read-only.

     <br><dt>&lsquo;<samp><span class="samp">net_pxe_mac</span></samp>&rsquo;<dd>The network interface's MAC address.  Read-only.

     <br><dt>&lsquo;<samp><span class="samp">net_pxe_hostname</span></samp>&rsquo;<dd>The client host name provided by DHCP.  Read-only.

     <br><dt>&lsquo;<samp><span class="samp">net_pxe_domain</span></samp>&rsquo;<dd>The client domain name provided by DHCP.  Read-only.

     <br><dt>&lsquo;<samp><span class="samp">net_pxe_rootpath</span></samp>&rsquo;<dd>The path to the client's root disk provided by DHCP.  Read-only.

     <br><dt>&lsquo;<samp><span class="samp">net_pxe_extensionspath</span></samp>&rsquo;<dd>The path to additional DHCP vendor extensions provided by DHCP.  Read-only.

     <br><dt>&lsquo;<samp><span class="samp">net_pxe_boot_file</span></samp>&rsquo;<dd>The boot file name provided by DHCP.  Read-only.

     <br><dt>&lsquo;<samp><span class="samp">net_pxe_dhcp_server_name</span></samp>&rsquo;<dd>The name of the DHCP server responsible for these boot parameters. 
Read-only.

     <br><dt>&lsquo;<samp><span class="samp">net_default_server</span></samp>&rsquo;<dd>The default server.  Read-write, although setting this is only useful
before opening a network device.

   </dl>

<div class="node">
<a name="Serial-terminal"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Vendor-power_002don-keys">Vendor power-on keys</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Network">Network</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">8 Using GRUB via a serial line</h2>

<p>This chapter describes how to use the serial terminal support in GRUB.

   <p>If you have many computers or computers with no display/keyboard, it
could be very useful to control the computers through serial
communications. To connect one computer with another via a serial line,
you need to prepare a null-modem (cross) serial cable, and you may need
to have multiport serial boards, if your computer doesn't have extra
serial ports. In addition, a terminal emulator is also required, such as
minicom. Refer to a manual of your operating system, for more
information.

   <p>As for GRUB, the instruction to set up a serial terminal is quite
simple.  Here is an example:

<pre class="example">     grub&gt; <kbd>serial --unit=0 --speed=9600</kbd>
     grub&gt; <kbd>terminal_input serial; terminal_output serial</kbd>
</pre>
   <p>The command <samp><span class="command">serial</span></samp> initializes the serial unit 0 with the
speed 9600bps. The serial unit 0 is usually called &lsquo;<samp><span class="samp">COM1</span></samp>&rsquo;, so, if
you want to use COM2, you must specify &lsquo;<samp><span class="samp">--unit=1</span></samp>&rsquo; instead. This
command accepts many other options, so please refer to <a href="#serial">serial</a>,
for more details.

   <p>The commands <samp><span class="command">terminal_input</span></samp> (see <a href="#terminal_005finput">terminal_input</a>) and
<samp><span class="command">terminal_output</span></samp> (see <a href="#terminal_005foutput">terminal_output</a>) choose which type of
terminal you want to use. In the case above, the terminal will be a
serial terminal, but you can also pass <code>console</code> to the command,
as &lsquo;<samp><span class="samp">terminal_input serial console</span></samp>&rsquo;. In this case, a terminal in which
you press any key will be selected as a GRUB terminal. In the example above,
note that you need to put both commands on the same command line, as you
will lose the ability to type commands on the console after the first
command.

   <p>However, note that GRUB assumes that your terminal emulator is
compatible with VT100 by default. This is true for most terminal
emulators nowadays, but you should pass the option <samp><span class="option">--dumb</span></samp> to
the command if your terminal emulator is not VT100-compatible or
implements few VT100 escape sequences. If you specify this option then
GRUB provides you with an alternative menu interface, because the normal
menu requires several fancy features of your terminal.

<div class="node">
<a name="Vendor-power-on-keys"></a>
<a name="Vendor-power_002don-keys"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Images">Images</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Serial-terminal">Serial terminal</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">9 Using GRUB with vendor power-on keys</h2>

<p>Some laptop vendors provide an additional power-on button which boots another
OS.  GRUB supports such buttons with the &lsquo;<samp><span class="samp">GRUB_TIMEOUT_BUTTON</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">GRUB_DEFAULT_BUTTON</span></samp>&rsquo;, &lsquo;<samp><span class="samp">GRUB_HIDDEN_TIMEOUT_BUTTON</span></samp>&rsquo; and
&lsquo;<samp><span class="samp">GRUB_BUTTON_CMOS_ADDRESS</span></samp>&rsquo; variables in default/grub (see <a href="#Simple-configuration">Simple configuration</a>).  &lsquo;<samp><span class="samp">GRUB_TIMEOUT_BUTTON</span></samp>&rsquo;, &lsquo;<samp><span class="samp">GRUB_DEFAULT_BUTTON</span></samp>&rsquo; and
&lsquo;<samp><span class="samp">GRUB_HIDDEN_TIMEOUT_BUTTON</span></samp>&rsquo; are used instead of the corresponding
variables without the &lsquo;<samp><span class="samp">_BUTTON</span></samp>&rsquo; suffix when powered on using the special
button.  &lsquo;<samp><span class="samp">GRUB_BUTTON_CMOS_ADDRESS</span></samp>&rsquo; is vendor-specific and partially
model-specific.  Values known to the GRUB team are:

     <dl>
<dt>&lt;Dell XPS M1530&gt;<dd>85:3
<br><dt>&lt;Asus EeePC 1005PE&gt;<dd>84:1 (unconfirmed)
</dl>

   <p>To take full advantage of this function, install GRUB into the MBR
(see <a href="#Installing-GRUB-using-grub_002dinstall">Installing GRUB using grub2-install</a>).

   <p>If you have a laptop which has a similar feature and not in the above list
could you figure your address and contribute? 
To discover the address do the following:
     <ul>
<li>boot normally
<li>
     <pre class="example">          sudo modprobe nvram
          sudo cat /dev/nvram | xxd &gt; normal_button.txt
</pre>
     <li>boot using vendor button
<li>
     <pre class="example">          sudo modprobe nvram
          sudo cat /dev/nvram | xxd &gt; normal_vendor.txt
</pre>
     </ul>

   <p>Then compare these text files and find where a bit was toggled. E.g. in
case of Dell XPS it was:
<pre class="example">     byte 0x47: 20 --&gt; 28
</pre>
   <p>It's a bit number 3 as seen from following table:
   <p><table summary=""><tr align="left"><td valign="top" width="20%">0 </td><td valign="top" width="20%">01
<br></td></tr><tr align="left"><td valign="top" width="20%">1 </td><td valign="top" width="20%">02
<br></td></tr><tr align="left"><td valign="top" width="20%">2 </td><td valign="top" width="20%">04
<br></td></tr><tr align="left"><td valign="top" width="20%">3 </td><td valign="top" width="20%">08
<br></td></tr><tr align="left"><td valign="top" width="20%">4 </td><td valign="top" width="20%">10
<br></td></tr><tr align="left"><td valign="top" width="20%">5 </td><td valign="top" width="20%">20
<br></td></tr><tr align="left"><td valign="top" width="20%">6 </td><td valign="top" width="20%">40
<br></td></tr><tr align="left"><td valign="top" width="20%">7 </td><td valign="top" width="20%">80
   <br></td></tr></table>

   <p>0x47 is decimal 71. Linux nvram implementation cuts first 14 bytes of
CMOS. So the real byte address in CMOS is 71+14=85
So complete address is 85:3

<div class="node">
<a name="Images"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Filesystem">Filesystem</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Vendor-power_002don-keys">Vendor power-on keys</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">10 GRUB image files</h2>

<!-- FIXME: parts of this section are specific to PC BIOS right now. -->
<p>GRUB consists of several images: a variety of bootstrap images for starting
GRUB in various ways, a kernel image, and a set of modules which are
combined with the kernel image to form a core image.  Here is a short
overview of them.

     <dl>
<dt><samp><span class="file">boot.img</span></samp><dd>On PC BIOS systems, this image is the first part of GRUB to start.  It is
written to a master boot record (MBR) or to the boot sector of a partition. 
Because a PC boot sector is 512 bytes, the size of this image is exactly 512
bytes.

     <p>The sole function of <samp><span class="file">boot.img</span></samp> is to read the first sector of the core
image from a local disk and jump to it.  Because of the size restriction,
<samp><span class="file">boot.img</span></samp> cannot understand any file system structure, so
<samp><span class="command">grub2-setup</span></samp> hardcodes the location of the first sector of the core
image into <samp><span class="file">boot.img</span></samp> when installing GRUB.

     <br><dt><samp><span class="file">diskboot.img</span></samp><dd>This image is used as the first sector of the core image when booting from a
hard disk.  It reads the rest of the core image into memory and starts the
kernel.  Since file system handling is not yet available, it encodes the
location of the core image using a block list format.

     <br><dt><samp><span class="file">cdboot.img</span></samp><dd>This image is used as the first sector of the core image when booting from a
CD-ROM drive.  It performs a similar function to <samp><span class="file">diskboot.img</span></samp>.

     <br><dt><samp><span class="file">pxeboot.img</span></samp><dd>This image is used as the start of the core image when booting from the
network using PXE.  See <a href="#Network">Network</a>.

     <br><dt><samp><span class="file">lnxboot.img</span></samp><dd>This image may be placed at the start of the core image in order to make
GRUB look enough like a Linux kernel that it can be booted by LILO using an
&lsquo;<samp><span class="samp">image=</span></samp>&rsquo; section.

     <br><dt><samp><span class="file">kernel.img</span></samp><dd>This image contains GRUB's basic run-time facilities: frameworks for device
and file handling, environment variables, the rescue mode command-line
parser, and so on.  It is rarely used directly, but is built into all core
images.

     <br><dt><samp><span class="file">core.img</span></samp><dd>This is the core image of GRUB.  It is built dynamically from the kernel
image and an arbitrary list of modules by the <samp><span class="command">grub2-mkimage</span></samp>
program.  Usually, it contains enough modules to access <samp><span class="file">/boot/grub</span></samp>,
and loads everything else (including menu handling, the ability to load
target operating systems, and so on) from the file system at run-time.  The
modular design allows the core image to be kept small, since the areas of
disk where it must be installed are often as small as 32KB.

     <p>See <a href="#BIOS-installation">BIOS installation</a>, for details on where the core image can be
installed on PC systems.

     <br><dt><samp><span class="file">*.mod</span></samp><dd>Everything else in GRUB resides in dynamically loadable modules.  These are
often loaded automatically, or built into the core image if they are
essential, but may also be loaded manually using the <samp><span class="command">insmod</span></samp>
command (see <a href="#insmod">insmod</a>). 
</dl>

<h3 class="heading">For GRUB Legacy users</h3>

<p>GRUB 2 has a different design from GRUB Legacy, and so correspondences with
the images it used cannot be exact.  Nevertheless, GRUB Legacy users often
ask questions in the terms they are familiar with, and so here is a brief
guide to how GRUB 2's images relate to that.

     <dl>
<dt><samp><span class="file">stage1</span></samp><dd>Stage 1 from GRUB Legacy was very similar to <samp><span class="file">boot.img</span></samp> in GRUB 2, and
they serve the same function.

     <br><dt><samp><span class="file">*_stage1_5</span></samp><dd>In GRUB Legacy, Stage 1.5's function was to include enough filesystem code
to allow the much larger Stage 2 to be read from an ordinary filesystem.  In
this respect, its function was similar to <samp><span class="file">core.img</span></samp> in GRUB 2. 
However, <samp><span class="file">core.img</span></samp> is much more capable than Stage 1.5 was; since it
offers a rescue shell, it is sometimes possible to recover manually in the
event that it is unable to load any other modules, for example if partition
numbers have changed.  <samp><span class="file">core.img</span></samp> is built in a more flexible way,
allowing GRUB 2 to support reading modules from advanced disk types such as
LVM and RAID.

     <p>GRUB Legacy could run with only Stage 1 and Stage 2 in some limited
configurations, while GRUB 2 requires <samp><span class="file">core.img</span></samp> and cannot work
without it.

     <br><dt><samp><span class="file">stage2</span></samp><dd>GRUB 2 has no single Stage 2 image.  Instead, it loads modules from
<samp><span class="file">/boot/grub</span></samp> at run-time.

     <br><dt><samp><span class="file">stage2_eltorito</span></samp><dd>In GRUB 2, images for booting from CD-ROM drives are now constructed using
<samp><span class="file">cdboot.img</span></samp> and <samp><span class="file">core.img</span></samp>, making sure that the core image
contains the &lsquo;<samp><span class="samp">iso9660</span></samp>&rsquo; module.  It is usually best to use the
<samp><span class="command">grub2-mkrescue</span></samp> program for this.

     <br><dt><samp><span class="file">nbgrub</span></samp><dd>There is as yet no equivalent for <samp><span class="file">nbgrub</span></samp> in GRUB 2; it was used by
Etherboot and some other network boot loaders.

     <br><dt><samp><span class="file">pxegrub</span></samp><dd>In GRUB 2, images for PXE network booting are now constructed using
<samp><span class="file">pxeboot.img</span></samp> and <samp><span class="file">core.img</span></samp>, making sure that the core image
contains the &lsquo;<samp><span class="samp">pxe</span></samp>&rsquo; and &lsquo;<samp><span class="samp">pxecmd</span></samp>&rsquo; modules.  See <a href="#Network">Network</a>. 
</dl>

<div class="node">
<a name="Filesystem"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Interface">Interface</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Images">Images</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">11 Filesystem syntax and semantics</h2>

<p>GRUB uses a special syntax for specifying disk drives which can be
accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish
between IDE, ESDI, SCSI, or others. You must know yourself which BIOS
device is equivalent to which OS device. Normally, that will be clear if
you see the files in a device or use the command <samp><span class="command">search</span></samp>
(see <a href="#search">search</a>).

<ul class="menu">
<li><a accesskey="1" href="#Device-syntax">Device syntax</a>:                How to specify devices
<li><a accesskey="2" href="#File-name-syntax">File name syntax</a>:             How to specify files
<li><a accesskey="3" href="#Block-list-syntax">Block list syntax</a>:            How to specify block lists
</ul>

<div class="node">
<a name="Device-syntax"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#File-name-syntax">File name syntax</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Filesystem">Filesystem</a>

</div>

<h3 class="section">11.1 How to specify devices</h3>

<p>The device syntax is like this:

<pre class="example">     <code>(</code><var>device</var><code>[,</code><var>partmap-name1</var><var>part-num1</var><code>[,</code><var>partmap-name2</var><var>part-num2</var><code>[,...]]])</code>
</pre>
   <p>&lsquo;<samp><span class="samp">[]</span></samp>&rsquo; means the parameter is optional. <var>device</var> depends on the disk
driver in use. BIOS and EFI disks use either &lsquo;<samp><span class="samp">fd</span></samp>&rsquo; or &lsquo;<samp><span class="samp">hd</span></samp>&rsquo; followed
by a digit, like &lsquo;<samp><span class="samp">fd0</span></samp>&rsquo;, or &lsquo;<samp><span class="samp">cd</span></samp>&rsquo;. 
AHCI, PATA (ata), crypto, USB use the name of driver followed by a number. 
Memdisk and host are limited to one disk and so it's refered just by driver
name. 
RAID (md), ofdisk (ieee1275 and nand), LVM (lv), LDM and arcdisk (arc) use
intrinsic name of disk prefixed by driver name. Additionally just &ldquo;nand&rdquo;
refers to the disk aliased as &ldquo;nand&rdquo;. 
Conflicts are solved by suffixing a number if necessarry. 
Commas need to be escaped. 
Loopback uses whatever name specified to <samp><span class="command">loopback</span></samp> command. 
Hostdisk uses names specified in device.map as long as it's of the form
[fhc]d[0-9]* or hostdisk/&lt;OS DEVICE&gt;. 
For crypto and RAID (md) additionally you can use the syntax
&lt;driver name&gt;uuid/&lt;uuid&gt;.

<pre class="example">     (fd0)
     (hd0)
     (cd)
     (ahci0)
     (ata0)
     (crypto0)
     (usb0)
     (cryptouuid/123456789abcdef0123456789abcdef0)
     (mduuid/123456789abcdef0123456789abcdef0)
     (lv/system-root)
     (md/myraid)
     (md/0)
     (ieee1275/disk2)
     (ieee1275//pci@1f\,0/ide@d/disk@2)
     (nand)
     (memdisk)
     (host)
     (myloop)
     (hostdisk//dev/sda)
</pre>
   <p><var>part-num</var> represents the partition number of <var>device</var>, starting
from one. <var>partname</var> is optional but is recommended since disk may have
several top-level partmaps. Specifying third and later component you can access
to subpartitions.

   <p>The syntax &lsquo;<samp><span class="samp">(hd0)</span></samp>&rsquo; represents using the entire disk (or the
MBR when installing GRUB), while the syntax &lsquo;<samp><span class="samp">(hd0,1)</span></samp>&rsquo;
represents using the first partition of the disk (or the boot sector
of the partition when installing GRUB).

<pre class="example">     (hd0,msdos1)
     (hd0,msdos1,msdos5)
     (hd0,msdos1,bsd3)
     (hd0,netbsd1)
     (hd0,gpt1)
     (hd0,1,3)
</pre>
   <p>If you enabled the network support, the special drives &lsquo;<samp><span class="samp">(tftp)</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">(http)</span></samp>&rsquo; and so on ars also available. 
Before using the network drive, you must initialize the network. 
See <a href="#Network">Network</a>, for more information.

   <p>If you boot GRUB from a CD-ROM, &lsquo;<samp><span class="samp">(cd)</span></samp>&rsquo; is available. See <a href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>, for details.

<div class="node">
<a name="File-name-syntax"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Block-list-syntax">Block list syntax</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Device-syntax">Device syntax</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Filesystem">Filesystem</a>

</div>

<h3 class="section">11.2 How to specify files</h3>

<p>There are two ways to specify files, by <dfn>absolute file name</dfn> and by
<dfn>block list</dfn>.

   <p>An absolute file name resembles a Unix absolute file name, using
&lsquo;<samp><span class="samp">/</span></samp>&rsquo; for the directory separator (not &lsquo;<samp><span class="samp">\</span></samp>&rsquo; as in DOS). One
example is &lsquo;<samp><span class="samp">(hd0,1)/boot/grub2/grub.cfg</span></samp>&rsquo;. This means the file
<samp><span class="file">/boot/grub2/grub.cfg</span></samp> in the first partition of the first hard
disk. If you omit the device name in an absolute file name, GRUB uses
GRUB's <dfn>root device</dfn> implicitly. So if you set the root device to,
say, &lsquo;<samp><span class="samp">(hd1,1)</span></samp>&rsquo; by the command &lsquo;<samp><span class="samp">set root=(hd1,1)</span></samp>&rsquo; (see <a href="#set">set</a>),
then <code>/boot/kernel</code> is the same as <code>(hd1,1)/boot/kernel</code>.

<div class="node">
<a name="Block-list-syntax"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#File-name-syntax">File name syntax</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Filesystem">Filesystem</a>

</div>

<h3 class="section">11.3 How to specify block lists</h3>

<p>A block list is used for specifying a file that doesn't appear in the
filesystem, like a chainloader. The syntax is
<code>[</code><var>offset</var><code>]+</code><var>length</var><code>[,[</code><var>offset</var><code>]+</code><var>length</var><code>]...</code>. 
Here is an example:

<pre class="example">     <code>0+100,200+1,300+300</code>
</pre>
   <p>This represents that GRUB should read blocks 0 through 99, block 200,
and blocks 300 through 599. If you omit an offset, then GRUB assumes
the offset is zero.

   <p>Like the file name syntax (see <a href="#File-name-syntax">File name syntax</a>), if a blocklist
does not contain a device name, then GRUB uses GRUB's <dfn>root
device</dfn>. So <code>(hd0,2)+1</code> is the same as <code>+1</code> when the root
device is &lsquo;<samp><span class="samp">(hd0,2)</span></samp>&rsquo;.

<div class="node">
<a name="Interface"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Environment">Environment</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Filesystem">Filesystem</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">12 GRUB's user interface</h2>

<p>GRUB has both a simple menu interface for choosing preset entries from a
configuration file, and a highly flexible command-line for performing
any desired combination of boot commands.

   <p>GRUB looks for its configuration file as soon as it is loaded. If one
is found, then the full menu interface is activated using whatever
entries were found in the file. If you choose the <dfn>command-line</dfn> menu
option, or if the configuration file was not found, then GRUB drops to
the command-line interface.

<ul class="menu">
<li><a accesskey="1" href="#Command_002dline-interface">Command-line interface</a>:       The flexible command-line interface
<li><a accesskey="2" href="#Menu-interface">Menu interface</a>:               The simple menu interface
<li><a accesskey="3" href="#Menu-entry-editor">Menu entry editor</a>:            Editing a menu entry
</ul>

<div class="node">
<a name="Command-line-interface"></a>
<a name="Command_002dline-interface"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Menu-interface">Menu interface</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Interface">Interface</a>

</div>

<h3 class="section">12.1 The flexible command-line interface</h3>

<p>The command-line interface provides a prompt and after it an editable
text area much like a command-line in Unix or DOS. Each command is
immediately executed after it is entered<a rel="footnote" href="#fn-7" name="fnd-7"><sup>7</sup></a>. The commands (see <a href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>) are a
subset of those available in the configuration file, used with exactly
the same syntax.

   <p>Cursor movement and editing of the text on the line can be done via a
subset of the functions available in the Bash shell:

     <dl>
<dt>&lt;C-f&gt;<dt>&lt;PC right key&gt;<dd>Move forward one character.

     <br><dt>&lt;C-b&gt;<dt>&lt;PC left key&gt;<dd>Move back one character.

     <br><dt>&lt;C-a&gt;<dt>&lt;HOME&gt;<dd>Move to the start of the line.

     <br><dt>&lt;C-e&gt;<dt>&lt;END&gt;<dd>Move the the end of the line.

     <br><dt>&lt;C-d&gt;<dt>&lt;DEL&gt;<dd>Delete the character underneath the cursor.

     <br><dt>&lt;C-h&gt;<dt>&lt;BS&gt;<dd>Delete the character to the left of the cursor.

     <br><dt>&lt;C-k&gt;<dd>Kill the text from the current cursor position to the end of the line.

     <br><dt>&lt;C-u&gt;<dd>Kill backward from the cursor to the beginning of the line.

     <br><dt>&lt;C-y&gt;<dd>Yank the killed text back into the buffer at the cursor.

     <br><dt>&lt;C-p&gt;<dt>&lt;PC up key&gt;<dd>Move up through the history list.

     <br><dt>&lt;C-n&gt;<dt>&lt;PC down key&gt;<dd>Move down through the history list. 
</dl>

   <p>When typing commands interactively, if the cursor is within or before
the first word in the command-line, pressing the &lt;TAB&gt; key (or
&lt;C-i&gt;) will display a listing of the available commands, and if the
cursor is after the first word, the <kbd>&lt;TAB&gt;</kbd> will provide a
completion listing of disks, partitions, and file names depending on the
context. Note that to obtain a list of drives, one must open a
parenthesis, as <samp><span class="command">root (</span></samp>.

   <p>Note that you cannot use the completion functionality in the TFTP
filesystem. This is because TFTP doesn't support file name listing for
the security.

<div class="node">
<a name="Menu-interface"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Menu-entry-editor">Menu entry editor</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Command_002dline-interface">Command-line interface</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Interface">Interface</a>

</div>

<h3 class="section">12.2 The simple menu interface</h3>

<p>The menu interface is quite easy to use. Its commands are both
reasonably intuitive and described on screen.

   <p>Basically, the menu interface provides a list of <dfn>boot entries</dfn> to
the user to choose from. Use the arrow keys to select the entry of
choice, then press &lt;RET&gt; to run it.  An optional timeout is
available to boot the default entry (the first one if not set), which is
aborted by pressing any key.

   <p>Commands are available to enter a bare command-line by pressing &lt;c&gt;
(which operates exactly like the non-config-file version of GRUB, but
allows one to return to the menu if desired by pressing &lt;ESC&gt;) or to
edit any of the <dfn>boot entries</dfn> by pressing &lt;e&gt;.

   <p>If you protect the menu interface with a password (see <a href="#Security">Security</a>),
all you can do is choose an entry by pressing &lt;RET&gt;, or press
&lt;p&gt; to enter the password.

<div class="node">
<a name="Menu-entry-editor"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Menu-interface">Menu interface</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Interface">Interface</a>

</div>

<h3 class="section">12.3 Editing a menu entry</h3>

<p>The menu entry editor looks much like the main menu interface, but the
lines in the menu are individual commands in the selected entry instead
of entry names.

   <p>If an &lt;ESC&gt; is pressed in the editor, it aborts all the changes made
to the configuration entry and returns to the main menu interface.

   <p>Each line in the menu entry can be edited freely, and you can add new lines
by pressing &lt;RET&gt; at the end of a line.  To boot the edited entry, press
&lt;Ctrl-x&gt;.

   <p>Although GRUB unfortunately does not support <dfn>undo</dfn>, you can do almost
the same thing by just returning to the main menu using &lt;ESC&gt;.

<div class="node">
<a name="Environment"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Commands">Commands</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Interface">Interface</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">13 GRUB environment variables</h2>

<p>GRUB supports environment variables which are rather like those offered by
all Unix-like systems.  Environment variables have a name, which is unique
and is usually a short identifier, and a value, which is an arbitrary string
of characters.  They may be set (see <a href="#set">set</a>), unset (see <a href="#unset">unset</a>), or
looked up (see <a href="#Shell_002dlike-scripting">Shell-like scripting</a>) by name.

   <p>A number of environment variables have special meanings to various parts of
GRUB.  Others may be used freely in GRUB configuration files.

<ul class="menu">
<li><a accesskey="1" href="#Special-environment-variables">Special environment variables</a>
<li><a accesskey="2" href="#Environment-block">Environment block</a>
</ul>

<div class="node">
<a name="Special-environment-variables"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Environment-block">Environment block</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Environment">Environment</a>

</div>

<h3 class="section">13.1 Special environment variables</h3>

<p>These variables have special meaning to GRUB.

<ul class="menu">
<li><a accesskey="1" href="#biosnum">biosnum</a>
<li><a accesskey="2" href="#chosen">chosen</a>
<li><a accesskey="3" href="#color_005fhighlight">color_highlight</a>
<li><a accesskey="4" href="#color_005fnormal">color_normal</a>
<li><a accesskey="5" href="#debug">debug</a>
<li><a accesskey="6" href="#default">default</a>
<li><a accesskey="7" href="#fallback">fallback</a>
<li><a accesskey="8" href="#gfxmode">gfxmode</a>
<li><a accesskey="9" href="#gfxpayload">gfxpayload</a>
<li><a href="#gfxterm_005ffont">gfxterm_font</a>
<li><a href="#icondir">icondir</a>
<li><a href="#lang">lang</a>
<li><a href="#locale_005fdir">locale_dir</a>
<li><a href="#menu_005fcolor_005fhighlight">menu_color_highlight</a>
<li><a href="#menu_005fcolor_005fnormal">menu_color_normal</a>
<li><a href="#net_005fpxe_005fboot_005ffile">net_pxe_boot_file</a>
<li><a href="#net_005fpxe_005fdhcp_005fserver_005fname">net_pxe_dhcp_server_name</a>
<li><a href="#net_005fpxe_005fdomain">net_pxe_domain</a>
<li><a href="#net_005fpxe_005fextensionspath">net_pxe_extensionspath</a>
<li><a href="#net_005fpxe_005fhostname">net_pxe_hostname</a>
<li><a href="#net_005fpxe_005fip">net_pxe_ip</a>
<li><a href="#net_005fpxe_005fmac">net_pxe_mac</a>
<li><a href="#net_005fpxe_005frootpath">net_pxe_rootpath</a>
<li><a href="#pager">pager</a>
<li><a href="#prefix">prefix</a>
<li><a href="#pxe_005fblksize">pxe_blksize</a>
<li><a href="#pxe_005fdefault_005fgateway">pxe_default_gateway</a>
<li><a href="#pxe_005fdefault_005fserver">pxe_default_server</a>
<li><a href="#root">root</a>
<li><a href="#superusers">superusers</a>
<li><a href="#theme">theme</a>
<li><a href="#timeout">timeout</a>
</ul>

<div class="node">
<a name="biosnum"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#chosen">chosen</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.1 biosnum</h4>

<p>When chain-loading another boot loader (see <a href="#Chain_002dloading">Chain-loading</a>), GRUB may
need to know what BIOS drive number corresponds to the root device
(see <a href="#root">root</a>) so that it can set up registers properly.  If the
<var>biosnum</var> variable is set, it overrides GRUB's own means of guessing
this.

   <p>For an alternative approach which also changes BIOS drive mappings for the
chain-loaded system, see <a href="#drivemap">drivemap</a>.

<div class="node">
<a name="chosen"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#color_005fhighlight">color_highlight</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#biosnum">biosnum</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.2 chosen</h4>

<p>When executing a menu entry, GRUB sets the <var>chosen</var> variable to the
title of the entry being executed.

   <p>If the menu entry is in one or more submenus, then <var>chosen</var> is set to
the titles of each of the submenus starting from the top level followed by
the title of the menu entry itself, separated by &lsquo;<samp><span class="samp">&gt;</span></samp>&rsquo;.

<div class="node">
<a name="color_highlight"></a>
<a name="color_005fhighlight"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#color_005fnormal">color_normal</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#chosen">chosen</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.3 color_highlight</h4>

<p>This variable contains the &ldquo;highlight&rdquo; foreground and background terminal
colors, separated by a slash (&lsquo;<samp><span class="samp">/</span></samp>&rsquo;).  Setting this variable changes
those colors.  For the available color names, see <a href="#color_005fnormal">color_normal</a>.

   <p>The default is &lsquo;<samp><span class="samp">black/white</span></samp>&rsquo;.

<div class="node">
<a name="color_normal"></a>
<a name="color_005fnormal"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#debug">debug</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#color_005fhighlight">color_highlight</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.4 color_normal</h4>

<p>This variable contains the &ldquo;normal&rdquo; foreground and background terminal
colors, separated by a slash (&lsquo;<samp><span class="samp">/</span></samp>&rsquo;).  Setting this variable changes
those colors.  Each color must be a name from the following list:

     <ul>
<li>black
<li>blue
<li>green
<li>cyan
<li>red
<li>magenta
<li>brown
<li>light-gray
<li>dark-gray
<li>light-blue
<li>light-green
<li>light-cyan
<li>light-red
<li>light-magenta
<li>yellow
<li>white
</ul>

   <p>The default is &lsquo;<samp><span class="samp">white/black</span></samp>&rsquo;.

<div class="node">
<a name="debug"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#default">default</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#color_005fnormal">color_normal</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.5 debug</h4>

<p>This variable may be set to enable debugging output from various components
of GRUB.  The value is a list of debug facility names separated by
whitespace or &lsquo;<samp><span class="samp">,</span></samp>&rsquo;, or &lsquo;<samp><span class="samp">all</span></samp>&rsquo; to enable all available debugging
output.

<div class="node">
<a name="default"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#fallback">fallback</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#debug">debug</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.6 default</h4>

<p>If this variable is set, it identifies a menu entry that should be selected
by default, possibly after a timeout (see <a href="#timeout">timeout</a>).  The entry may be
identified by number or by title.

   <p>If the entry is in a submenu, then it must be identified using the titles of
each of the submenus starting from the top level followed by the number or
title of the menu entry itself, separated by &lsquo;<samp><span class="samp">&gt;</span></samp>&rsquo;.  For example, take
the following menu structure:

<pre class="example">     Submenu 1
       Menu Entry 1
       Menu Entry 2
     Submenu 2
       Submenu 3
         Menu Entry 3
         Menu Entry 4
       Menu Entry 5
</pre>
   <p>&ldquo;Menu Entry 3&rdquo; would then be identified as
&lsquo;<samp><span class="samp">Submenu 2&gt;Submenu 3&gt;Menu Entry 3</span></samp>&rsquo;.

   <p>This variable is often set by &lsquo;<samp><span class="samp">GRUB_DEFAULT</span></samp>&rsquo; (see <a href="#Simple-configuration">Simple configuration</a>), <samp><span class="command">grub2-set-default</span></samp>, or <samp><span class="command">grub2-reboot</span></samp>.

<div class="node">
<a name="fallback"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#gfxmode">gfxmode</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#default">default</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.7 fallback</h4>

<p>If this variable is set, it identifies a menu entry that should be selected
if the default menu entry fails to boot.  Entries are identified in the same
way as for &lsquo;<samp><span class="samp">default</span></samp>&rsquo; (see <a href="#default">default</a>).

<div class="node">
<a name="gfxmode"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#gfxpayload">gfxpayload</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#fallback">fallback</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.8 gfxmode</h4>

<p>If this variable is set, it sets the resolution used on the &lsquo;<samp><span class="samp">gfxterm</span></samp>&rsquo;
graphical terminal.  Note that you can only use modes which your graphics
card supports via VESA BIOS Extensions (VBE), so for example native LCD
panel resolutions may not be available.  The default is &lsquo;<samp><span class="samp">auto</span></samp>&rsquo;, which
selects a platform-specific default that should look reasonable.

   <p>The resolution may be specified as a sequence of one or more modes,
separated by commas (&lsquo;<samp><span class="samp">,</span></samp>&rsquo;) or semicolons (&lsquo;<samp><span class="samp">;</span></samp>&rsquo;); each will be tried
in turn until one is found.  Each mode should be either &lsquo;<samp><span class="samp">auto</span></samp>&rsquo;,
&lsquo;<samp><var>width</var><span class="samp">x</span><var>height</var></samp>&rsquo;, or
&lsquo;<samp><var>width</var><span class="samp">x</span><var>height</var><span class="samp">x</span><var>depth</var></samp>&rsquo;.

<div class="node">
<a name="gfxpayload"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#gfxterm_005ffont">gfxterm_font</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#gfxmode">gfxmode</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.9 gfxpayload</h4>

<p>If this variable is set, it controls the video mode in which the Linux
kernel starts up, replacing the &lsquo;<samp><span class="samp">vga=</span></samp>&rsquo; boot option (see <a href="#linux">linux</a>).  It
may be set to &lsquo;<samp><span class="samp">text</span></samp>&rsquo; to force the Linux kernel to boot in normal text
mode, &lsquo;<samp><span class="samp">keep</span></samp>&rsquo; to preserve the graphics mode set using &lsquo;<samp><span class="samp">gfxmode</span></samp>&rsquo;, or
any of the permitted values for &lsquo;<samp><span class="samp">gfxmode</span></samp>&rsquo; to set a particular graphics
mode (see <a href="#gfxmode">gfxmode</a>).

   <p>Depending on your kernel, your distribution, your graphics card, and the
phase of the moon, note that using this option may cause GNU/Linux to suffer
from various display problems, particularly during the early part of the
boot sequence.  If you have problems, set this variable to &lsquo;<samp><span class="samp">text</span></samp>&rsquo; and
GRUB will tell Linux to boot in normal text mode.

   <p>The default is platform-specific.  On platforms with a native text mode
(such as PC BIOS platforms), the default is &lsquo;<samp><span class="samp">text</span></samp>&rsquo;.  Otherwise the
default may be &lsquo;<samp><span class="samp">auto</span></samp>&rsquo; or a specific video mode.

   <p>This variable is often set by &lsquo;<samp><span class="samp">GRUB_GFXPAYLOAD_LINUX</span></samp>&rsquo; (see <a href="#Simple-configuration">Simple configuration</a>).

<div class="node">
<a name="gfxterm_font"></a>
<a name="gfxterm_005ffont"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#icondir">icondir</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#gfxpayload">gfxpayload</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.10 gfxterm_font</h4>

<p>If this variable is set, it names a font to use for text on the
&lsquo;<samp><span class="samp">gfxterm</span></samp>&rsquo; graphical terminal.  Otherwise, &lsquo;<samp><span class="samp">gfxterm</span></samp>&rsquo; may use any
available font.

<div class="node">
<a name="icondir"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#lang">lang</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#gfxterm_005ffont">gfxterm_font</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.11 icondir</h4>

<p>If this variable is set, it names a directory in which the GRUB graphical
menu should look for icons after looking in the theme's &lsquo;<samp><span class="samp">icons</span></samp>&rsquo;
directory.  See <a href="#Theme-file-format">Theme file format</a>.

<div class="node">
<a name="lang"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#locale_005fdir">locale_dir</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#icondir">icondir</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.12 lang</h4>

<p>If this variable is set, it names the language code that the
<samp><span class="command">gettext</span></samp> command (see <a href="#gettext">gettext</a>) uses to translate strings.  For
example, French would be named as &lsquo;<samp><span class="samp">fr</span></samp>&rsquo;, and Simplified Chinese as
&lsquo;<samp><span class="samp">zh_CN</span></samp>&rsquo;.

   <p><samp><span class="command">grub2-mkconfig</span></samp> (see <a href="#Simple-configuration">Simple configuration</a>) will try to set a
reasonable default for this variable based on the system locale.

<div class="node">
<a name="locale_dir"></a>
<a name="locale_005fdir"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#menu_005fcolor_005fhighlight">menu_color_highlight</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#lang">lang</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.13 locale_dir</h4>

<p>If this variable is set, it names the directory where translation files may
be found (see <a href="#gettext">gettext</a>), usually <samp><span class="file">/boot/grub2/locale</span></samp>.  Otherwise,
internationalization is disabled.

   <p><samp><span class="command">grub2-mkconfig</span></samp> (see <a href="#Simple-configuration">Simple configuration</a>) will set a reasonable
default for this variable if internationalization is needed and any
translation files are available.

<div class="node">
<a name="menu_color_highlight"></a>
<a name="menu_005fcolor_005fhighlight"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#menu_005fcolor_005fnormal">menu_color_normal</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#locale_005fdir">locale_dir</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.14 menu_color_highlight</h4>

<p>This variable contains the foreground and background colors to be used for
the highlighted menu entry, separated by a slash (&lsquo;<samp><span class="samp">/</span></samp>&rsquo;).  Setting this
variable changes those colors.  For the available color names,
see <a href="#color_005fnormal">color_normal</a>.

   <p>The default is the value of &lsquo;<samp><span class="samp">color_highlight</span></samp>&rsquo;
(see <a href="#color_005fhighlight">color_highlight</a>).

<div class="node">
<a name="menu_color_normal"></a>
<a name="menu_005fcolor_005fnormal"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#net_005fpxe_005fboot_005ffile">net_pxe_boot_file</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#menu_005fcolor_005fhighlight">menu_color_highlight</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.15 menu_color_normal</h4>

<p>This variable contains the foreground and background colors to be used for
non-highlighted menu entries, separated by a slash (&lsquo;<samp><span class="samp">/</span></samp>&rsquo;).  Setting this
variable changes those colors.  For the available color names,
see <a href="#color_005fnormal">color_normal</a>.

   <p>The default is the value of &lsquo;<samp><span class="samp">color_normal</span></samp>&rsquo; (see <a href="#color_005fnormal">color_normal</a>).

<div class="node">
<a name="net_pxe_boot_file"></a>
<a name="net_005fpxe_005fboot_005ffile"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#net_005fpxe_005fdhcp_005fserver_005fname">net_pxe_dhcp_server_name</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#menu_005fcolor_005fnormal">menu_color_normal</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.16 net_pxe_boot_file</h4>

<p>See <a href="#Network">Network</a>.

<div class="node">
<a name="net_pxe_dhcp_server_name"></a>
<a name="net_005fpxe_005fdhcp_005fserver_005fname"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#net_005fpxe_005fdomain">net_pxe_domain</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#net_005fpxe_005fboot_005ffile">net_pxe_boot_file</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.17 net_pxe_dhcp_server_name</h4>

<p>See <a href="#Network">Network</a>.

<div class="node">
<a name="net_pxe_domain"></a>
<a name="net_005fpxe_005fdomain"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#net_005fpxe_005fextensionspath">net_pxe_extensionspath</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#net_005fpxe_005fdhcp_005fserver_005fname">net_pxe_dhcp_server_name</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.18 net_pxe_domain</h4>

<p>See <a href="#Network">Network</a>.

<div class="node">
<a name="net_pxe_extensionspath"></a>
<a name="net_005fpxe_005fextensionspath"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#net_005fpxe_005fhostname">net_pxe_hostname</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#net_005fpxe_005fdomain">net_pxe_domain</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.19 net_pxe_extensionspath</h4>

<p>See <a href="#Network">Network</a>.

<div class="node">
<a name="net_pxe_hostname"></a>
<a name="net_005fpxe_005fhostname"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#net_005fpxe_005fip">net_pxe_ip</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#net_005fpxe_005fextensionspath">net_pxe_extensionspath</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.20 net_pxe_hostname</h4>

<p>See <a href="#Network">Network</a>.

<div class="node">
<a name="net_pxe_ip"></a>
<a name="net_005fpxe_005fip"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#net_005fpxe_005fmac">net_pxe_mac</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#net_005fpxe_005fhostname">net_pxe_hostname</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.21 net_pxe_ip</h4>

<p>See <a href="#Network">Network</a>.

<div class="node">
<a name="net_pxe_mac"></a>
<a name="net_005fpxe_005fmac"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#net_005fpxe_005frootpath">net_pxe_rootpath</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#net_005fpxe_005fip">net_pxe_ip</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.22 net_pxe_mac</h4>

<p>See <a href="#Network">Network</a>.

<div class="node">
<a name="net_pxe_rootpath"></a>
<a name="net_005fpxe_005frootpath"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#pager">pager</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#net_005fpxe_005fmac">net_pxe_mac</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.23 net_pxe_rootpath</h4>

<p>See <a href="#Network">Network</a>.

<div class="node">
<a name="pager"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#prefix">prefix</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#net_005fpxe_005frootpath">net_pxe_rootpath</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.24 pager</h4>

<p>If set to &lsquo;<samp><span class="samp">1</span></samp>&rsquo;, pause output after each screenful and wait for keyboard
input.  The default is not to pause output.

<div class="node">
<a name="prefix"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#pxe_005fblksize">pxe_blksize</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#pager">pager</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.25 prefix</h4>

<p>The location of the &lsquo;<samp><span class="samp">/boot/grub</span></samp>&rsquo; directory as an absolute file name
(see <a href="#File-name-syntax">File name syntax</a>).  This is normally set by GRUB at startup based
on information provided by <samp><span class="command">grub2-install</span></samp>.  GRUB modules are
dynamically loaded from this directory, so it must be set correctly in order
for many parts of GRUB to work.

<div class="node">
<a name="pxe_blksize"></a>
<a name="pxe_005fblksize"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#pxe_005fdefault_005fgateway">pxe_default_gateway</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#prefix">prefix</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.26 pxe_blksize</h4>

<p>See <a href="#Network">Network</a>.

<div class="node">
<a name="pxe_default_gateway"></a>
<a name="pxe_005fdefault_005fgateway"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#pxe_005fdefault_005fserver">pxe_default_server</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#pxe_005fblksize">pxe_blksize</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.27 pxe_default_gateway</h4>

<p>See <a href="#Network">Network</a>.

<div class="node">
<a name="pxe_default_server"></a>
<a name="pxe_005fdefault_005fserver"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#root">root</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#pxe_005fdefault_005fgateway">pxe_default_gateway</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.28 pxe_default_server</h4>

<p>See <a href="#Network">Network</a>.

<div class="node">
<a name="root"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#superusers">superusers</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#pxe_005fdefault_005fserver">pxe_default_server</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.29 root</h4>

<p>The root device name (see <a href="#Device-syntax">Device syntax</a>).  Any file names that do not
specify an explicit device name are read from this device.  The default is
normally set by GRUB at startup based on the value of &lsquo;<samp><span class="samp">prefix</span></samp>&rsquo;
(see <a href="#prefix">prefix</a>).

   <p>For example, if GRUB was installed to the first partition of the first hard
disk, then &lsquo;<samp><span class="samp">prefix</span></samp>&rsquo; might be set to &lsquo;<samp><span class="samp">(hd0,msdos1)/boot/grub</span></samp>&rsquo; and
&lsquo;<samp><span class="samp">root</span></samp>&rsquo; to &lsquo;<samp><span class="samp">hd0,msdos1</span></samp>&rsquo;.

<div class="node">
<a name="superusers"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#theme">theme</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#root">root</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.30 superusers</h4>

<p>This variable may be set to a list of superuser names to enable
authentication support.  See <a href="#Security">Security</a>.

<div class="node">
<a name="theme"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#timeout">timeout</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#superusers">superusers</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.31 theme</h4>

<p>This variable may be set to a directory containing a GRUB graphical menu
theme.  See <a href="#Theme-file-format">Theme file format</a>.

   <p>This variable is often set by &lsquo;<samp><span class="samp">GRUB_THEME</span></samp>&rsquo; (see <a href="#Simple-configuration">Simple configuration</a>).

<div class="node">
<a name="timeout"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#theme">theme</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a>

</div>

<h4 class="subsection">13.1.32 timeout</h4>

<p>If this variable is set, it specifies the time in seconds to wait for
keyboard input before booting the default menu entry.  A timeout of &lsquo;<samp><span class="samp">0</span></samp>&rsquo;
means to boot the default entry immediately without displaying the menu; a
timeout of &lsquo;<samp><span class="samp">-1</span></samp>&rsquo; (or unset) means to wait indefinitely.

   <p>This variable is often set by &lsquo;<samp><span class="samp">GRUB_TIMEOUT</span></samp>&rsquo; or
&lsquo;<samp><span class="samp">GRUB_HIDDEN_TIMEOUT</span></samp>&rsquo; (see <a href="#Simple-configuration">Simple configuration</a>).

<div class="node">
<a name="Environment-block"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Special-environment-variables">Special environment variables</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Environment">Environment</a>

</div>

<h3 class="section">13.2 The GRUB environment block</h3>

<p>It is often useful to be able to remember a small amount of information from
one boot to the next.  For example, you might want to set the default menu
entry based on what was selected the last time.  GRUB deliberately does not
implement support for writing files in order to minimise the possibility of
the boot loader being responsible for file system corruption, so a GRUB
configuration file cannot just create a file in the ordinary way.  However,
GRUB provides an &ldquo;environment block&rdquo; which can be used to save a small
amount of state.

   <p>The environment block is a preallocated 1024-byte file, which normally lives
in <samp><span class="file">/boot/grub2/grubenv</span></samp> (although you should not assume this).  At boot
time, the <samp><span class="command">load_env</span></samp> command (see <a href="#load_005fenv">load_env</a>) loads environment
variables from it, and the <samp><span class="command">save_env</span></samp> (see <a href="#save_005fenv">save_env</a>) command
saves environment variables to it.  From a running system, the
<samp><span class="command">grub2-editenv</span></samp> utility can be used to edit the environment block.

   <p>For safety reasons, this storage is only available when installed on a plain
disk (no LVM or RAID), using a non-checksumming filesystem (no ZFS), and
using BIOS or EFI functions (no ATA, USB or IEEE1275).

   <p><samp><span class="command">grub2-mkconfig</span></samp> uses this facility to implement
&lsquo;<samp><span class="samp">GRUB_SAVEDEFAULT</span></samp>&rsquo; (see <a href="#Simple-configuration">Simple configuration</a>).

<div class="node">
<a name="Commands"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Internationalisation">Internationalisation</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Environment">Environment</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">14 The list of available commands</h2>

<p>In this chapter, we list all commands that are available in GRUB.

   <p>Commands belong to different groups. A few can only be used in
the global section of the configuration file (or &ldquo;menu&rdquo;); most
of them can be entered on the command-line and can be used either
anywhere in the menu or specifically in the menu entries.

   <p>In rescue mode, only the <samp><span class="command">insmod</span></samp> (see <a href="#insmod">insmod</a>), <samp><span class="command">ls</span></samp>
(see <a href="#ls">ls</a>), <samp><span class="command">set</span></samp> (see <a href="#set">set</a>), and <samp><span class="command">unset</span></samp>
(see <a href="#unset">unset</a>) commands are normally available.  If you end up in rescue
mode and do not know what to do, then see <a href="#GRUB-only-offers-a-rescue-shell">GRUB only offers a rescue shell</a>.

<ul class="menu">
<li><a accesskey="1" href="#Menu_002dspecific-commands">Menu-specific commands</a>
<li><a accesskey="2" href="#General-commands">General commands</a>
<li><a accesskey="3" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>
</ul>

<div class="node">
<a name="Menu-specific-commands"></a>
<a name="Menu_002dspecific-commands"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#General-commands">General commands</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Commands">Commands</a>

</div>

<h3 class="section">14.1 The list of commands for the menu only</h3>

<p>The semantics used in parsing the configuration file are the following:

     <ul>
<li>The files <em>must</em> be in plain-text format.

     <li>&lsquo;<samp><span class="samp">#</span></samp>&rsquo; at the beginning of a line in a configuration file means it is
only a comment.

     <li>Options are separated by spaces.

     <li>All numbers can be either decimal or hexadecimal. A hexadecimal number
must be preceded by &lsquo;<samp><span class="samp">0x</span></samp>&rsquo;, and is case-insensitive. 
</ul>

   <p>These commands can only be used in the menu:

<ul class="menu">
<li><a accesskey="1" href="#menuentry">menuentry</a>:                    Start a menu entry
<li><a accesskey="2" href="#submenu">submenu</a>:                      Group menu entries
</ul>

<div class="node">
<a name="menuentry"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#submenu">submenu</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Menu_002dspecific-commands">Menu-specific commands</a>

</div>

<h4 class="subsection">14.1.1 menuentry</h4>

<div class="defun">
&mdash; Command: <b>menuentry</b><var> title </var>[<samp><span class="option">--class=class</span></samp><var> <small class="dots">...</small></var>] [<samp><span class="option">--users=users</span></samp>] [<samp><span class="option">--unrestricted</span></samp>] [<samp><span class="option">--hotkey=key</span></samp>]<var> { command; <small class="dots">...</small> }<a name="index-menuentry-1"></a></var><br>
<blockquote><p>This defines a GRUB menu entry named <var>title</var>.  When this entry is
selected from the menu, GRUB will set the <var>chosen</var> environment variable
to <var>title</var>, execute the list of commands given within braces, and if the
last command in the list returned successfully and a kernel was loaded it
will execute the <samp><span class="command">boot</span></samp> command.

        <p>The <samp><span class="option">--class</span></samp> option may be used any number of times to group menu
entries into classes.  Menu themes may display different classes using
different styles.

        <p>The <samp><span class="option">--users</span></samp> option grants specific users access to specific menu
entries.  See <a href="#Security">Security</a>.

        <p>The <samp><span class="option">--unrestricted</span></samp> option grants all users access to specific menu
entries.  See <a href="#Security">Security</a>.

        <p>The <samp><span class="option">--hotkey</span></samp> option associates a hotkey with a menu entry. 
<var>key</var> may be a single letter, or one of the aliases &lsquo;<samp><span class="samp">backspace</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">tab</span></samp>&rsquo;, or &lsquo;<samp><span class="samp">delete</span></samp>&rsquo;. 
</p></blockquote></div>

<div class="node">
<a name="submenu"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#menuentry">menuentry</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Menu_002dspecific-commands">Menu-specific commands</a>

</div>

<h4 class="subsection">14.1.2 submenu</h4>

<div class="defun">
&mdash; Command: <b>submenu</b><var> title </var>[<samp><span class="option">--class=class</span></samp><var> <small class="dots">...</small></var>] [<samp><span class="option">--users=users</span></samp>] [<samp><span class="option">--unrestricted</span></samp>] [<samp><span class="option">--hotkey=key</span></samp>]<var> { menu entries <small class="dots">...</small> }<a name="index-submenu-2"></a></var><br>
<blockquote><p>This defines a submenu.  An entry called <var>title</var> will be added to the
menu; when that entry is selected, a new menu will be displayed showing all
the entries within this submenu.

        <p>All options are the same as in the <samp><span class="command">menuentry</span></samp> command
(see <a href="#menuentry">menuentry</a>). 
</p></blockquote></div>

<div class="node">
<a name="General-commands"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Menu_002dspecific-commands">Menu-specific commands</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Commands">Commands</a>

</div>

<h3 class="section">14.2 The list of general commands</h3>

<p>Commands usable anywhere in the menu and in the command-line.

<ul class="menu">
<li><a accesskey="1" href="#serial">serial</a>:                       Set up a serial device
<li><a accesskey="2" href="#terminal_005finput">terminal_input</a>:               Manage input terminals
<li><a accesskey="3" href="#terminal_005foutput">terminal_output</a>:              Manage output terminals
<li><a accesskey="4" href="#terminfo">terminfo</a>:                     Define terminal type
</ul>

<div class="node">
<a name="serial"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#terminal_005finput">terminal_input</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#General-commands">General commands</a>

</div>

<h4 class="subsection">14.2.1 serial</h4>

<div class="defun">
&mdash; Command: <b>serial</b> [<samp><span class="option">--unit=unit</span></samp>] [<samp><span class="option">--port=port</span></samp>] [<samp><span class="option">--speed=speed</span></samp>] [<samp><span class="option">--word=word</span></samp>] [<samp><span class="option">--parity=parity</span></samp>] [<samp><span class="option">--stop=stop</span></samp>]<var><a name="index-serial-3"></a></var><br>
<blockquote><p>Initialize a serial device. <var>unit</var> is a number in the range 0-3
specifying which serial port to use; default is 0, which corresponds to
the port often called COM1. <var>port</var> is the I/O port where the UART
is to be found; if specified it takes precedence over <var>unit</var>. 
<var>speed</var> is the transmission speed; default is 9600. <var>word</var> and
<var>stop</var> are the number of data bits and stop bits. Data bits must
be in the range 5-8 and stop bits must be 1 or 2. Default is 8 data
bits and one stop bit. <var>parity</var> is one of &lsquo;<samp><span class="samp">no</span></samp>&rsquo;, &lsquo;<samp><span class="samp">odd</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">even</span></samp>&rsquo; and defaults to &lsquo;<samp><span class="samp">no</span></samp>&rsquo;.

        <p>The serial port is not used as a communication channel unless the
<samp><span class="command">terminal_input</span></samp> or <samp><span class="command">terminal_output</span></samp> command is used
(see <a href="#terminal_005finput">terminal_input</a>, see <a href="#terminal_005foutput">terminal_output</a>).

        <p>See also <a href="#Serial-terminal">Serial terminal</a>. 
</p></blockquote></div>

<div class="node">
<a name="terminal_input"></a>
<a name="terminal_005finput"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#terminal_005foutput">terminal_output</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#serial">serial</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#General-commands">General commands</a>

</div>

<h4 class="subsection">14.2.2 terminal_input</h4>

<div class="defun">
&mdash; Command: <b>terminal_input</b> [<samp><span class="option">--append</span></samp><var>|</var><samp><span class="option">--remove</span></samp>] [<var>terminal1</var>] [<var>terminal2</var>]<var> <small class="dots">...</small><a name="index-terminal_005finput-4"></a></var><br>
<blockquote><p>List or select an input terminal.

        <p>With no arguments, list the active and available input terminals.

        <p>With <samp><span class="option">--append</span></samp>, add the named terminals to the list of active input
terminals; any of these may be used to provide input to GRUB.

        <p>With <samp><span class="option">--remove</span></samp>, remove the named terminals from the active list.

        <p>With no options but a list of terminal names, make only the listed terminal
names active. 
</p></blockquote></div>

<div class="node">
<a name="terminal_output"></a>
<a name="terminal_005foutput"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#terminfo">terminfo</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#terminal_005finput">terminal_input</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#General-commands">General commands</a>

</div>

<h4 class="subsection">14.2.3 terminal_output</h4>

<div class="defun">
&mdash; Command: <b>terminal_output</b> [<samp><span class="option">--append</span></samp><var>|</var><samp><span class="option">--remove</span></samp>] [<var>terminal1</var>] [<var>terminal2</var>]<var> <small class="dots">...</small><a name="index-terminal_005foutput-5"></a></var><br>
<blockquote><p>List or select an output terminal.

        <p>With no arguments, list the active and available output terminals.

        <p>With <samp><span class="option">--append</span></samp>, add the named terminals to the list of active output
terminals; all of these will receive output from GRUB.

        <p>With <samp><span class="option">--remove</span></samp>, remove the named terminals from the active list.

        <p>With no options but a list of terminal names, make only the listed terminal
names active. 
</p></blockquote></div>

<div class="node">
<a name="terminfo"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#terminal_005foutput">terminal_output</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#General-commands">General commands</a>

</div>

<h4 class="subsection">14.2.4 terminfo</h4>

<div class="defun">
&mdash; Command: <b>terminfo</b> [<var>-a|-u|-v</var>] [<var>term</var>]<var><a name="index-terminfo-6"></a></var><br>
<blockquote><p>Define the capabilities of your terminal by giving the name of an entry in
the terminfo database, which should correspond roughly to a &lsquo;<samp><span class="samp">TERM</span></samp>&rsquo;
environment variable in Unix.

        <p>The currently available terminal types are &lsquo;<samp><span class="samp">vt100</span></samp>&rsquo;, &lsquo;<samp><span class="samp">vt100-color</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">ieee1275</span></samp>&rsquo;, and &lsquo;<samp><span class="samp">dumb</span></samp>&rsquo;.  If you need other terminal types, please
contact us to discuss the best way to include support for these in GRUB.

        <p>The <samp><span class="option">-a</span></samp> (<samp><span class="option">--ascii</span></samp>), <samp><span class="option">-u</span></samp> (<samp><span class="option">--utf8</span></samp>), and
<samp><span class="option">-v</span></samp> (<samp><span class="option">--visual-utf8</span></samp>) options control how non-ASCII text is
displayed.  <samp><span class="option">-a</span></samp> specifies an ASCII-only terminal; <samp><span class="option">-u</span></samp>
specifies logically-ordered UTF-8; and <samp><span class="option">-v</span></samp> specifies
"visually-ordered UTF-8" (in other words, arranged such that a terminal
emulator without bidirectional text support will display right-to-left text
in the proper order; this is not really proper UTF-8, but a workaround).

        <p>If no option or terminal type is specified, the current terminal type is
printed. 
</p></blockquote></div>

<div class="node">
<a name="Command-line-and-menu-entry-commands"></a>
<a name="Command_002dline-and-menu-entry-commands"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#General-commands">General commands</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Commands">Commands</a>

</div>

<h3 class="section">14.3 The list of command-line and menu entry commands</h3>

<p>These commands are usable in the command-line and in menu entries.  If
you forget a command, you can run the command <samp><span class="command">help</span></samp>
(see <a href="#help">help</a>).

<ul class="menu">
<li><a accesskey="1" href="#acpi">acpi</a>:                         Load ACPI tables
<li><a accesskey="2" href="#badram">badram</a>:                       Filter out bad regions of RAM
<li><a accesskey="3" href="#blocklist">blocklist</a>:                    Print a block list
<li><a accesskey="4" href="#boot">boot</a>:                         Start up your operating system
<li><a accesskey="5" href="#cat">cat</a>:                          Show the contents of a file
<li><a accesskey="6" href="#chainloader">chainloader</a>:                  Chain-load another boot loader
<li><a accesskey="7" href="#cmp">cmp</a>:                          Compare two files
<li><a accesskey="8" href="#configfile">configfile</a>:                   Load a configuration file
<li><a accesskey="9" href="#cpuid">cpuid</a>:                        Check for CPU features
<li><a href="#crc">crc</a>:                          Calculate CRC32 checksums
<li><a href="#date">date</a>:                         Display or set current date and time
<li><a href="#drivemap">drivemap</a>:                     Map a drive to another
<li><a href="#echo">echo</a>:                         Display a line of text
<li><a href="#export">export</a>:                       Export an environment variable
<li><a href="#false">false</a>:                        Do nothing, unsuccessfully
<li><a href="#gettext">gettext</a>:                      Translate a string
<li><a href="#gptsync">gptsync</a>:                      Fill an MBR based on GPT entries
<li><a href="#halt">halt</a>:                         Shut down your computer
<li><a href="#help">help</a>:                         Show help messages
<li><a href="#initrd">initrd</a>:                       Load a Linux initrd
<li><a href="#initrd16">initrd16</a>:                     Load a Linux initrd (16-bit mode)
<li><a href="#insmod">insmod</a>:                       Insert a module
<li><a href="#keystatus">keystatus</a>:                    Check key modifier status
<li><a href="#linux">linux</a>:                        Load a Linux kernel
<li><a href="#linux16">linux16</a>:                      Load a Linux kernel (16-bit mode)
<li><a href="#list_005fenv">list_env</a>:                     List variables in environment block
<li><a href="#load_005fenv">load_env</a>:                     Load variables from environment block
<li><a href="#loopback">loopback</a>:                     Make a device from a filesystem image
<li><a href="#ls">ls</a>:                           List devices or files
<li><a href="#normal">normal</a>:                       Enter normal mode
<li><a href="#normal_005fexit">normal_exit</a>:                  Exit from normal mode
<li><a href="#parttool">parttool</a>:                     Modify partition table entries
<li><a href="#password">password</a>:                     Set a clear-text password
<li><a href="#password_005fpbkdf2">password_pbkdf2</a>:              Set a hashed password
<li><a href="#play">play</a>:                         Play a tune
<li><a href="#pxe_005funload">pxe_unload</a>:                   Unload the PXE environment
<li><a href="#read">read</a>:                         Read user input
<li><a href="#reboot">reboot</a>:                       Reboot your computer
<li><a href="#save_005fenv">save_env</a>:                     Save variables to environment block
<li><a href="#search">search</a>:                       Search devices by file, label, or UUID
<li><a href="#sendkey">sendkey</a>:                      Emulate keystrokes
<li><a href="#set">set</a>:                          Set an environment variable
<li><a href="#true">true</a>:                         Do nothing, successfully
<li><a href="#unset">unset</a>:                        Unset an environment variable
<li><a href="#uppermem">uppermem</a>:                     Set the upper memory size
</ul>

<div class="node">
<a name="acpi"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#badram">badram</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.1 acpi</h4>

<div class="defun">
&mdash; Command: <b>acpi</b> [<samp><span class="option">-1</span></samp><var>|</var><samp><span class="option">-2</span></samp>] [<samp><span class="option">--exclude=table1,...</span></samp><var>|</var><samp><span class="option">--load-only=table1,...</span></samp>] [<samp><span class="option">--oemid=id</span></samp>] [<samp><span class="option">--oemtable=table</span></samp>] [<samp><span class="option">--oemtablerev=rev</span></samp>] [<samp><span class="option">--oemtablecreator=creator</span></samp>] [<samp><span class="option">--oemtablecreatorrev=rev</span></samp>] [<samp><span class="option">--no-ebda</span></samp>]<var> filename <small class="dots">...</small><a name="index-acpi-7"></a></var><br>
<blockquote><p>Modern BIOS systems normally implement the Advanced Configuration and Power
Interface (ACPI), and define various tables that describe the interface
between an ACPI-compliant operating system and the firmware. In some cases,
the tables provided by default only work well with certain operating
systems, and it may be necessary to replace some of them.

        <p>Normally, this command will replace the Root System Description Pointer
(RSDP) in the Extended BIOS Data Area to point to the new tables. If the
<samp><span class="option">--no-ebda</span></samp> option is used, the new tables will be known only to
GRUB, but may be used by GRUB's EFI emulation. 
</p></blockquote></div>

<div class="node">
<a name="badram"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#blocklist">blocklist</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#acpi">acpi</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.2 badram</h4>

<div class="defun">
&mdash; Command: <b>badram</b><var> addr,mask</var>[<var>,addr,mask...</var>]<var><a name="index-badram-8"></a></var><br>
<blockquote><p>Filter out bad RAM. 
</p></blockquote></div>

   <p>This command notifies the memory manager that specified regions of
RAM ought to be filtered out (usually, because they're damaged).  This
remains in effect after a payload kernel has been loaded by GRUB, as
long as the loaded kernel obtains its memory map from GRUB.  Kernels that
support this include Linux, GNU Mach, the kernel of FreeBSD and Multiboot
kernels in general.

   <p>Syntax is the same as provided by the <a href="http://www.memtest.org/">Memtest86+ utility</a>: a list of address/mask pairs.  Given a page-aligned
address and a base address / mask pair, if all the bits of the page-aligned
address that are enabled by the mask match with the base address, it means
this page is to be filtered.  This syntax makes it easy to represent patterns
that are often result of memory damage, due to physical distribution of memory
cells.

<div class="node">
<a name="blocklist"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#boot">boot</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#badram">badram</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.3 blocklist</h4>

<div class="defun">
&mdash; Command: <b>blocklist</b><var> file<a name="index-blocklist-9"></a></var><br>
<blockquote><p>Print a block list (see <a href="#Block-list-syntax">Block list syntax</a>) for <var>file</var>. 
</p></blockquote></div>

<div class="node">
<a name="boot"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#cat">cat</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#blocklist">blocklist</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.4 boot</h4>

<div class="defun">
&mdash; Command: <b>boot</b><var><a name="index-boot-10"></a></var><br>
<blockquote><p>Boot the OS or chain-loader which has been loaded. Only necessary if
running the fully interactive command-line (it is implicit at the end of
a menu entry). 
</p></blockquote></div>

<div class="node">
<a name="cat"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#chainloader">chainloader</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#boot">boot</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.5 cat</h4>

<div class="defun">
&mdash; Command: <b>cat</b> [<samp><span class="option">--dos</span></samp>]<var> file<a name="index-cat-11"></a></var><br>
<blockquote><p>Display the contents of the file <var>file</var>. This command may be useful
to remind you of your OS's root partition:

     <pre class="example">          grub&gt; <kbd>cat /etc/fstab</kbd>
</pre>
        <p>If the <samp><span class="option">--dos</span></samp> option is used, then carriage return / new line pairs
will be displayed as a simple new line.  Otherwise, the carriage return will
be displayed as a control character (&lsquo;<samp><span class="samp">&lt;d&gt;</span></samp>&rsquo;) to make it easier to see
when boot problems are caused by a file formatted using DOS-style line
endings. 
</p></blockquote></div>

<div class="node">
<a name="chainloader"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#cmp">cmp</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cat">cat</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.6 chainloader</h4>

<div class="defun">
&mdash; Command: <b>chainloader</b> [<samp><span class="option">--force</span></samp>]<var> file<a name="index-chainloader-12"></a></var><br>
<blockquote><p>Load <var>file</var> as a chain-loader. Like any other file loaded by the
filesystem code, it can use the blocklist notation (see <a href="#Block-list-syntax">Block list syntax</a>) to grab the first sector of the current partition with &lsquo;<samp><span class="samp">+1</span></samp>&rsquo;. 
If you specify the option <samp><span class="option">--force</span></samp>, then load <var>file</var> forcibly,
whether it has a correct signature or not. This is required when you want to
load a defective boot loader, such as SCO UnixWare 7.1. 
</p></blockquote></div>

<div class="node">
<a name="cmp"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#configfile">configfile</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#chainloader">chainloader</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.7 cmp</h4>

<div class="defun">
&mdash; Command: <b>cmp</b><var> file1 file2<a name="index-cmp-13"></a></var><br>
<blockquote><p>Compare the file <var>file1</var> with the file <var>file2</var>. If they differ
in size, print the sizes like this:

     <pre class="example">          Differ in size: 0x1234 [foo], 0x4321 [bar]
</pre>
        <p>If the sizes are equal but the bytes at an offset differ, then print the
bytes like this:

     <pre class="example">          Differ at the offset 777: 0xbe [foo], 0xef [bar]
</pre>
        <p>If they are completely identical, nothing will be printed. 
</p></blockquote></div>

<div class="node">
<a name="configfile"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#cpuid">cpuid</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cmp">cmp</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.8 configfile</h4>

<div class="defun">
&mdash; Command: <b>configfile</b><var> file<a name="index-configfile-14"></a></var><br>
<blockquote><p>Load <var>file</var> as a configuration file.  If <var>file</var> defines any menu
entries, then show a menu containing them immediately. 
</p></blockquote></div>

<div class="node">
<a name="cpuid"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#crc">crc</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#configfile">configfile</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.9 cpuid</h4>

<div class="defun">
&mdash; Command: <b>cpuid</b> [<var>-l</var>]<var><a name="index-cpuid-15"></a></var><br>
<blockquote><p>Check for CPU features.  This command is only available on x86 systems.

        <p>With the <samp><span class="option">-l</span></samp> option, return true if the CPU supports long mode
(64-bit).

        <p>If invoked without options, this command currently behaves as if it had been
invoked with <samp><span class="option">-l</span></samp>.  This may change in the future. 
</p></blockquote></div>

<div class="node">
<a name="crc"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#date">date</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#cpuid">cpuid</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.10 crc</h4>

<div class="defun">
&mdash; Command: <b>crc</b><var> file<a name="index-crc-16"></a></var><br>
<blockquote><p>Display the CRC32 checksum of <var>file</var>. 
</p></blockquote></div>

<div class="node">
<a name="date"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#drivemap">drivemap</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#crc">crc</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.11 date</h4>

<div class="defun">
&mdash; Command: <b>date</b> [[<var>year-</var>]<var>month-day</var>] [<var>hour:minute</var>[<var>:second</var>]]<var><a name="index-date-17"></a></var><br>
<blockquote><p>With no arguments, print the current date and time.

        <p>Otherwise, take the current date and time, change any elements specified as
arguments, and set the result as the new date and time.  For example, `date
01-01' will set the current month and day to January 1, but leave the year,
hour, minute, and second unchanged. 
</p></blockquote></div>

<div class="node">
<a name="drivemap"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#echo">echo</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#date">date</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.12 drivemap</h4>

<div class="defun">
&mdash; Command: <b>drivemap</b> <samp><span class="option">-l</span></samp><var>|</var><samp><span class="option">-r</span></samp><var>|</var>[<samp><span class="option">-s</span></samp>]<var> from_drive to_drive<a name="index-drivemap-18"></a></var><br>
<blockquote><p>Without options, map the drive <var>from_drive</var> to the drive <var>to_drive</var>. 
This is necessary when you chain-load some operating systems, such as DOS,
if such an OS resides at a non-first drive.  For convenience, any partition
suffix on the drive is ignored, so you can safely use <tt>${root}</tt> as a
drive specification.

        <p>With the <samp><span class="option">-s</span></samp> option, perform the reverse mapping as well, swapping
the two drives.

        <p>With the <samp><span class="option">-l</span></samp> option, list the current mappings.

        <p>With the <samp><span class="option">-r</span></samp> option, reset all mappings to the default values.

        <p>For example:

     <pre class="example">          drivemap -s (hd0) (hd1)
</pre>
        </blockquote></div>

<div class="node">
<a name="echo"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#export">export</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#drivemap">drivemap</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.13 echo</h4>

<div class="defun">
&mdash; Command: <b>echo</b> [<samp><span class="option">-n</span></samp>] [<samp><span class="option">-e</span></samp>]<var> string <small class="dots">...</small><a name="index-echo-19"></a></var><br>
<blockquote><p>Display the requested text and, unless the <samp><span class="option">-n</span></samp> option is used, a
trailing new line.  If there is more than one string, they are separated by
spaces in the output.  As usual in GRUB commands, variables may be
substituted using &lsquo;<samp><span class="samp">${var}</span></samp>&rsquo;.

        <p>The <samp><span class="option">-e</span></samp> option enables interpretation of backslash escapes.  The
following sequences are recognised:

          <dl>
<dt><code>\\</code><dd>backslash

          <br><dt><code>\a</code><dd>alert (BEL)

          <br><dt><code>\c</code><dd>suppress trailing new line

          <br><dt><code>\f</code><dd>form feed

          <br><dt><code>\n</code><dd>new line

          <br><dt><code>\r</code><dd>carriage return

          <br><dt><code>\t</code><dd>horizontal tab

          <br><dt><code>\v</code><dd>vertical tab
</dl>

        <p>When interpreting backslash escapes, backslash followed by any other
character will print that character. 
</p></blockquote></div>

<div class="node">
<a name="export"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#false">false</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#echo">echo</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.14 export</h4>

<div class="defun">
&mdash; Command: <b>export</b><var> envvar<a name="index-export-20"></a></var><br>
<blockquote><p>Export the environment variable <var>envvar</var>. Exported variables are visible
to subsidiary configuration files loaded using <samp><span class="command">configfile</span></samp>. 
</p></blockquote></div>

<div class="node">
<a name="false"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#gettext">gettext</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#export">export</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.15 false</h4>

<div class="defun">
&mdash; Command: <b>false</b><var><a name="index-false-21"></a></var><br>
<blockquote><p>Do nothing, unsuccessfully.  This is mainly useful in control constructs
such as <code>if</code> and <code>while</code> (see <a href="#Shell_002dlike-scripting">Shell-like scripting</a>). 
</p></blockquote></div>

<div class="node">
<a name="gettext"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#gptsync">gptsync</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#false">false</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.16 gettext</h4>

<div class="defun">
&mdash; Command: <b>gettext</b><var> string<a name="index-gettext-22"></a></var><br>
<blockquote><p>Translate <var>string</var> into the current language.

        <p>The current language code is stored in the &lsquo;<samp><span class="samp">lang</span></samp>&rsquo; variable in GRUB's
environment (see <a href="#lang">lang</a>).  Translation files in MO format are read from
&lsquo;<samp><span class="samp">locale_dir</span></samp>&rsquo; (see <a href="#locale_005fdir">locale_dir</a>), usually <samp><span class="file">/boot/grub2/locale</span></samp>. 
</p></blockquote></div>

<div class="node">
<a name="gptsync"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#halt">halt</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#gettext">gettext</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.17 gptsync</h4>

<div class="defun">
&mdash; Command: <b>gptsync</b><var> device </var>[<var>partition</var>[<var>+/-</var>[<var>type</var>]]]<var> <small class="dots">...</small><a name="index-gptsync-23"></a></var><br>
<blockquote><p>Disks using the GUID Partition Table (GPT) also have a legacy Master Boot
Record (MBR) partition table for compatibility with the BIOS and with older
operating systems.  The legacy MBR can only represent a limited subset of
GPT partition entries.

        <p>This command populates the legacy MBR with the specified <var>partition</var>
entries on <var>device</var>.  Up to three partitions may be used.

        <p><var>type</var> is an MBR partition type code; prefix with &lsquo;<samp><span class="samp">0x</span></samp>&rsquo; if you want
to enter this in hexadecimal.  The separator between <var>partition</var> and
<var>type</var> may be &lsquo;<samp><span class="samp">+</span></samp>&rsquo; to make the partition active, or &lsquo;<samp><span class="samp">-</span></samp>&rsquo; to make
it inactive; only one partition may be active.  If both the separator and
type are omitted, then the partition will be inactive. 
</p></blockquote></div>

<div class="node">
<a name="halt"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#help">help</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#gptsync">gptsync</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.18 halt</h4>

<div class="defun">
&mdash; Command: <b>halt</b> <samp><span class="option">--no-apm</span></samp><var><a name="index-halt-24"></a></var><br>
<blockquote><p>The command halts the computer. If the <samp><span class="option">--no-apm</span></samp> option
is specified, no APM BIOS call is performed. Otherwise, the computer
is shut down using APM. 
</p></blockquote></div>

<div class="node">
<a name="help"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#initrd">initrd</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#halt">halt</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.19 help</h4>

<div class="defun">
&mdash; Command: <b>help</b> [<var>pattern <small class="dots">...</small></var>]<var><a name="index-help-25"></a></var><br>
<blockquote><p>Display helpful information about builtin commands. If you do not
specify <var>pattern</var>, this command shows short descriptions of all
available commands.

        <p>If you specify any <var>patterns</var>, it displays longer information
about each of the commands whose names begin with those <var>patterns</var>. 
</p></blockquote></div>

<div class="node">
<a name="initrd"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#initrd16">initrd16</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#help">help</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.20 initrd</h4>

<div class="defun">
&mdash; Command: <b>initrd</b><var> file<a name="index-initrd-26"></a></var><br>
<blockquote><p>Load an initial ramdisk for a Linux kernel image, and set the appropriate
parameters in the Linux setup area in memory.  This may only be used after
the <samp><span class="command">linux</span></samp> command (see <a href="#linux">linux</a>) has been run.  See also
<a href="#GNU_002fLinux">GNU/Linux</a>. 
</p></blockquote></div>

<div class="node">
<a name="initrd16"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#insmod">insmod</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#initrd">initrd</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.21 initrd16</h4>

<div class="defun">
&mdash; Command: <b>initrd16</b><var> file<a name="index-initrd16-27"></a></var><br>
<blockquote><p>Load an initial ramdisk for a Linux kernel image to be booted in 16-bit
mode, and set the appropriate parameters in the Linux setup area in memory. 
This may only be used after the <samp><span class="command">linux16</span></samp> command (see <a href="#linux16">linux16</a>)
has been run.  See also <a href="#GNU_002fLinux">GNU/Linux</a>.

        <p>This command is only available on x86 systems. 
</p></blockquote></div>

<div class="node">
<a name="insmod"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#keystatus">keystatus</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#initrd16">initrd16</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.22 insmod</h4>

<div class="defun">
&mdash; Command: <b>insmod</b><var> module<a name="index-insmod-28"></a></var><br>
<blockquote><p>Insert the dynamic GRUB module called <var>module</var>. 
</p></blockquote></div>

<div class="node">
<a name="keystatus"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#linux">linux</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#insmod">insmod</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.23 keystatus</h4>

<div class="defun">
&mdash; Command: <b>keystatus</b> [<samp><span class="option">--shift</span></samp>] [<samp><span class="option">--ctrl</span></samp>] [<samp><span class="option">--alt</span></samp>]<var><a name="index-keystatus-29"></a></var><br>
<blockquote><p>Return true if the Shift, Control, or Alt modifier keys are held down, as
requested by options. This is useful in scripting, to allow some user
control over behaviour without having to wait for a keypress.

        <p>Checking key modifier status is only supported on some platforms. If invoked
without any options, the <samp><span class="command">keystatus</span></samp> command returns true if and
only if checking key modifier status is supported. 
</p></blockquote></div>

<div class="node">
<a name="linux"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#linux16">linux16</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#keystatus">keystatus</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.24 linux</h4>

<div class="defun">
&mdash; Command: <b>linux</b><var> file <small class="dots">...</small><a name="index-linux-30"></a></var><br>
<blockquote><p>Load a Linux kernel image from <var>file</var>.  The rest of the line is passed
verbatim as the <dfn>kernel command-line</dfn>.  Any initrd must be reloaded
after using this command (see <a href="#initrd">initrd</a>).

        <p>On x86 systems, the kernel will be booted using the 32-bit boot protocol. 
Note that this means that the &lsquo;<samp><span class="samp">vga=</span></samp>&rsquo; boot option will not work; if you
want to set a special video mode, you will need to use GRUB commands such as
&lsquo;<samp><span class="samp">set gfxpayload=1024x768</span></samp>&rsquo; or &lsquo;<samp><span class="samp">set gfxpayload=keep</span></samp>&rsquo; (to keep the
same mode as used in GRUB) instead.  GRUB can automatically detect some uses
of &lsquo;<samp><span class="samp">vga=</span></samp>&rsquo; and translate them to appropriate settings of
&lsquo;<samp><span class="samp">gfxpayload</span></samp>&rsquo;.  The <samp><span class="command">linux16</span></samp> command (see <a href="#linux16">linux16</a>) avoids
this restriction. 
</p></blockquote></div>

<div class="node">
<a name="linux16"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#list_005fenv">list_env</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#linux">linux</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.25 linux16</h4>

<div class="defun">
&mdash; Command: <b>linux16</b><var> file <small class="dots">...</small><a name="index-linux16-31"></a></var><br>
<blockquote><p>Load a Linux kernel image from <var>file</var> in 16-bit mode.  The rest of the
line is passed verbatim as the <dfn>kernel command-line</dfn>.  Any initrd must
be reloaded after using this command (see <a href="#initrd16">initrd16</a>).

        <p>The kernel will be booted using the traditional 16-bit boot protocol.  As
well as bypassing problems with &lsquo;<samp><span class="samp">vga=</span></samp>&rsquo; described in <a href="#linux">linux</a>, this
permits booting some other programs that implement the Linux boot protocol
for the sake of convenience.

        <p>This command is only available on x86 systems. 
</p></blockquote></div>

<div class="node">
<a name="list_env"></a>
<a name="list_005fenv"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#load_005fenv">load_env</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#linux16">linux16</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.26 list_env</h4>

<div class="defun">
&mdash; Command: <b>list_env</b> [<samp><span class="option">-f</span></samp><var> file</var>]<var><a name="index-list_005fenv-32"></a></var><br>
<blockquote><p>List all variables in the environment block file.  See <a href="#Environment-block">Environment block</a>.

        <p>The <samp><span class="option">-f</span></samp> option overrides the default location of the environment
block. 
</p></blockquote></div>

<div class="node">
<a name="load_env"></a>
<a name="load_005fenv"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#loopback">loopback</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#list_005fenv">list_env</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.27 load_env</h4>

<div class="defun">
&mdash; Command: <b>load_env</b> [<samp><span class="option">-f</span></samp><var> file</var>]<var><a name="index-load_005fenv-33"></a></var><br>
<blockquote><p>Load all variables from the environment block file into the environment. 
See <a href="#Environment-block">Environment block</a>.

        <p>The <samp><span class="option">-f</span></samp> option overrides the default location of the environment
block. 
</p></blockquote></div>

<div class="node">
<a name="loopback"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#ls">ls</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#load_005fenv">load_env</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.28 loopback</h4>

<div class="defun">
&mdash; Command: <b>loopback</b> [<samp><span class="option">-d</span></samp>]<var> device file<a name="index-loopback-34"></a></var><br>
<blockquote><p>Make the device named <var>device</var> correspond to the contents of the
filesystem image in <var>file</var>.  For example:

     <pre class="example">          loopback loop0 /path/to/image
          ls (loop0)/
</pre>
        <p>With the <samp><span class="option">-d</span></samp> option, delete a device previously created using this
command. 
</p></blockquote></div>

<div class="node">
<a name="ls"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#normal">normal</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#loopback">loopback</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.29 ls</h4>

<div class="defun">
&mdash; Command: <b>ls</b> [<var>arg <small class="dots">...</small></var>]<var><a name="index-ls-35"></a></var><br>
<blockquote><p>List devices or files.

        <p>With no arguments, print all devices known to GRUB.

        <p>If the argument is a device name enclosed in parentheses (see <a href="#Device-syntax">Device syntax</a>), then list all files at the root directory of that device.

        <p>If the argument is a directory given as an absolute file name (see <a href="#File-name-syntax">File name syntax</a>), then list the contents of that directory. 
</p></blockquote></div>

<div class="node">
<a name="normal"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#normal_005fexit">normal_exit</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ls">ls</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.30 normal</h4>

<div class="defun">
&mdash; Command: <b>normal</b> [<var>file</var>]<var><a name="index-normal-36"></a></var><br>
<blockquote><p>Enter normal mode and display the GRUB menu.

        <p>In normal mode, commands, filesystem modules, and cryptography modules are
automatically loaded, and the full GRUB script parser is available.  Other
modules may be explicitly loaded using <samp><span class="command">insmod</span></samp> (see <a href="#insmod">insmod</a>).

        <p>If a <var>file</var> is given, then commands will be read from that file. 
Otherwise, they will be read from <samp><span class="file">$prefix/grub.cfg</span></samp> if it exists.

        <p><samp><span class="command">normal</span></samp> may be called from within normal mode, creating a nested
environment.  It is more usual to use <samp><span class="command">configfile</span></samp>
(see <a href="#configfile">configfile</a>) for this. 
</p></blockquote></div>

<div class="node">
<a name="normal_exit"></a>
<a name="normal_005fexit"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#parttool">parttool</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#normal">normal</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.31 normal_exit</h4>

<div class="defun">
&mdash; Command: <b>normal_exit</b><var><a name="index-normal_005fexit-37"></a></var><br>
<blockquote><p>Exit normal mode (see <a href="#normal">normal</a>).  If this instance of normal mode was not
nested within another one, then return to rescue mode. 
</p></blockquote></div>

<div class="node">
<a name="parttool"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#password">password</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#normal_005fexit">normal_exit</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.32 parttool</h4>

<div class="defun">
&mdash; Command: <b>parttool</b><var> partition commands<a name="index-parttool-38"></a></var><br>
<blockquote><p>Make various modifications to partition table entries.

        <p>Each <var>command</var> is either a boolean option, in which case it must be
followed with &lsquo;<samp><span class="samp">+</span></samp>&rsquo; or &lsquo;<samp><span class="samp">-</span></samp>&rsquo; (with no intervening space) to enable or
disable that option, or else it takes a value in the form
&lsquo;<samp><var>command</var><span class="samp">=</span><var>value</var></samp>&rsquo;.

        <p>Currently, <samp><span class="command">parttool</span></samp> is only useful on DOS partition tables (also
known as Master Boot Record, or MBR).  On these partition tables, the
following commands are available:

          <dl>
<dt>&lsquo;<samp><span class="samp">boot</span></samp>&rsquo; (boolean)<dd>When enabled, this makes the selected partition be the active (bootable)
partition on its disk, clearing the active flag on all other partitions. 
This command is limited to <em>primary</em> partitions.

          <br><dt>&lsquo;<samp><span class="samp">type</span></samp>&rsquo; (value)<dd>Change the type of an existing partition.  The value must be a number in the
range 0-0xFF (prefix with &lsquo;<samp><span class="samp">0x</span></samp>&rsquo; to enter it in hexadecimal).

          <br><dt>&lsquo;<samp><span class="samp">hidden</span></samp>&rsquo; (boolean)<dd>When enabled, this hides the selected partition by setting the <dfn>hidden</dfn>
bit in its partition type code; when disabled, unhides the selected
partition by clearing this bit.  This is useful only when booting DOS or
Wwindows and multiple primary FAT partitions exist in one disk.  See also
<a href="#DOS_002fWindows">DOS/Windows</a>. 
</dl>
        </p></blockquote></div>

<div class="node">
<a name="password"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#password_005fpbkdf2">password_pbkdf2</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#parttool">parttool</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.33 password</h4>

<div class="defun">
&mdash; Command: <b>password</b><var> user clear-password<a name="index-password-39"></a></var><br>
<blockquote><p>Define a user named <var>user</var> with password <var>clear-password</var>. 
See <a href="#Security">Security</a>. 
</p></blockquote></div>

<div class="node">
<a name="password_pbkdf2"></a>
<a name="password_005fpbkdf2"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#play">play</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#password">password</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.34 password_pbkdf2</h4>

<div class="defun">
&mdash; Command: <b>password_pbkdf2</b><var> user hashed-password<a name="index-password_005fpbkdf2-40"></a></var><br>
<blockquote><p>Define a user named <var>user</var> with password hash <var>hashed-password</var>. 
Use <samp><span class="command">grub2-mkpasswd-pbkdf2</span></samp> (see <a href="#Invoking-grub_002dmkpasswd_002dpbkdf2">Invoking grub2-mkpasswd-pbkdf2</a>)
to generate password hashes.  See <a href="#Security">Security</a>. 
</p></blockquote></div>

<div class="node">
<a name="play"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#pxe_005funload">pxe_unload</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#password_005fpbkdf2">password_pbkdf2</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.35 play</h4>

<div class="defun">
&mdash; Command: <b>play</b><var> file | tempo </var>[<var>pitch1 duration1</var>] [<var>pitch2 duration2</var>]<var> ...<a name="index-play-41"></a></var><br>
<blockquote><p>Plays a tune

        <p>If the argument is a file name (see <a href="#File-name-syntax">File name syntax</a>), play the tune
recorded in it.  The file format is first the tempo as an unsigned 32bit
little-endian number, then pairs of unsigned 16bit little-endian numbers for
pitch and duration pairs.

        <p>If the arguments are a series of numbers, play the inline tune.

        <p>The tempo is the base for all note durations. 60 gives a 1-second base, 120
gives a half-second base, etc.  Pitches are Hz.  Set pitch to 0 to produce
a rest. 
</p></blockquote></div>

<div class="node">
<a name="pxe_unload"></a>
<a name="pxe_005funload"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#read">read</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#play">play</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.36 pxe_unload</h4>

<div class="defun">
&mdash; Command: <b>pxe_unload</b><var><a name="index-pxe_005funload-42"></a></var><br>
<blockquote><p>Unload the PXE environment (see <a href="#Network">Network</a>).

        <p>This command is only available on PC BIOS systems. 
</p></blockquote></div>

<div class="node">
<a name="read"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#reboot">reboot</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#pxe_005funload">pxe_unload</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.37 read</h4>

<div class="defun">
&mdash; Command: <b>read</b> [<var>var</var>]<var><a name="index-read-43"></a></var><br>
<blockquote><p>Read a line of input from the user.  If an environment variable <var>var</var> is
given, set that environment variable to the line of input that was read,
with no terminating newline. 
</p></blockquote></div>

<div class="node">
<a name="reboot"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#save_005fenv">save_env</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#read">read</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.38 reboot</h4>

<div class="defun">
&mdash; Command: <b>reboot</b><var><a name="index-reboot-44"></a></var><br>
<blockquote><p>Reboot the computer. 
</p></blockquote></div>

<div class="node">
<a name="save_env"></a>
<a name="save_005fenv"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#search">search</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#reboot">reboot</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.39 save_env</h4>

<div class="defun">
&mdash; Command: <b>save_env</b> [<samp><span class="option">-f</span></samp><var> file</var>]<var> var <small class="dots">...</small><a name="index-save_005fenv-45"></a></var><br>
<blockquote><p>Save the named variables from the environment to the environment block file. 
See <a href="#Environment-block">Environment block</a>.

        <p>The <samp><span class="option">-f</span></samp> option overrides the default location of the environment
block. 
</p></blockquote></div>

<div class="node">
<a name="search"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#sendkey">sendkey</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#save_005fenv">save_env</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.40 search</h4>

<div class="defun">
&mdash; Command: <b>search</b> [<samp><span class="option">--file</span></samp><var>|</var><samp><span class="option">--label</span></samp><var>|</var><samp><span class="option">--fs-uuid</span></samp>] [<samp><span class="option">--set</span></samp> [<var>var</var>]] [<samp><span class="option">--no-floppy</span></samp>]<var> name<a name="index-search-46"></a></var><br>
<blockquote><p>Search devices by file (<samp><span class="option">-f</span></samp>, <samp><span class="option">--file</span></samp>), filesystem label
(<samp><span class="option">-l</span></samp>, <samp><span class="option">--label</span></samp>), or filesystem UUID (<samp><span class="option">-u</span></samp>,
<samp><span class="option">--fs-uuid</span></samp>).

        <p>If the <samp><span class="option">--set</span></samp> option is used, the first device found is set as the
value of environment variable <var>var</var>.  The default variable is
&lsquo;<samp><span class="samp">root</span></samp>&rsquo;.

        <p>The <samp><span class="option">--no-floppy</span></samp> option prevents searching floppy devices, which can
be slow.

        <p>The &lsquo;<samp><span class="samp">search.file</span></samp>&rsquo;, &lsquo;<samp><span class="samp">search.fs_label</span></samp>&rsquo;, and &lsquo;<samp><span class="samp">search.fs_uuid</span></samp>&rsquo;
commands are aliases for &lsquo;<samp><span class="samp">search --file</span></samp>&rsquo;, &lsquo;<samp><span class="samp">search --label</span></samp>&rsquo;, and
&lsquo;<samp><span class="samp">search --fs-uuid</span></samp>&rsquo; respectively. 
</p></blockquote></div>

<div class="node">
<a name="sendkey"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#set">set</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#search">search</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.41 sendkey</h4>

<div class="defun">
&mdash; Command: <b>sendkey</b> [<samp><span class="option">--num</span></samp><var>|</var><samp><span class="option">--caps</span></samp><var>|</var><samp><span class="option">--scroll</span></samp><var>|</var><samp><span class="option">--insert</span></samp><var>| </var><samp><span class="option">--pause</span></samp><var>|</var><samp><span class="option">--left-shift</span></samp><var>|</var><samp><span class="option">--right-shift</span></samp><var>| </var><samp><span class="option">--sysrq</span></samp><var>|</var><samp><span class="option">--numkey</span></samp><var>|</var><samp><span class="option">--capskey</span></samp><var>|</var><samp><span class="option">--scrollkey</span></samp><var>| </var><samp><span class="option">--insertkey</span></samp><var>|</var><samp><span class="option">--left-alt</span></samp><var>|</var><samp><span class="option">--right-alt</span></samp><var>| </var><samp><span class="option">--left-ctrl</span></samp><var>|</var><samp><span class="option">--right-ctrl</span></samp><var> &lsquo;</var><samp><span class="samp">on</span></samp><var>&rsquo;|&lsquo;</var><samp><span class="samp">off</span></samp><var>&rsquo;</var>]<var><small class="dots">...</small> </var>[<samp><span class="option">no-led</span></samp>]<var> keystroke<a name="index-sendkey-47"></a></var><br>
<blockquote><p>Insert keystrokes into the keyboard buffer when booting.  Sometimes an
operating system or chainloaded boot loader requires particular keys to be
pressed: for example, one might need to press a particular key to enter
"safe mode", or when chainloading another boot loader one might send
keystrokes to it to navigate its menu.

        <p>You may provide up to 16 keystrokes (the length of the BIOS keyboard
buffer).  Keystroke names may be upper-case or lower-case letters, digits,
or taken from the following table:

     <!-- Please keep this table in the same order as in -->
     <!-- commands/i386/pc/sendkey.c, for ease of maintenance. -->
     <!-- Exception: The function and numeric keys are sorted, for aesthetics. -->
        <p><table summary=""><tr align="left"><th valign="top" width="40%">Name </th><th valign="top" width="50%">Key
<br></th></tr><tr align="left"><td valign="top" width="40%">escape </td><td valign="top" width="50%">Escape
<br></td></tr><tr align="left"><td valign="top" width="40%">exclam </td><td valign="top" width="50%">! 
<br></td></tr><tr align="left"><td valign="top" width="40%">at </td><td valign="top" width="50%">@
<br></td></tr><tr align="left"><td valign="top" width="40%">numbersign </td><td valign="top" width="50%">#
<br></td></tr><tr align="left"><td valign="top" width="40%">dollar </td><td valign="top" width="50%">$
<br></td></tr><tr align="left"><td valign="top" width="40%">percent </td><td valign="top" width="50%">%
<br></td></tr><tr align="left"><td valign="top" width="40%">caret </td><td valign="top" width="50%">^
<br></td></tr><tr align="left"><td valign="top" width="40%">ampersand </td><td valign="top" width="50%">&amp;
<br></td></tr><tr align="left"><td valign="top" width="40%">asterisk </td><td valign="top" width="50%">*
<br></td></tr><tr align="left"><td valign="top" width="40%">parenleft </td><td valign="top" width="50%">(
<br></td></tr><tr align="left"><td valign="top" width="40%">parenright </td><td valign="top" width="50%">)
<br></td></tr><tr align="left"><td valign="top" width="40%">minus </td><td valign="top" width="50%">-
<br></td></tr><tr align="left"><td valign="top" width="40%">underscore </td><td valign="top" width="50%">_
<br></td></tr><tr align="left"><td valign="top" width="40%">equal </td><td valign="top" width="50%">=
<br></td></tr><tr align="left"><td valign="top" width="40%">plus </td><td valign="top" width="50%">+
<br></td></tr><tr align="left"><td valign="top" width="40%">backspace </td><td valign="top" width="50%">Backspace
<br></td></tr><tr align="left"><td valign="top" width="40%">tab </td><td valign="top" width="50%">Tab
<br></td></tr><tr align="left"><td valign="top" width="40%">bracketleft </td><td valign="top" width="50%">[
<br></td></tr><tr align="left"><td valign="top" width="40%">braceleft </td><td valign="top" width="50%">{
<br></td></tr><tr align="left"><td valign="top" width="40%">bracketright </td><td valign="top" width="50%">]
<br></td></tr><tr align="left"><td valign="top" width="40%">braceright </td><td valign="top" width="50%">}
<br></td></tr><tr align="left"><td valign="top" width="40%">enter </td><td valign="top" width="50%">Enter
<br></td></tr><tr align="left"><td valign="top" width="40%">control </td><td valign="top" width="50%">press and release Control
<br></td></tr><tr align="left"><td valign="top" width="40%">semicolon </td><td valign="top" width="50%">;
<br></td></tr><tr align="left"><td valign="top" width="40%">colon </td><td valign="top" width="50%">:
<br></td></tr><tr align="left"><td valign="top" width="40%">quote </td><td valign="top" width="50%">'
<br></td></tr><tr align="left"><td valign="top" width="40%">doublequote </td><td valign="top" width="50%">"
<br></td></tr><tr align="left"><td valign="top" width="40%">backquote </td><td valign="top" width="50%">`
<br></td></tr><tr align="left"><td valign="top" width="40%">tilde </td><td valign="top" width="50%">~
<br></td></tr><tr align="left"><td valign="top" width="40%">shift </td><td valign="top" width="50%">press and release left Shift
<br></td></tr><tr align="left"><td valign="top" width="40%">backslash </td><td valign="top" width="50%">\
<br></td></tr><tr align="left"><td valign="top" width="40%">bar </td><td valign="top" width="50%">|
<br></td></tr><tr align="left"><td valign="top" width="40%">comma </td><td valign="top" width="50%">,
<br></td></tr><tr align="left"><td valign="top" width="40%">less </td><td valign="top" width="50%">&lt;
<br></td></tr><tr align="left"><td valign="top" width="40%">period </td><td valign="top" width="50%">. 
<br></td></tr><tr align="left"><td valign="top" width="40%">greater </td><td valign="top" width="50%">&gt;
<br></td></tr><tr align="left"><td valign="top" width="40%">slash </td><td valign="top" width="50%">/
<br></td></tr><tr align="left"><td valign="top" width="40%">question </td><td valign="top" width="50%">? 
<br></td></tr><tr align="left"><td valign="top" width="40%">rshift </td><td valign="top" width="50%">press and release right Shift
<br></td></tr><tr align="left"><td valign="top" width="40%">alt </td><td valign="top" width="50%">press and release Alt
<br></td></tr><tr align="left"><td valign="top" width="40%">space </td><td valign="top" width="50%">space bar
<br></td></tr><tr align="left"><td valign="top" width="40%">capslock </td><td valign="top" width="50%">Caps Lock
<br></td></tr><tr align="left"><td valign="top" width="40%">F1 </td><td valign="top" width="50%">F1
<br></td></tr><tr align="left"><td valign="top" width="40%">F2 </td><td valign="top" width="50%">F2
<br></td></tr><tr align="left"><td valign="top" width="40%">F3 </td><td valign="top" width="50%">F3
<br></td></tr><tr align="left"><td valign="top" width="40%">F4 </td><td valign="top" width="50%">F4
<br></td></tr><tr align="left"><td valign="top" width="40%">F5 </td><td valign="top" width="50%">F5
<br></td></tr><tr align="left"><td valign="top" width="40%">F6 </td><td valign="top" width="50%">F6
<br></td></tr><tr align="left"><td valign="top" width="40%">F7 </td><td valign="top" width="50%">F7
<br></td></tr><tr align="left"><td valign="top" width="40%">F8 </td><td valign="top" width="50%">F8
<br></td></tr><tr align="left"><td valign="top" width="40%">F9 </td><td valign="top" width="50%">F9
<br></td></tr><tr align="left"><td valign="top" width="40%">F10 </td><td valign="top" width="50%">F10
<br></td></tr><tr align="left"><td valign="top" width="40%">F11 </td><td valign="top" width="50%">F11
<br></td></tr><tr align="left"><td valign="top" width="40%">F12 </td><td valign="top" width="50%">F12
<br></td></tr><tr align="left"><td valign="top" width="40%">num1 </td><td valign="top" width="50%">1 (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">num2 </td><td valign="top" width="50%">2 (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">num3 </td><td valign="top" width="50%">3 (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">num4 </td><td valign="top" width="50%">4 (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">num5 </td><td valign="top" width="50%">5 (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">num6 </td><td valign="top" width="50%">6 (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">num7 </td><td valign="top" width="50%">7 (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">num8 </td><td valign="top" width="50%">8 (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">num9 </td><td valign="top" width="50%">9 (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">num0 </td><td valign="top" width="50%">0 (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numperiod </td><td valign="top" width="50%">. (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numend </td><td valign="top" width="50%">End (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numdown </td><td valign="top" width="50%">Down (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numpgdown </td><td valign="top" width="50%">Page Down (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numleft </td><td valign="top" width="50%">Left (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numcenter </td><td valign="top" width="50%">5 with Num Lock inactive (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numright </td><td valign="top" width="50%">Right (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numhome </td><td valign="top" width="50%">Home (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numup </td><td valign="top" width="50%">Up (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numpgup </td><td valign="top" width="50%">Page Up (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numinsert </td><td valign="top" width="50%">Insert (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numdelete </td><td valign="top" width="50%">Delete (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numasterisk </td><td valign="top" width="50%">* (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numminus </td><td valign="top" width="50%">- (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numplus </td><td valign="top" width="50%">+ (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numslash </td><td valign="top" width="50%">/ (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">numenter </td><td valign="top" width="50%">Enter (numeric keypad)
<br></td></tr><tr align="left"><td valign="top" width="40%">delete </td><td valign="top" width="50%">Delete
<br></td></tr><tr align="left"><td valign="top" width="40%">insert </td><td valign="top" width="50%">Insert
<br></td></tr><tr align="left"><td valign="top" width="40%">home </td><td valign="top" width="50%">Home
<br></td></tr><tr align="left"><td valign="top" width="40%">end </td><td valign="top" width="50%">End
<br></td></tr><tr align="left"><td valign="top" width="40%">pgdown </td><td valign="top" width="50%">Page Down
<br></td></tr><tr align="left"><td valign="top" width="40%">pgup </td><td valign="top" width="50%">Page Up
<br></td></tr><tr align="left"><td valign="top" width="40%">down </td><td valign="top" width="50%">Down
<br></td></tr><tr align="left"><td valign="top" width="40%">up </td><td valign="top" width="50%">Up
<br></td></tr><tr align="left"><td valign="top" width="40%">left </td><td valign="top" width="50%">Left
<br></td></tr><tr align="left"><td valign="top" width="40%">right </td><td valign="top" width="50%">Right
        <br></td></tr></table>

        <p>As well as keystrokes, the <samp><span class="command">sendkey</span></samp> command takes various options
that affect the BIOS keyboard status flags.  These options take an &lsquo;<samp><span class="samp">on</span></samp>&rsquo;
or &lsquo;<samp><span class="samp">off</span></samp>&rsquo; parameter, specifying that the corresponding status flag be
set or unset; omitting the option for a given status flag will leave that
flag at its initial state at boot.  The <samp><span class="option">--num</span></samp>, <samp><span class="option">--caps</span></samp>,
<samp><span class="option">--scroll</span></samp>, and <samp><span class="option">--insert</span></samp> options emulate setting the
corresponding mode, while the <samp><span class="option">--numkey</span></samp>, <samp><span class="option">--capskey</span></samp>,
<samp><span class="option">--scrollkey</span></samp>, and <samp><span class="option">--insertkey</span></samp> options emulate pressing and
holding the corresponding key.  The other status flag options are
self-explanatory.

        <p>If the <samp><span class="option">--no-led</span></samp> option is given, the status flag options will have
no effect on keyboard LEDs.

        <p>If the <samp><span class="command">sendkey</span></samp> command is given multiple times, then only the last
invocation has any effect.

        <p>Since <samp><span class="command">sendkey</span></samp> manipulates the BIOS keyboard buffer, it may cause
hangs, reboots, or other misbehaviour on some systems.  If the operating
system or boot loader that runs after GRUB uses its own keyboard driver
rather than the BIOS keyboard functions, then <samp><span class="command">sendkey</span></samp> will have no
effect.

        <p>This command is only available on PC BIOS systems. 
</p></blockquote></div>

<div class="node">
<a name="set"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#true">true</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#sendkey">sendkey</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.42 set</h4>

<div class="defun">
&mdash; Command: <b>set</b> [<var>envvar=value</var>]<var><a name="index-set-48"></a></var><br>
<blockquote><p>Set the environment variable <var>envvar</var> to <var>value</var>. If invoked with no
arguments, print all environment variables with their values. 
</p></blockquote></div>

<div class="node">
<a name="true"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#unset">unset</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#set">set</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.43 true</h4>

<div class="defun">
&mdash; Command: <b>true</b><var><a name="index-true-49"></a></var><br>
<blockquote><p>Do nothing, successfully.  This is mainly useful in control constructs such
as <code>if</code> and <code>while</code> (see <a href="#Shell_002dlike-scripting">Shell-like scripting</a>). 
</p></blockquote></div>

<div class="node">
<a name="unset"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#uppermem">uppermem</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#true">true</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.44 unset</h4>

<div class="defun">
&mdash; Command: <b>unset</b><var> envvar<a name="index-unset-50"></a></var><br>
<blockquote><p>Unset the environment variable <var>envvar</var>. 
</p></blockquote></div>

<div class="node">
<a name="uppermem"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#unset">unset</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>

</div>

<h4 class="subsection">14.3.45 uppermem</h4>

<p>This command is not yet implemented for GRUB 2, although it is planned.

<div class="node">
<a name="Internationalisation"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Security">Security</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Commands">Commands</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">15 Charset</h2>

<p>GRUB uses UTF-8 internally other than in rendering where some GRUB-specific
appropriate representation is used. All text files (including config) are
assumed to be encoded in UTF-8.

<h2 class="chapter">16 Filesystems</h2>

<p>NTFS, JFS, UDF, HFS+, exFAT, long filenames in FAT, Joliet part of
ISO9660 are treated as UTF-16 as per specification. AFS and BFS are read
as UTF-8, again according to specification. BtrFS, cpio, tar, squash4, minix,
minix2, minix3, ROMFS, ReiserFS, XFS, ext2, ext3, ext4, FAT (short names),
RockRidge part of ISO9660, nilfs2, UFS1, UFS2 and ZFS are assumed
to be UTF-8. This might be false on systems configured with legacy charset
but as long as the charset used is superset of ASCII you should be able to
access ASCII-named files. And it's recommended to configure your system to use
UTF-8 to access the filesystem, convmv may help with migration. ISO9660 (plain)
filenames are specified as being ASCII or being described with unspecified
escape sequences. GRUB assumes that the ISO9660 names are UTF-8 (since
any ASCII is valid UTF-8). There are some old CD-ROMs which use CP437
in non-compliant way. You're still able to access files with names containing
only ASCII characters on such filesystems though. You're also able to access
any file if the filesystem contains valid Joliet (UTF-16) or RockRidge (UTF-8). 
AFFS, SFS and HFS never use unicode and GRUB assumes them to be in Latin1,
Latin1 and MacRoman respectively. GRUB handles filesystem case-insensitivity
however no attempt is performed at case conversion of international characters
so e.g. a file named lowercase greek alpha is treated as different from
the one named as uppercase alpha. The filesystems in questions are
NTFS (except POSIX namespace), HFS+ (configurable at mkfs time, default
insensitive), SFS (configurable at mkfs time, default insensitive),
JFS (configurable at mkfs time, default sensitive), HFS, AFFS, FAT, exFAT
and ZFS (configurable on per-subvolume basis by property &ldquo;casesensitivity&rdquo;,
default sensitive). On ZFS subvolumes marked as case insensitive files
containing lowercase international characters are inaccessible. 
Also like all supported filesystems except HFS+ and ZFS (configurable on
per-subvolume basis by property &ldquo;normalization&rdquo;, default none) GRUB makes
no attempt at check of canonical equivalence so a file name u-diaresis is
treated as distinct from u+combining diaresis. This however means that in
order to access file on HFS+ its name must be specified in normalisation form D. 
On normalized ZFS subvolumes filenames out of normalisation are inaccessible.

<h2 class="chapter">17 Output terminal</h2>

<p>Firmware output console &ldquo;console&rdquo; on ARC and IEEE1275 are limited to ASCII. 
BIOS firmware console and VGA text are limited to ASCII and some pseudographics. 
None of above mentioned is appropriate for displaying international and any
unsupported character is replaced with question mark except pseudographics
which we attempt to approximate with ASCII. EFI console on the other hand
nominally supports UTF-16 but actual language coverage depends on firmware and
may be very limited. The encoding used on serial can be chosen with
<samp><span class="command">terminfo</span></samp> as either ASCII, UTF-8 or &ldquo;visual UTF-8&rdquo;. Last one is
against the specification but results in correct rendering of right-to-left
on some readers which don't have own bidi implementation. When using gfxterm
or gfxmenu GRUB itself is responsible for rendering the text. In this case
GRUB is limited by loaded fonts. If fonts contain all required characters
then bidirectional text, cursive variants and combining marks other than
enclosing, half (e.g. left half tilde or combining overline) and double ones. 
Ligatures aren't supported though. This should cover European, Middle Eastern
(if you don't mind lack of lam-alif ligature in Arabic) and East Asian scripts. 
Notable unsupported scripts are Brahmic family and derived as well as
Mongolian, Tifinagh, Korean Jamo (precomposed characters have no problem)
and tonal writing (2e5-2e9). GRUB also ignores deprecated (as specified
in Unicode) characters (e.g. tags). GRUB also doesn't handle so called
&ldquo;annotation characters&rdquo; If you can complete either of
two lists or, better, propose a patch to improve rendering, please contact
developper team.

<h2 class="chapter">18 Input terminal</h2>

<p>Firmware console on BIOS, IEEE1275 and ARC doesn't allow you to enter non-ASCII
characters. EFI specification allows for such but author is unaware of any
actual implementations. Serial input is currently limited for latin1 (unlikely
to change). Own keyboard implementations (at_keyboard and usb_keyboard)
supports any key but work on one-char-per-keystroke. 
So no dead keys or advanced input method. Also there is no keymap change hotkey. 
In practice it makes difficult to enter any text using non-Latin alphabet. 
Moreover all current input consumers are limited to ASCII.

<h2 class="chapter">19 Gettext</h2>

<p>GRUB supports being translated. For this you need to have language *.mo files in $prefix/locale, load gettext module and set &ldquo;lang&rdquo; variable.

<h2 class="chapter">20 Regexp</h2>

<p>Regexps work on unicode characters, however no attempt at checking cannonical
equivalence has been made. Moreover the classes like [:alpha:] match only
ASCII subset.

<h2 class="chapter">21 Other</h2>

<p>Currently GRUB always uses YEAR-MONTH-DAY HOUR:MINUTE:SECOND [WEEKDAY] 24-hour
datetime format but weekdays are translated. 
GRUB always uses the decimal number format with [0-9] as digits and . as
descimal separator and no group separator. 
IEEE1275 aliases are matched case-insensitively except non-ASCII which is
matched as binary. Similar behaviour is for matching OSBundleRequired. 
Since IEEE1275 aliases and OSBundleRequired don't contain any non-ASCII it
should never be a problem in practice. 
Case-sensitive identifiers are matched as raw strings, no canonical
equivalence check is performed. Case-insenstive identifiers are matched
as RAW but additionally [a-z] is equivalent to [A-Z]. GRUB-defined
identifiers use only ASCII and so should user-defined ones. 
Identifiers containing non-ASCII may work but aren't supported. 
Only the ASCII space characters (space U+0020, tab U+000b, CR U+000d and
LF U+000a) are recognised. Other unicode space characters aren't a valid
field separator. 
<samp><span class="command">test</span></samp> tests &lt;, &gt;, &lt;=, &gt;=, -pgt and -plt compare the strings in the
lexicographical order of unicode codepoints, replicating the behaviour of
test from coreutils. 
environment variables and commands are listed in the same order.

<div class="node">
<a name="Security"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Platform-limitations">Platform limitations</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Internationalisation">Internationalisation</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">22 Authentication and authorisation</h2>

<p>By default, the boot loader interface is accessible to anyone with physical
access to the console: anyone can select and edit any menu entry, and anyone
can get direct access to a GRUB shell prompt.  For most systems, this is
reasonable since anyone with direct physical access has a variety of other
ways to gain full access, and requiring authentication at the boot loader
level would only serve to make it difficult to recover broken systems.

   <p>However, in some environments, such as kiosks, it may be appropriate to lock
down the boot loader to require authentication before performing certain
operations.

   <p>The &lsquo;<samp><span class="samp">password</span></samp>&rsquo; (see <a href="#password">password</a>) and &lsquo;<samp><span class="samp">password_pbkdf2</span></samp>&rsquo;
(see <a href="#password_005fpbkdf2">password_pbkdf2</a>) commands can be used to define users, each of
which has an associated password.  &lsquo;<samp><span class="samp">password</span></samp>&rsquo; sets the password in
plain text, requiring <samp><span class="file">grub.cfg</span></samp> to be secure; &lsquo;<samp><span class="samp">password_pbkdf2</span></samp>&rsquo;
sets the password hashed using the Password-Based Key Derivation Function
(RFC 2898), requiring the use of <samp><span class="command">grub2-mkpasswd-pbkdf2</span></samp>
(see <a href="#Invoking-grub_002dmkpasswd_002dpbkdf2">Invoking grub2-mkpasswd-pbkdf2</a>) to generate password hashes.

   <p>In order to enable authentication support, the &lsquo;<samp><span class="samp">superusers</span></samp>&rsquo; environment
variable must be set to a list of usernames, separated by any of spaces,
commas, semicolons, pipes, or ampersands.  Superusers are permitted to use
the GRUB command line, edit menu entries, and execute any menu entry.  If
&lsquo;<samp><span class="samp">superusers</span></samp>&rsquo; is set, then use of the command line is automatically
restricted to superusers.

   <p>Other users may be given access to specific menu entries by giving a list of
usernames (as above) using the <samp><span class="option">--users</span></samp> option to the
&lsquo;<samp><span class="samp">menuentry</span></samp>&rsquo; command (see <a href="#menuentry">menuentry</a>).  If the <samp><span class="option">--unrestricted</span></samp>
option is used for a menu entry, then that entry is unrestricted. 
If the <samp><span class="option">--users</span></samp> option is not used for a menu entry, then that
only superusers are able to use it.

   <p>Putting this together, a typical <samp><span class="file">grub.cfg</span></samp> fragment might look like
this:

<pre class="example">     set superusers="root"
     password_pbkdf2 root grub.pbkdf2.sha512.10000.biglongstring
     password user1 insecure
     
     menuentry "May be run by any user" --unrestricted {
     	set root=(hd0,1)
     	linux /vmlinuz
     }
     
     menuentry "Superusers only" --users "" {
     	set root=(hd0,1)
     	linux /vmlinuz single
     }
     
     menuentry "May be run by user1 or a superuser" --users user1 {
     	set root=(hd0,2)
     	chainloader +1
     }
</pre>
   <p>The <samp><span class="command">grub2-mkconfig</span></samp> program does not yet have built-in support for
generating configuration files with authentication.  You can use
<samp><span class="file">/etc/grub.d/40_custom</span></samp> to add simple superuser authentication, by
adding <kbd>set superusers=</kbd> and <kbd>password</kbd> or <kbd>password_pbkdf2</kbd>
commands.

<div class="node">
<a name="Platform-limitations"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Platform_002dspecific-operations">Platform-specific operations</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Security">Security</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">23 Platform limitations</h2>

<p>GRUB2 is designed to be portable and is actually ported across platforms. We
try to keep all platforms at the level. Unfortunately some platforms are better
supported than others. This is detailed in current and 2 following sections.

   <p>ARC platform is unable to change datetime (firmware doesn't seem to provide a
function for it). 
EMU has similar limitation.

   <p>ARC platform no serial port is available. 
EMU has similar limitation.

   <p>Console charset refers only to firmware-assisted console. gfxterm is always
Unicode (see Internationalisation section for its limitations). Serial is
configurable to UTF-8 or ASCII (see Internationalisation). In case of qemu
and coreboot ports the refered console is vga_text. Loongson always uses
gfxterm.

   <p>Most limited one is ASCII. CP437 provides additionally pseudographics. 
GRUB2 doesn't use any language characters from CP437 as often CP437 is replaced
by national encoding compatible only in pseudographics. 
Unicode is the most versatile charset which supports many languages. However
the actual console may be much more limited depending on firmware

   <p>On BIOS network is supported only if the image is loaded through network. 
On sparc64 GRUB is unable to determine which server it was booted from.

   <p>On platforms not having direct serial support (as indicated in the line serial)
you can still redirect firmware console to serial if it allows so.

   <p>Direct ATA/AHCI support allows to circumvent various firmware limitations but
isn't needed for normal operation except on baremetal ports.

   <p>AT keyboard support allows keyboard layout remapping and support for keys not
available through firmware. It isn't needed for normal operation except
baremetal ports.

   <p>USB support provides benefits similar to ATA (for USB disks) or AT (for USB
keyboards). In addition it allows USBserial.

   <p>Chainloading refers to the ability to load another bootloader through the same protocol

   <p>Hints allow faster disk discovery by already knowing in advance which is the disk in
question. On some platforms hints are correct unless you move the disk between boots. 
On other platforms it's just an educated guess. 
Note that hint failure results in just reduced performance, not a failure

   <p>BadRAM is the ability to mark some of the RAM as &ldquo;bad&rdquo;. Note: due to protocol
limitations mips-loongson (with Linux protocol)
and mips-qemu_mips can use only memory up to first hole.

   <p><table summary=""><tr align="left"><td valign="top" width="20%"></td><td valign="top" width="20%">BIOS    </td><td valign="top" width="20%">Coreboot </td><td valign="top" width="20%">Multiboot    </td><td valign="top" width="20%">Qemu
<br></td></tr><tr align="left"><td valign="top" width="20%">video              </td><td valign="top" width="20%">yes     </td><td valign="top" width="20%">yes      </td><td valign="top" width="20%">yes          </td><td valign="top" width="20%">yes
<br></td></tr><tr align="left"><td valign="top" width="20%">console charset    </td><td valign="top" width="20%">CP437   </td><td valign="top" width="20%">CP437    </td><td valign="top" width="20%">CP437        </td><td valign="top" width="20%">CP437
<br></td></tr><tr align="left"><td valign="top" width="20%">network            </td><td valign="top" width="20%">yes (*) </td><td valign="top" width="20%">no       </td><td valign="top" width="20%">no           </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">ATA/AHCI           </td><td valign="top" width="20%">yes     </td><td valign="top" width="20%">yes      </td><td valign="top" width="20%">yes          </td><td valign="top" width="20%">yes
<br></td></tr><tr align="left"><td valign="top" width="20%">AT keyboard        </td><td valign="top" width="20%">yes     </td><td valign="top" width="20%">yes      </td><td valign="top" width="20%">yes          </td><td valign="top" width="20%">yes
<br></td></tr><tr align="left"><td valign="top" width="20%">USB                </td><td valign="top" width="20%">yes     </td><td valign="top" width="20%">yes      </td><td valign="top" width="20%">yes          </td><td valign="top" width="20%">yes
<br></td></tr><tr align="left"><td valign="top" width="20%">chainloader        </td><td valign="top" width="20%">local   </td><td valign="top" width="20%">yes      </td><td valign="top" width="20%">yes          </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">cpuid              </td><td valign="top" width="20%">partial </td><td valign="top" width="20%">partial  </td><td valign="top" width="20%">partial      </td><td valign="top" width="20%">partial
<br></td></tr><tr align="left"><td valign="top" width="20%">hints              </td><td valign="top" width="20%">guess   </td><td valign="top" width="20%">guess    </td><td valign="top" width="20%">guess        </td><td valign="top" width="20%">guess
<br></td></tr><tr align="left"><td valign="top" width="20%">PCI                </td><td valign="top" width="20%">yes     </td><td valign="top" width="20%">yes      </td><td valign="top" width="20%">yes          </td><td valign="top" width="20%">yes
<br></td></tr><tr align="left"><td valign="top" width="20%">badram             </td><td valign="top" width="20%">yes     </td><td valign="top" width="20%">yes      </td><td valign="top" width="20%">yes          </td><td valign="top" width="20%">yes
<br></td></tr><tr align="left"><td valign="top" width="20%">compression        </td><td valign="top" width="20%">always  </td><td valign="top" width="20%">pointless </td><td valign="top" width="20%">no           </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">exit               </td><td valign="top" width="20%">yes     </td><td valign="top" width="20%">no       </td><td valign="top" width="20%">no           </td><td valign="top" width="20%">no
   <br></td></tr></table>

   <p><table summary=""><tr align="left"><td valign="top" width="20%"></td><td valign="top" width="20%">ia32 EFI    </td><td valign="top" width="20%">amd64 EFI </td><td valign="top" width="20%">ia32 IEEE1275 </td><td valign="top" width="20%">Itanium
<br></td></tr><tr align="left"><td valign="top" width="20%">video              </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">yes       </td><td valign="top" width="20%">no            </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">console charset    </td><td valign="top" width="20%">Unicode     </td><td valign="top" width="20%">Unicode   </td><td valign="top" width="20%">ASCII         </td><td valign="top" width="20%">Unicode
<br></td></tr><tr align="left"><td valign="top" width="20%">network            </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">yes       </td><td valign="top" width="20%">yes           </td><td valign="top" width="20%">yes
<br></td></tr><tr align="left"><td valign="top" width="20%">ATA/AHCI           </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">yes       </td><td valign="top" width="20%">yes           </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">AT keyboard        </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">yes       </td><td valign="top" width="20%">yes           </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">USB                </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">yes       </td><td valign="top" width="20%">yes           </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">chainloader        </td><td valign="top" width="20%">local       </td><td valign="top" width="20%">local     </td><td valign="top" width="20%">no            </td><td valign="top" width="20%">local
<br></td></tr><tr align="left"><td valign="top" width="20%">cpuid              </td><td valign="top" width="20%">partial     </td><td valign="top" width="20%">partial   </td><td valign="top" width="20%">partial       </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">hints              </td><td valign="top" width="20%">guess       </td><td valign="top" width="20%">guess     </td><td valign="top" width="20%">good          </td><td valign="top" width="20%">guess
<br></td></tr><tr align="left"><td valign="top" width="20%">PCI                </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">yes       </td><td valign="top" width="20%">yes           </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">badram             </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">yes       </td><td valign="top" width="20%">no            </td><td valign="top" width="20%">yes
<br></td></tr><tr align="left"><td valign="top" width="20%">compression        </td><td valign="top" width="20%">no          </td><td valign="top" width="20%">no        </td><td valign="top" width="20%">no            </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">exit               </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">yes       </td><td valign="top" width="20%">yes           </td><td valign="top" width="20%">yes
   <br></td></tr></table>

   <p><table summary=""><tr align="left"><td valign="top" width="20%"></td><td valign="top" width="20%">Loongson    </td><td valign="top" width="20%">sparc64 </td><td valign="top" width="20%">Powerpc </td><td valign="top" width="20%">ARC
<br></td></tr><tr align="left"><td valign="top" width="20%">video              </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">yes     </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">console charset    </td><td valign="top" width="20%">N/A         </td><td valign="top" width="20%">ASCII   </td><td valign="top" width="20%">ASCII   </td><td valign="top" width="20%">ASCII
<br></td></tr><tr align="left"><td valign="top" width="20%">network            </td><td valign="top" width="20%">no          </td><td valign="top" width="20%">yes (*) </td><td valign="top" width="20%">yes     </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">ATA/AHCI           </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">AT keyboard        </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">USB                </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">chainloader        </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">cpuid              </td><td valign="top" width="20%">no          </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">hints              </td><td valign="top" width="20%">good        </td><td valign="top" width="20%">good    </td><td valign="top" width="20%">good    </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">PCI                </td><td valign="top" width="20%">yes         </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">badram             </td><td valign="top" width="20%">yes (*)     </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">compression        </td><td valign="top" width="20%">configurable </td><td valign="top" width="20%">no     </td><td valign="top" width="20%">no      </td><td valign="top" width="20%">configurable
<br></td></tr><tr align="left"><td valign="top" width="20%">exit               </td><td valign="top" width="20%">no          </td><td valign="top" width="20%">yes     </td><td valign="top" width="20%">yes     </td><td valign="top" width="20%">yes
   <br></td></tr></table>

   <p><table summary=""><tr align="left"><td valign="top" width="20%"></td><td valign="top" width="20%">MIPS qemu </td><td valign="top" width="20%">emu
<br></td></tr><tr align="left"><td valign="top" width="20%">video              </td><td valign="top" width="20%">no        </td><td valign="top" width="20%">yes
<br></td></tr><tr align="left"><td valign="top" width="20%">console charset    </td><td valign="top" width="20%">CP437     </td><td valign="top" width="20%">ASCII
<br></td></tr><tr align="left"><td valign="top" width="20%">network            </td><td valign="top" width="20%">no        </td><td valign="top" width="20%">yes
<br></td></tr><tr align="left"><td valign="top" width="20%">ATA/AHCI           </td><td valign="top" width="20%">yes       </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">AT keyboard        </td><td valign="top" width="20%">yes       </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">USB                </td><td valign="top" width="20%">N/A       </td><td valign="top" width="20%">yes
<br></td></tr><tr align="left"><td valign="top" width="20%">chainloader        </td><td valign="top" width="20%">yes       </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">cpuid              </td><td valign="top" width="20%">no        </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">hints              </td><td valign="top" width="20%">guess     </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">PCI                </td><td valign="top" width="20%">no        </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">badram             </td><td valign="top" width="20%">yes (*)   </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">compression        </td><td valign="top" width="20%">configurable </td><td valign="top" width="20%">no
<br></td></tr><tr align="left"><td valign="top" width="20%">exit               </td><td valign="top" width="20%">no        </td><td valign="top" width="20%">yes
   <br></td></tr></table>

<div class="node">
<a name="Platform-specific-operations"></a>
<a name="Platform_002dspecific-operations"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Supported-kernels">Supported kernels</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Platform-limitations">Platform limitations</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">24 Outline</h2>

<p>Some platforms have features which allows to implement
some commands useless or not implementable on others.

   <p>Quick summary:

   <p>Information retrieval:

     <ul>
<li>mipsel-loongson: lsspd
<li>mips-arc: lsdev
<li>efi: lsefisystab, lssal, lsefimmap
<li>i386-pc: lsapm
<li>acpi-enabled (i386-pc, i386-coreboot, i386-multiboot, *-efi): lsacpi
</ul>

   <p>Workarounds for platform-specific issues:
     <ul>
<li>i386-efi/x86_64-efi: loadbios, fixvideo
<li>acpi-enabled (i386-pc, i386-coreboot, i386-multiboot, *-efi):
    acpi (override ACPI tables)
<li>i386-pc: drivemap
<li>i386-pc: sendkey
</ul>

   <p>Advanced operations for power users:
     <ul>
<li>x86: iorw (direct access to I/O ports)
</ul>

   <p>Miscelaneous:
     <ul>
<li>cmos (x86-*, ieee1275, mips-qemu_mips, mips-loongson): cmostest
    (used on some laptops to check for special power-on key)
<li>i386-pc: play
</ul>

<div class="node">
<a name="Supported-kernels"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Troubleshooting">Troubleshooting</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Platform_002dspecific-operations">Platform-specific operations</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">25 Supported boot targets</h2>

<p>X86 support is summarised in the following table. &ldquo;Yes&rdquo; means that the kernel works on the given platform, &ldquo;crashes&rdquo; means an early kernel crash which we hope will be fixed by concerned kernel developers. &ldquo;no&rdquo; means GRUB doesn't load the given kernel on a given platform. &ldquo;headless&rdquo; means that the kernel works but lacks console drivers (you can still use serial or network console).  In case of &ldquo;no&rdquo; and &ldquo;crashes&rdquo; the reason is given in footnote.
   <p><table summary=""><tr align="left"><td valign="top" width="50%"></td><td valign="top" width="22%">BIOS    </td><td valign="top" width="22%">Coreboot
<br></td></tr><tr align="left"><td valign="top" width="50%">BIOS chainloading              </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">NTLDR                          </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">Plan9                          </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">Freedos                        </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">FreeBSD bootloader             </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">crashes (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kFreeBSD                </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">crashes (2,6)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kFreeBSD                </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">crashes (2,6)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kNetBSD                 </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">crashes (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kNetBSD                 </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">crashes (2)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kOpenBSD                </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kOpenBSD                </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot                      </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot2                     </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (legacy protocol) </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (legacy protocol) </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (modern protocol) </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (modern protocol) </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit XNU                     </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit XNU                     </td><td valign="top" width="22%">yes     </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit EFI chainloader         </td><td valign="top" width="22%">no (3)  </td><td valign="top" width="22%">no (3)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit EFI chainloader         </td><td valign="top" width="22%">no (3)  </td><td valign="top" width="22%">no (3)
<br></td></tr><tr align="left"><td valign="top" width="50%">Appleloader                    </td><td valign="top" width="22%">no (3)  </td><td valign="top" width="22%">no (3)
   <br></td></tr></table>

   <p><table summary=""><tr align="left"><td valign="top" width="50%"></td><td valign="top" width="22%">Multiboot    </td><td valign="top" width="22%">Qemu
<br></td></tr><tr align="left"><td valign="top" width="50%">BIOS chainloading              </td><td valign="top" width="22%">no (1)       </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">NTLDR                          </td><td valign="top" width="22%">no (1)       </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">Plan9                          </td><td valign="top" width="22%">no (1)       </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">FreeDOS                        </td><td valign="top" width="22%">no (1)       </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">FreeBSD bootloader             </td><td valign="top" width="22%">crashes (1)  </td><td valign="top" width="22%">crashes (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kFreeBSD                </td><td valign="top" width="22%">crashes (6)  </td><td valign="top" width="22%">crashes (6)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kFreeBSD                </td><td valign="top" width="22%">crashes (6)  </td><td valign="top" width="22%">crashes (6)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kNetBSD                 </td><td valign="top" width="22%">crashes (1)  </td><td valign="top" width="22%">crashes (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kNetBSD                 </td><td valign="top" width="22%">yes          </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kOpenBSD                </td><td valign="top" width="22%">yes          </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kOpenBSD                </td><td valign="top" width="22%">yes          </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot                      </td><td valign="top" width="22%">yes          </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot2                     </td><td valign="top" width="22%">yes          </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1)       </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1)       </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (modern protocol) </td><td valign="top" width="22%">yes          </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (modern protocol) </td><td valign="top" width="22%">yes          </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit XNU                     </td><td valign="top" width="22%">?            </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit XNU                     </td><td valign="top" width="22%">?            </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit EFI chainloader         </td><td valign="top" width="22%">no (3)       </td><td valign="top" width="22%">no (3)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit EFI chainloader         </td><td valign="top" width="22%">no (3)       </td><td valign="top" width="22%">no (3)
<br></td></tr><tr align="left"><td valign="top" width="50%">Appleloader                    </td><td valign="top" width="22%">no (3)       </td><td valign="top" width="22%">no (3)
   <br></td></tr></table>

   <p><table summary=""><tr align="left"><td valign="top" width="50%"></td><td valign="top" width="22%">ia32 EFI      </td><td valign="top" width="22%">amd64 EFI
<br></td></tr><tr align="left"><td valign="top" width="50%">BIOS chainloading              </td><td valign="top" width="22%">no (1)        </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">NTLDR                          </td><td valign="top" width="22%">no (1)        </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">Plan9                          </td><td valign="top" width="22%">no (1)        </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">FreeDOS                        </td><td valign="top" width="22%">no (1)        </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">FreeBSD bootloader             </td><td valign="top" width="22%">crashes (1)   </td><td valign="top" width="22%">crashes (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kFreeBSD                </td><td valign="top" width="22%">headless      </td><td valign="top" width="22%">headless
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kFreeBSD                </td><td valign="top" width="22%">headless      </td><td valign="top" width="22%">headless
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kNetBSD                 </td><td valign="top" width="22%">crashes (1)   </td><td valign="top" width="22%">crashes (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kNetBSD                 </td><td valign="top" width="22%">yes           </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kOpenBSD                </td><td valign="top" width="22%">headless      </td><td valign="top" width="22%">headless
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kOpenBSD                </td><td valign="top" width="22%">headless      </td><td valign="top" width="22%">headless
<br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot                      </td><td valign="top" width="22%">yes           </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot2                     </td><td valign="top" width="22%">yes           </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1)        </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1)        </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (modern protocol) </td><td valign="top" width="22%">yes           </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (modern protocol) </td><td valign="top" width="22%">yes           </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit XNU                     </td><td valign="top" width="22%">yes           </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit XNU                     </td><td valign="top" width="22%">yes (5)       </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit EFI chainloader         </td><td valign="top" width="22%">yes           </td><td valign="top" width="22%">no (4)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit EFI chainloader         </td><td valign="top" width="22%">no (4)        </td><td valign="top" width="22%">yes
<br></td></tr><tr align="left"><td valign="top" width="50%">Appleloader                    </td><td valign="top" width="22%">yes           </td><td valign="top" width="22%">yes
   <br></td></tr></table>

   <p><table summary=""><tr align="left"><td valign="top" width="50%"></td><td valign="top" width="22%">ia32 IEEE1275
<br></td></tr><tr align="left"><td valign="top" width="50%">BIOS chainloading              </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">NTLDR                          </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">Plan9                          </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">FreeDOS                        </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">FreeBSD bootloader             </td><td valign="top" width="22%">crashes (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kFreeBSD                </td><td valign="top" width="22%">crashes (6)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kFreeBSD                </td><td valign="top" width="22%">crashes (6)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kNetBSD                 </td><td valign="top" width="22%">crashes (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kNetBSD                 </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kOpenBSD                </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kOpenBSD                </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot                      </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot2                     </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1)
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (modern protocol) </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (modern protocol) </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit XNU                     </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit XNU                     </td><td valign="top" width="22%">? 
<br></td></tr><tr align="left"><td valign="top" width="50%">32-bit EFI chainloader         </td><td valign="top" width="22%">no (3)
<br></td></tr><tr align="left"><td valign="top" width="50%">64-bit EFI chainloader         </td><td valign="top" width="22%">no (3)
<br></td></tr><tr align="left"><td valign="top" width="50%">Appleloader                    </td><td valign="top" width="22%">no (3)
   <br></td></tr></table>

     <ol type=1 start=1>
<li>Requires BIOS
<li>Crashes because the memory at 0x0-0x1000 isn't available
<li>EFI only
<li>32-bit and 64-bit EFI have different structures and work in different CPU modes so it's not possible to chainload 32-bit bootloader on 64-bit platform and vice-versa
<li>Some modules may need to be disabled
<li>Requires ACPI
        </ol>

   <p>PowerPC, IA64 and Sparc64 ports support only Linux. MIPS port supports Linux
and multiboot2.

<h2 class="chapter">26 Boot tests</h2>

<p>As you have seen in previous chapter the support matrix is pretty big and some of the configurations are only rarely used. To ensure the quality bootchecks are available for all x86 targets except EFI chainloader, Appleloader and XNU. All x86 platforms have bootcheck facility except ieee1275. Multiboot, multiboot2, BIOS chainloader, ntldr and freebsd-bootloader boot targets are tested only with a fake kernel images. Only Linux is tested among the payloads using Linux protocols.

   <p>Following variables must be defined:

   <p><table summary=""><tr align="left"><td valign="top" width="30%">GRUB_PAYLOADS_DIR </td><td valign="top" width="65%">directory containing the required kernels
<br></td></tr><tr align="left"><td valign="top" width="30%">GRUB_CBFSTOOL </td><td valign="top" width="65%">cbfstoll from Coreboot package (for coreboot platform only)
<br></td></tr><tr align="left"><td valign="top" width="30%">GRUB_COREBOOT_ROM </td><td valign="top" width="65%">empty Coreboot ROM
<br></td></tr><tr align="left"><td valign="top" width="30%">GRUB_QEMU_OPTS </td><td valign="top" width="65%">additional options to be supplied to QEMU
   <br></td></tr></table>

   <p>Required files are:

   <p><table summary=""><tr align="left"><td valign="top" width="40%">kfreebsd_env.i386 </td><td valign="top" width="55%">32-bit kFreeBSD device hints
<br></td></tr><tr align="left"><td valign="top" width="40%">kfreebsd.i386 </td><td valign="top" width="55%">32-bit FreeBSD kernel image
<br></td></tr><tr align="left"><td valign="top" width="40%">kfreebsd.x86_64, kfreebsd_env.x86_64 </td><td valign="top" width="55%">same from 64-bit kFreeBSD
<br></td></tr><tr align="left"><td valign="top" width="40%">knetbsd.i386 </td><td valign="top" width="55%">32-bit NetBSD kernel image
<br></td></tr><tr align="left"><td valign="top" width="40%">knetbsd.miniroot.i386 </td><td valign="top" width="55%">32-bit kNetBSD miniroot.kmod. 
<br></td></tr><tr align="left"><td valign="top" width="40%">knetbsd.x86_64, knetbsd.miniroot.x86_64  </td><td valign="top" width="55%">same from 64-bit kNetBSD
<br></td></tr><tr align="left"><td valign="top" width="40%">kopenbsd.i386 </td><td valign="top" width="55%">32-bit OpenBSD kernel bsd.rd image
<br></td></tr><tr align="left"><td valign="top" width="40%">kopenbsd.x86_64 </td><td valign="top" width="55%">same from 64-bit kOpenBSD
<br></td></tr><tr align="left"><td valign="top" width="40%">linux.i386 </td><td valign="top" width="55%">32-bit Linux
<br></td></tr><tr align="left"><td valign="top" width="40%">linux.x86_64 </td><td valign="top" width="55%">64-bit Linux
   <br></td></tr></table>

<div class="node">
<a name="Troubleshooting"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Invoking-grub_002dinstall">Invoking grub2-install</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Supported-kernels">Supported kernels</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">27 Error messages produced by GRUB</h2>

<ul class="menu">
<li><a accesskey="1" href="#GRUB-only-offers-a-rescue-shell">GRUB only offers a rescue shell</a>
</ul>

<div class="node">
<a name="GRUB-only-offers-a-rescue-shell"></a>
<p><hr>
Up:&nbsp;<a rel="up" accesskey="u" href="#Troubleshooting">Troubleshooting</a>

</div>

<h3 class="section">27.1 GRUB only offers a rescue shell</h3>

<p>GRUB's normal start-up procedure involves setting the &lsquo;<samp><span class="samp">prefix</span></samp>&rsquo;
environment variable to a value set in the core image by
<samp><span class="command">grub2-install</span></samp>, setting the &lsquo;<samp><span class="samp">root</span></samp>&rsquo; variable to match, loading
the &lsquo;<samp><span class="samp">normal</span></samp>&rsquo; module from the prefix, and running the &lsquo;<samp><span class="samp">normal</span></samp>&rsquo;
command (see <a href="#normal">normal</a>).  This command is responsible for reading
<samp><span class="file">/boot/grub2/grub.cfg</span></samp>, running the menu, and doing all the useful
things GRUB is supposed to do.

   <p>If, instead, you only get a rescue shell, this usually means that GRUB
failed to load the &lsquo;<samp><span class="samp">normal</span></samp>&rsquo; module for some reason.  It may be possible
to work around this temporarily: for instance, if the reason for the failure
is that &lsquo;<samp><span class="samp">prefix</span></samp>&rsquo; is wrong (perhaps it refers to the wrong device, or
perhaps the path to <samp><span class="file">/boot/grub</span></samp> was not correctly made relative to the
device), then you can correct this and enter normal mode manually:

<pre class="example">     # Inspect the current prefix (and other preset variables):
     set
     # Find out which devices are available:
     ls
     # Set to the correct value, which might be something like this:
     set prefix=(hd0,1)/grub
     set root=(hd0,1)
     insmod normal
     normal
</pre>
   <p>However, any problem that leaves you in the rescue shell probably means that
GRUB was not correctly installed.  It may be more useful to try to reinstall
it properly using <kbd>grub2-install </kbd><var>device</var> (see <a href="#Invoking-grub_002dinstall">Invoking grub2-install</a>).  When doing this, there are a few things to remember:

     <ul>
<li>Drive ordering in your operating system may not be the same as the boot
drive ordering used by your firmware.  Do not assume that your first hard
drive (e.g. &lsquo;<samp><span class="samp">/dev/sda</span></samp>&rsquo;) is the one that your firmware will boot from. 
<samp><span class="file">device.map</span></samp> (see <a href="#Device-map">Device map</a>) can be used to override this, but it
is usually better to use UUIDs or file system labels and avoid depending on
drive ordering entirely.

     <li>At least on BIOS systems, if you tell <samp><span class="command">grub2-install</span></samp> to install GRUB
to a partition but GRUB has already been installed in the master boot
record, then the GRUB installation in the partition will be ignored.

     <li>If possible, it is generally best to avoid installing GRUB to a partition
(unless it is a special partition for the use of GRUB alone, such as the
BIOS Boot Partition used on GPT).  Doing this means that GRUB may stop being
able to read its core image due to a file system moving blocks around, such
as while defragmenting, running checks, or even during normal operation. 
Installing to the whole disk device is normally more robust.

     <li>Check that GRUB actually knows how to read from the device and file system
containing <samp><span class="file">/boot/grub</span></samp>.  It will not be able to read from encrypted
devices, nor from file systems for which support has not yet been added to
GRUB. 
</ul>

<div class="node">
<a name="Invoking-grub-install"></a>
<a name="Invoking-grub_002dinstall"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Invoking-grub_002dmkconfig">Invoking grub2-mkconfig</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Troubleshooting">Troubleshooting</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">28 Invoking grub2-install</h2>

<p>The program <samp><span class="command">grub2-install</span></samp> installs GRUB on your drive using
<samp><span class="command">grub2-mkimage</span></samp> and (on some platforms) <samp><span class="command">grub2-setup</span></samp>.  You
must specify the device name on which you want to install GRUB, like this:

<pre class="example">     grub2-install <var>install_device</var>
</pre>
   <p>The device name <var>install_device</var> is an OS device name or a GRUB
device name.

   <p><samp><span class="command">grub2-install</span></samp> accepts the following options:

     <dl>
<dt><samp><span class="option">--help</span></samp><dd>Print a summary of the command-line options and exit.

     <br><dt><samp><span class="option">--version</span></samp><dd>Print the version number of GRUB and exit.

     <br><dt><samp><span class="option">--boot-directory=</span><var>dir</var></samp><dd>Install GRUB images under the directory <samp><var>dir</var><span class="file">/grub/</span></samp>
This option is useful when you want to install GRUB into a
separate partition or a removable disk. 
If this option is not specified then it defaults to <samp><span class="file">/boot</span></samp>, so

     <pre class="example">          <kbd>grub2-install /dev/sda</kbd>
</pre>
     <p>is equivalent to

     <pre class="example">          <kbd>grub2-install --boot-directory=/boot/ /dev/sda</kbd>
</pre>
     <p>Here is an example in which you have a separate <dfn>boot</dfn> partition which is
mounted on
<samp><span class="file">/mnt/boot</span></samp>:

     <pre class="example">          <kbd>grub2-install --boot-directory=/mnt/boot /dev/sdb</kbd>
</pre>
     <br><dt><samp><span class="option">--recheck</span></samp><dd>Recheck the device map, even if <samp><span class="file">/boot/grub2/device.map</span></samp> already
exists. You should use this option whenever you add/remove a disk
into/from your computer. 
</dl>

<div class="node">
<a name="Invoking-grub-mkconfig"></a>
<a name="Invoking-grub_002dmkconfig"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Invoking-grub_002dmkpasswd_002dpbkdf2">Invoking grub2-mkpasswd-pbkdf2</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Invoking-grub_002dinstall">Invoking grub2-install</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">29 Invoking grub2-mkconfig</h2>

<p>The program <samp><span class="command">grub2-mkconfig</span></samp> generates a configuration file for GRUB
(see <a href="#Simple-configuration">Simple configuration</a>).

<pre class="example">     grub2-mkconfig -o /boot/grub2/grub.cfg
</pre>
   <p><samp><span class="command">grub2-mkconfig</span></samp> accepts the following options:

     <dl>
<dt><samp><span class="option">--help</span></samp><dd>Print a summary of the command-line options and exit.

     <br><dt><samp><span class="option">--version</span></samp><dd>Print the version number of GRUB and exit.

     <br><dt><samp><span class="option">-o </span><var>file</var></samp><dt><samp><span class="option">--output=</span><var>file</var></samp><dd>Send the generated configuration file to <var>file</var>.  The default is to send
it to standard output. 
</dl>

<div class="node">
<a name="Invoking-grub-mkpasswd-pbkdf2"></a>
<a name="Invoking-grub_002dmkpasswd_002dpbkdf2"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Invoking-grub_002dmkrescue">Invoking grub2-mkrescue</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Invoking-grub_002dmkconfig">Invoking grub2-mkconfig</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">30 Invoking grub2-mkpasswd-pbkdf2</h2>

<p>The program <samp><span class="command">grub2-mkpasswd-pbkdf2</span></samp> generates password hashes for
GRUB (see <a href="#Security">Security</a>).

<pre class="example">     grub2-mkpasswd-pbkdf2
</pre>
   <p><samp><span class="command">grub2-mkpasswd-pbkdf2</span></samp> accepts the following options:

     <dl>
<dt><samp><span class="option">-c </span><var>number</var></samp><dt><samp><span class="option">--iteration-count=</span><var>number</var></samp><dd>Number of iterations of the underlying pseudo-random function.  Defaults to
10000.

     <br><dt><samp><span class="option">-l </span><var>number</var></samp><dt><samp><span class="option">--buflen=</span><var>number</var></samp><dd>Length of the generated hash.  Defaults to 64.

     <br><dt><samp><span class="option">-s </span><var>number</var></samp><dt><samp><span class="option">--salt=</span><var>number</var></samp><dd>Length of the salt.  Defaults to 64. 
</dl>

<div class="node">
<a name="Invoking-grub-mkrescue"></a>
<a name="Invoking-grub_002dmkrescue"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Invoking-grub_002dprobe">Invoking grub2-probe</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Invoking-grub_002dmkpasswd_002dpbkdf2">Invoking grub2-mkpasswd-pbkdf2</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">31 Invoking grub2-mkrescue</h2>

<p>The program <samp><span class="command">grub2-mkrescue</span></samp> generates a bootable GRUB rescue image
(see <a href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>).

<pre class="example">     grub2-mkrescue -o grub.iso
</pre>
   <p>All arguments not explicitly listed as <samp><span class="command">grub2-mkrescue</span></samp> options are
passed on directly to <samp><span class="command">xorriso</span></samp> in <samp><span class="command">mkisofs</span></samp> emulation mode. 
Options passed to <samp><span class="command">xorriso</span></samp> will normally be interpreted as
<samp><span class="command">mkisofs</span></samp> options; if the option &lsquo;<samp><span class="samp">--</span></samp>&rsquo; is used, then anything
after that will be interpreted as native <samp><span class="command">xorriso</span></samp> options.

   <p>Non-option arguments specify additional source directories.  This is
commonly used to add extra files to the image:

<pre class="example">     mkdir -p disk/boot/grub
     <span class="roman">(add extra files to </span><samp><span class="file">disk/boot/grub</span></samp><span class="roman">)</span>
     grub2-mkrescue -o grub.iso disk
</pre>
   <p><samp><span class="command">grub2-mkrescue</span></samp> accepts the following options:

     <dl>
<dt><samp><span class="option">--help</span></samp><dd>Print a summary of the command-line options and exit.

     <br><dt><samp><span class="option">--version</span></samp><dd>Print the version number of GRUB and exit.

     <br><dt><samp><span class="option">-o </span><var>file</var></samp><dt><samp><span class="option">--output=</span><var>file</var></samp><dd>Save output in <var>file</var>.  This "option" is required.

     <br><dt><samp><span class="option">--modules=</span><var>modules</var></samp><dd>Pre-load the named GRUB modules in the image.  Multiple entries in
<var>modules</var> should be separated by whitespace (so you will probably need
to quote this for your shell).

     <br><dt><samp><span class="option">--rom-directory=</span><var>dir</var></samp><dd>If generating images for the QEMU or Coreboot platforms, copy the resulting
<samp><span class="file">qemu.img</span></samp> or <samp><span class="file">coreboot.elf</span></samp> files respectively to the <var>dir</var>
directory as well as including them in the image.

     <br><dt><samp><span class="option">--xorriso=</span><var>file</var></samp><dd>Use <var>file</var> as the <samp><span class="command">xorriso</span></samp> program, rather than the built-in
default.

     <br><dt><samp><span class="option">--grub-mkimage=</span><var>file</var></samp><dd>Use <var>file</var> as the <samp><span class="command">grub2-mkimage</span></samp> program, rather than the
built-in default. 
</dl>

<div class="node">
<a name="Invoking-grub-probe"></a>
<a name="Invoking-grub_002dprobe"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Obtaining-and-Building-GRUB">Obtaining and Building GRUB</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Invoking-grub_002dmkrescue">Invoking grub2-mkrescue</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="chapter">32 Invoking grub2-probe</h2>

<p>The program <samp><span class="command">grub2-probe</span></samp> probes device information for a given path
or device.

<pre class="example">     grub2-probe --target=fs /boot/grub
     grub2-probe --target=drive --device /dev/sda1
</pre>
   <p><samp><span class="command">grub2-probe</span></samp> must be given a path or device as a non-option
argument, and also accepts the following options:

     <dl>
<dt><samp><span class="option">--help</span></samp><dd>Print a summary of the command-line options and exit.

     <br><dt><samp><span class="option">--version</span></samp><dd>Print the version number of GRUB and exit.

     <br><dt><samp><span class="option">-d</span></samp><dt><samp><span class="option">--device</span></samp><dd>If this option is given, then the non-option argument is a system device
name (such as &lsquo;<samp><span class="samp">/dev/sda1</span></samp>&rsquo;), and <samp><span class="command">grub2-probe</span></samp> will print
information about that device.  If it is not given, then the non-option
argument is a filesystem path (such as &lsquo;<samp><span class="samp">/boot/grub</span></samp>&rsquo;), and
<samp><span class="command">grub2-probe</span></samp> will print information about the device containing that
part of the filesystem.

     <br><dt><samp><span class="option">-m </span><var>file</var></samp><dt><samp><span class="option">--device-map=</span><var>file</var></samp><dd>Use <var>file</var> as the device map (see <a href="#Device-map">Device map</a>) rather than the
default, usually &lsquo;<samp><span class="samp">/boot/grub2/device.map</span></samp>&rsquo;.

     <br><dt><samp><span class="option">-t </span><var>target</var></samp><dt><samp><span class="option">--target=</span><var>target</var></samp><dd>Print information about the given path or device as defined by <var>target</var>. 
The available targets and their meanings are:

          <dl>
<dt>&lsquo;<samp><span class="samp">fs</span></samp>&rsquo;<dd>GRUB filesystem module. 
<br><dt>&lsquo;<samp><span class="samp">fs_uuid</span></samp>&rsquo;<dd>Filesystem Universally Unique Identifier (UUID). 
<br><dt>&lsquo;<samp><span class="samp">fs_label</span></samp>&rsquo;<dd>Filesystem label. 
<br><dt>&lsquo;<samp><span class="samp">drive</span></samp>&rsquo;<dd>GRUB device name. 
<br><dt>&lsquo;<samp><span class="samp">device</span></samp>&rsquo;<dd>System device name. 
<br><dt>&lsquo;<samp><span class="samp">partmap</span></samp>&rsquo;<dd>GRUB partition map module. 
<br><dt>&lsquo;<samp><span class="samp">abstraction</span></samp>&rsquo;<dd>GRUB abstraction module (e.g. &lsquo;<samp><span class="samp">lvm</span></samp>&rsquo;). 
<br><dt>&lsquo;<samp><span class="samp">cryptodisk_uuid</span></samp>&rsquo;<dd>Crypto device UUID. 
<br><dt>&lsquo;<samp><span class="samp">msdos_parttype</span></samp>&rsquo;<dd>MBR partition type code (two hexadecimal digits). 
<br><dt>&lsquo;<samp><span class="samp">hints_string</span></samp>&rsquo;<dd>A string of platform search hints suitable for passing to the
<samp><span class="command">search</span></samp> command (see <a href="#search">search</a>). 
<br><dt>&lsquo;<samp><span class="samp">bios_hints</span></samp>&rsquo;<dd>Search hints for the PC BIOS platform. 
<br><dt>&lsquo;<samp><span class="samp">ieee1275_hints</span></samp>&rsquo;<dd>Search hints for the IEEE1275 platform. 
<br><dt>&lsquo;<samp><span class="samp">baremetal_hints</span></samp>&rsquo;<dd>Search hints for platforms where disks are addressed directly rather than
via firmware. 
<br><dt>&lsquo;<samp><span class="samp">efi_hints</span></samp>&rsquo;<dd>Search hints for the EFI platform. 
<br><dt>&lsquo;<samp><span class="samp">arc_hints</span></samp>&rsquo;<dd>Search hints for the ARC platform. 
<br><dt>&lsquo;<samp><span class="samp">compatibility_hint</span></samp>&rsquo;<dd>A guess at a reasonable GRUB drive name for this device, which may be
used as a fallback if the <samp><span class="command">search</span></samp> command fails. 
<br><dt>&lsquo;<samp><span class="samp">disk</span></samp>&rsquo;<dd>System device name for the whole disk. 
</dl>

     <br><dt><samp><span class="option">-v</span></samp><dt><samp><span class="option">--verbose</span></samp><dd>Print verbose messages. 
</dl>

<div class="node">
<a name="Obtaining-and-Building-GRUB"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Reporting-bugs">Reporting bugs</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Invoking-grub_002dprobe">Invoking grub2-probe</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="appendix">Appendix A How to obtain and build GRUB</h2>

<blockquote>
<strong>Caution:</strong> GRUB requires binutils-2.9.1.0.23 or later because the
GNU assembler has been changed so that it can produce real 16bits
machine code between 2.9.1 and 2.9.1.0.x. See
<a href="http://sources.redhat.com/binutils/">http://sources.redhat.com/binutils/</a>, to obtain information on
how to get the latest version. 
</blockquote>

   <p>GRUB is available from the GNU alpha archive site
<a href="ftp://ftp.gnu.org/gnu/grub">ftp://ftp.gnu.org/gnu/grub</a> or any of its mirrors. The file
will be named grub2-version.tar.gz. The current version is
2.00~beta6, so the file you should grab is:

   <p><a href="ftp://ftp.gnu.org/gnu/grub/grub-2.00~beta6.tar.gz">ftp://ftp.gnu.org/gnu/grub/grub-2.00~beta6.tar.gz</a>

   <p>To unbundle GRUB use the instruction:

<pre class="example">     <kbd>zcat grub-2.00~beta6.tar.gz | tar xvf -</kbd>
</pre>
   <p>which will create a directory called <samp><span class="file">grub-2.00~beta6</span></samp> with
all the sources. You can look at the file <samp><span class="file">INSTALL</span></samp> for detailed
instructions on how to build and install GRUB, but you should be able to
just do:

<pre class="example">     <kbd>cd grub-2.00~beta6</kbd>
     <kbd>./configure</kbd>
     <kbd>make install</kbd>
</pre>
   <p>Also, the latest version is available using Bazaar. See
<a href="http://www.gnu.org/software/grub/grub2-download.en.html">http://www.gnu.org/software/grub/grub2-download.en.html</a> for more
information.

<div class="node">
<a name="Reporting-bugs"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Future">Future</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Obtaining-and-Building-GRUB">Obtaining and Building GRUB</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="appendix">Appendix B Reporting bugs</h2>

<p>These are the guideline for how to report bugs. Take a look at this
list below before you submit bugs:

     <ol type=1 start=1>
<li>Before getting unsettled, read this manual through and through. Also,
see the <a href="http://www.gnu.org/software/grub/grub2-faq.html">GNU GRUB FAQ</a>.

     <li>Always mention the information on your GRUB. The version number and the
configuration are quite important. If you build it yourself, write the
options specified to the configure script and your operating system,
including the versions of gcc and binutils.

     <li>If you have trouble with the installation, inform us of how you
installed GRUB. Don't omit error messages, if any. Just &lsquo;<samp><span class="samp">GRUB hangs
up when it boots</span></samp>&rsquo; is not enough.

     <p>The information on your hardware is also essential. These are especially
important: the geometries and the partition tables of your hard disk
drives and your BIOS.

     <li>If GRUB cannot boot your operating system, write down
<em>everything</em> you see on the screen. Don't paraphrase them, like
&lsquo;<samp><span class="samp">The foo OS crashes with GRUB, even though it can boot with the
bar boot loader just fine</span></samp>&rsquo;. Mention the commands you executed, the
messages printed by them, and information on your operating system
including the version number.

     <li>Explain what you wanted to do. It is very useful to know your purpose
and your wish, and how GRUB didn't satisfy you.

     <li>If you can investigate the problem yourself, please do. That will give
you and us much more information on the problem. Attaching a patch is
even better.

     <p>When you attach a patch, make the patch in unified diff format, and
write ChangeLog entries. But, even when you make a patch, don't forget
to explain the problem, so that we can understand what your patch is
for.

     <li>Write down anything that you think might be related. Please understand
that we often need to reproduce the same problem you encountered in our
environment. So your information should be sufficient for us to do the
same thing&mdash;Don't forget that we cannot see your computer directly. If
you are not sure whether to state a fact or leave it out, state it! 
Reporting too many things is much better than omitting something
important.
        </ol>

   <p>If you follow the guideline above, submit a report to the
<a href="http://savannah.gnu.org/bugs/?group=grub">Bug Tracking System</a>. 
Alternatively, you can submit a report via electronic mail to
<a href="mailto:bug-grub@gnu.org">bug-grub@gnu.org</a>, but we strongly recommend that you use the
Bug Tracking System, because e-mail can be passed over easily.

   <p>Once we get your report, we will try to fix the bugs.

<div class="node">
<a name="Future"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Copying-This-Manual">Copying This Manual</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Reporting-bugs">Reporting bugs</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="appendix">Appendix C Where GRUB will go</h2>

<p>GRUB 2 is now quite stable and used in many production systems.  We are
currently working towards a 2.0 release.

   <p>If you are interested in the development of GRUB 2, take a look at
<a href="http://www.gnu.org/software/grub/grub.html">the homepage</a>.

<div class="node">
<a name="Copying-This-Manual"></a>
<p><hr>
Next:&nbsp;<a rel="next" accesskey="n" href="#Index">Index</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Future">Future</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="appendix">Appendix D Copying This Manual</h2>

<ul class="menu">
<li><a accesskey="1" href="#GNU-Free-Documentation-License">GNU Free Documentation License</a>:   License for copying this manual. 
</ul>

<div class="node">
<a name="GNU-Free-Documentation-License"></a>
<p><hr>
Up:&nbsp;<a rel="up" accesskey="u" href="#Copying-This-Manual">Copying This Manual</a>

</div>

<h3 class="appendixsec">D.1 GNU Free Documentation License</h3>

<p><a name="index-FDL_002c-GNU-Free-Documentation-License-51"></a><div align="center">Version 1.2, November 2002</div>

<pre class="display">     Copyright &copy; 2000,2001,2002 Free Software Foundation, Inc.
     51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
     
     Everyone is permitted to copy and distribute verbatim copies
     of this license document, but changing it is not allowed.
</pre>
     <ol type=1 start=0>
<li>PREAMBLE

     <p>The purpose of this License is to make a manual, textbook, or other
functional and useful document <dfn>free</dfn> in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially. 
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.

     <p>This License is a kind of &ldquo;copyleft&rdquo;, which means that derivative
works of the document must themselves be free in the same sense.  It
complements the GNU General Public License, which is a copyleft
license designed for free software.

     <p>We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does.  But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book.  We recommend this License
principally for works whose purpose is instruction or reference.

     <li>APPLICABILITY AND DEFINITIONS

     <p>This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License.  Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein.  The &ldquo;Document&rdquo;, below,
refers to any such manual or work.  Any member of the public is a
licensee, and is addressed as &ldquo;you&rdquo;.  You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.

     <p>A &ldquo;Modified Version&rdquo; of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.

     <p>A &ldquo;Secondary Section&rdquo; is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject.  (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.)  The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.

     <p>The &ldquo;Invariant Sections&rdquo; are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.  If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant.  The Document may contain zero
Invariant Sections.  If the Document does not identify any Invariant
Sections then there are none.

     <p>The &ldquo;Cover Texts&rdquo; are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.  A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.

     <p>A &ldquo;Transparent&rdquo; copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters.  A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent. 
An image format is not Transparent if used for any substantial amount
of text.  A copy that is not &ldquo;Transparent&rdquo; is called &ldquo;Opaque&rdquo;.

     <p>Examples of suitable formats for Transparent copies include plain
<span class="sc">ascii</span> without markup, Texinfo input format, LaTeX input
format, <acronym>SGML</acronym> or <acronym>XML</acronym> using a publicly available
<acronym>DTD</acronym>, and standard-conforming simple <acronym>HTML</acronym>,
PostScript or <acronym>PDF</acronym> designed for human modification.  Examples
of transparent image formats include <acronym>PNG</acronym>, <acronym>XCF</acronym> and
<acronym>JPG</acronym>.  Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, <acronym>SGML</acronym> or
<acronym>XML</acronym> for which the <acronym>DTD</acronym> and/or processing tools are
not generally available, and the machine-generated <acronym>HTML</acronym>,
PostScript or <acronym>PDF</acronym> produced by some word processors for
output purposes only.

     <p>The &ldquo;Title Page&rdquo; means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page.  For works in
formats which do not have any title page as such, &ldquo;Title Page&rdquo; means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.

     <p>A section &ldquo;Entitled XYZ&rdquo; means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language.  (Here XYZ stands for a
specific section name mentioned below, such as &ldquo;Acknowledgements&rdquo;,
&ldquo;Dedications&rdquo;, &ldquo;Endorsements&rdquo;, or &ldquo;History&rdquo;.)  To &ldquo;Preserve the Title&rdquo;
of such a section when you modify the Document means that it remains a
section &ldquo;Entitled XYZ&rdquo; according to this definition.

     <p>The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document.  These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.

     <li>VERBATIM COPYING

     <p>You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License.  You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute.  However, you may accept
compensation in exchange for copies.  If you distribute a large enough
number of copies you must also follow the conditions in section 3.

     <p>You may also lend copies, under the same conditions stated above, and
you may publicly display copies.

     <li>COPYING IN QUANTITY

     <p>If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover.  Both covers must also clearly and legibly identify
you as the publisher of these copies.  The front cover must present
the full title with all words of the title equally prominent and
visible.  You may add other material on the covers in addition. 
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.

     <p>If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.

     <p>If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material. 
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.

     <p>It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.

     <li>MODIFICATIONS

     <p>You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it.  In addition, you must do these things in the Modified Version:

          <ol type=A start=1>
<li>Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document).  You may use the same title as a previous version
if the original publisher of that version gives permission.

          <li>List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.

          <li>State on the Title page the name of the publisher of the
Modified Version, as the publisher.

          <li>Preserve all the copyright notices of the Document.

          <li>Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.

          <li>Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.

          <li>Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.

          <li>Include an unaltered copy of this License.

          <li>Preserve the section Entitled &ldquo;History&rdquo;, Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page.  If
there is no section Entitled &ldquo;History&rdquo; in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.

          <li>Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on.  These may be placed in the &ldquo;History&rdquo; section. 
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.

          <li>For any section Entitled &ldquo;Acknowledgements&rdquo; or &ldquo;Dedications&rdquo;, Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.

          <li>Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles.  Section numbers
or the equivalent are not considered part of the section titles.

          <li>Delete any section Entitled &ldquo;Endorsements&rdquo;.  Such a section
may not be included in the Modified Version.

          <li>Do not retitle any existing section to be Entitled &ldquo;Endorsements&rdquo; or
to conflict in title with any Invariant Section.

          <li>Preserve any Warranty Disclaimers.
          </ol>

     <p>If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant.  To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice. 
These titles must be distinct from any other section titles.

     <p>You may add a section Entitled &ldquo;Endorsements&rdquo;, provided it contains
nothing but endorsements of your Modified Version by various
parties&mdash;for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.

     <p>You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version.  Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity.  If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.

     <p>The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.

     <li>COMBINING DOCUMENTS

     <p>You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.

     <p>The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy.  If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number. 
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.

     <p>In the combination, you must combine any sections Entitled &ldquo;History&rdquo;
in the various original documents, forming one section Entitled
&ldquo;History&rdquo;; likewise combine any sections Entitled &ldquo;Acknowledgements&rdquo;,
and any sections Entitled &ldquo;Dedications&rdquo;.  You must delete all
sections Entitled &ldquo;Endorsements.&rdquo;

     <li>COLLECTIONS OF DOCUMENTS

     <p>You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.

     <p>You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.

     <li>AGGREGATION WITH INDEPENDENT WORKS

     <p>A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an &ldquo;aggregate&rdquo; if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit. 
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.

     <p>If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form. 
Otherwise they must appear on printed covers that bracket the whole
aggregate.

     <li>TRANSLATION

     <p>Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4. 
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections.  You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers.  In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.

     <p>If a section in the Document is Entitled &ldquo;Acknowledgements&rdquo;,
&ldquo;Dedications&rdquo;, or &ldquo;History&rdquo;, the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.

     <li>TERMINATION

     <p>You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License.  Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License.  However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.

     <li>FUTURE REVISIONS OF THIS LICENSE

     <p>The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time.  Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.  See
<a href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>.

     <p>Each version of the License is given a distinguishing version number. 
If the Document specifies that a particular numbered version of this
License &ldquo;or any later version&rdquo; applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation.  If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
        </ol>

<h4 class="appendixsubsec">D.1.1 ADDENDUM: How to use this License for your documents</h4>

<p>To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:

<pre class="smallexample">       Copyright (C)  <var>year</var>  <var>your name</var>.
       Permission is granted to copy, distribute and/or modify this document
       under the terms of the GNU Free Documentation License, Version 1.2
       or any later version published by the Free Software Foundation;
       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
       Texts.  A copy of the license is included in the section entitled ``GNU
       Free Documentation License''.
</pre>
   <p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the &ldquo;with...Texts.&rdquo; line with this:

<pre class="smallexample">         with the Invariant Sections being <var>list their titles</var>, with
         the Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts
         being <var>list</var>.
</pre>
   <p>If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.

   <p>If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

<!-- Local Variables: -->
<!-- ispell-local-pdict: "ispell-dict" -->
<!-- End: -->
<div class="node">
<a name="Index"></a>
<p><hr>
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Copying-This-Manual">Copying This Manual</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>

</div>

<h2 class="unnumbered">Index</h2>

<!-- Currently, we use only the Concept Index. -->
<ul class="index-cp" compact>
<li><a href="#index-acpi-7"><code>acpi</code></a>: <a href="#acpi">acpi</a></li>
<li><a href="#index-badram-8"><code>badram</code></a>: <a href="#badram">badram</a></li>
<li><a href="#index-blocklist-9"><code>blocklist</code></a>: <a href="#blocklist">blocklist</a></li>
<li><a href="#index-boot-10"><code>boot</code></a>: <a href="#boot">boot</a></li>
<li><a href="#index-cat-11"><code>cat</code></a>: <a href="#cat">cat</a></li>
<li><a href="#index-chainloader-12"><code>chainloader</code></a>: <a href="#chainloader">chainloader</a></li>
<li><a href="#index-cmp-13"><code>cmp</code></a>: <a href="#cmp">cmp</a></li>
<li><a href="#index-configfile-14"><code>configfile</code></a>: <a href="#configfile">configfile</a></li>
<li><a href="#index-cpuid-15"><code>cpuid</code></a>: <a href="#cpuid">cpuid</a></li>
<li><a href="#index-crc-16"><code>crc</code></a>: <a href="#crc">crc</a></li>
<li><a href="#index-date-17"><code>date</code></a>: <a href="#date">date</a></li>
<li><a href="#index-drivemap-18"><code>drivemap</code></a>: <a href="#drivemap">drivemap</a></li>
<li><a href="#index-echo-19"><code>echo</code></a>: <a href="#echo">echo</a></li>
<li><a href="#index-export-20"><code>export</code></a>: <a href="#export">export</a></li>
<li><a href="#index-false-21"><code>false</code></a>: <a href="#false">false</a></li>
<li><a href="#index-FDL_002c-GNU-Free-Documentation-License-51">FDL, GNU Free Documentation License</a>: <a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></li>
<li><a href="#index-gettext-22"><code>gettext</code></a>: <a href="#gettext">gettext</a></li>
<li><a href="#index-gptsync-23"><code>gptsync</code></a>: <a href="#gptsync">gptsync</a></li>
<li><a href="#index-halt-24"><code>halt</code></a>: <a href="#halt">halt</a></li>
<li><a href="#index-help-25"><code>help</code></a>: <a href="#help">help</a></li>
<li><a href="#index-initrd-26"><code>initrd</code></a>: <a href="#initrd">initrd</a></li>
<li><a href="#index-initrd16-27"><code>initrd16</code></a>: <a href="#initrd16">initrd16</a></li>
<li><a href="#index-insmod-28"><code>insmod</code></a>: <a href="#insmod">insmod</a></li>
<li><a href="#index-keystatus-29"><code>keystatus</code></a>: <a href="#keystatus">keystatus</a></li>
<li><a href="#index-linux-30"><code>linux</code></a>: <a href="#linux">linux</a></li>
<li><a href="#index-linux16-31"><code>linux16</code></a>: <a href="#linux16">linux16</a></li>
<li><a href="#index-list_005fenv-32"><code>list_env</code></a>: <a href="#list_005fenv">list_env</a></li>
<li><a href="#index-load_005fenv-33"><code>load_env</code></a>: <a href="#load_005fenv">load_env</a></li>
<li><a href="#index-loopback-34"><code>loopback</code></a>: <a href="#loopback">loopback</a></li>
<li><a href="#index-ls-35"><code>ls</code></a>: <a href="#ls">ls</a></li>
<li><a href="#index-menuentry-1"><code>menuentry</code></a>: <a href="#menuentry">menuentry</a></li>
<li><a href="#index-normal-36"><code>normal</code></a>: <a href="#normal">normal</a></li>
<li><a href="#index-normal_005fexit-37"><code>normal_exit</code></a>: <a href="#normal_005fexit">normal_exit</a></li>
<li><a href="#index-parttool-38"><code>parttool</code></a>: <a href="#parttool">parttool</a></li>
<li><a href="#index-password-39"><code>password</code></a>: <a href="#password">password</a></li>
<li><a href="#index-password_005fpbkdf2-40"><code>password_pbkdf2</code></a>: <a href="#password_005fpbkdf2">password_pbkdf2</a></li>
<li><a href="#index-play-41"><code>play</code></a>: <a href="#play">play</a></li>
<li><a href="#index-pxe_005funload-42"><code>pxe_unload</code></a>: <a href="#pxe_005funload">pxe_unload</a></li>
<li><a href="#index-read-43"><code>read</code></a>: <a href="#read">read</a></li>
<li><a href="#index-reboot-44"><code>reboot</code></a>: <a href="#reboot">reboot</a></li>
<li><a href="#index-save_005fenv-45"><code>save_env</code></a>: <a href="#save_005fenv">save_env</a></li>
<li><a href="#index-search-46"><code>search</code></a>: <a href="#search">search</a></li>
<li><a href="#index-sendkey-47"><code>sendkey</code></a>: <a href="#sendkey">sendkey</a></li>
<li><a href="#index-serial-3"><code>serial</code></a>: <a href="#serial">serial</a></li>
<li><a href="#index-set-48"><code>set</code></a>: <a href="#set">set</a></li>
<li><a href="#index-submenu-2"><code>submenu</code></a>: <a href="#submenu">submenu</a></li>
<li><a href="#index-terminal_005finput-4"><code>terminal_input</code></a>: <a href="#terminal_005finput">terminal_input</a></li>
<li><a href="#index-terminal_005foutput-5"><code>terminal_output</code></a>: <a href="#terminal_005foutput">terminal_output</a></li>
<li><a href="#index-terminfo-6"><code>terminfo</code></a>: <a href="#terminfo">terminfo</a></li>
<li><a href="#index-true-49"><code>true</code></a>: <a href="#true">true</a></li>
<li><a href="#index-unset-50"><code>unset</code></a>: <a href="#unset">unset</a></li>
   </ul><div class="footnote">
<hr>
<a name="texinfo-footnotes-in-document"></a><h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small> <dfn>chain-load</dfn> is the mechanism for loading
unsupported operating systems by loading another boot loader. It is
typically used for loading DOS or Windows.</p>

   <p class="footnote"><small>[<a name="fn-2" href="#fnd-2">2</a>]</small> Only CRC32 data integrity check is supported (xz default
is CRC64 so one should use &ndash;check=crc32 option). LZMA BCJ filters are
supported.</p>

   <p class="footnote"><small>[<a name="fn-3" href="#fnd-3">3</a>]</small> There are a few
pathological cases where loading a very badly organized ELF kernel might
take longer, but in practice this never happen.</p>

   <p class="footnote"><small>[<a name="fn-4" href="#fnd-4">4</a>]</small> The LInux LOader,
a boot loader that everybody uses, but nobody likes.</p>

   <p class="footnote"><small>[<a name="fn-5" href="#fnd-5">5</a>]</small> El Torito is a specification for bootable CD
using BIOS functions.</p>

   <p class="footnote"><small>[<a name="fn-6" href="#fnd-6">6</a>]</small> Currently a
backslash-newline pair within a variable name is not handled properly, so
use this feature with some care.</p>

   <p class="footnote"><small>[<a name="fn-7" href="#fnd-7">7</a>]</small> However, this
behavior will be changed in the future version, in a user-invisible
way.</p>

   <hr></div>

</body></html>