[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grub-bug
Subject:    Booting Windows XP
From:       pballest () aaa ! com ! co
Date:       2001-11-29 19:59:10
Message-ID: OF36133005.B3C1AAA1-ON05256B13.0068A3C7 () aaa ! com ! co
[Download RAW message or body]

Go to

http://www.gnu.org/manual/grub-0.90/html_mono/grub.html

That file you'll find it attatched here...(See attached file: grub.html)

This is the official manual to Grub....

Nicolas Solano
["grub.html" (text/html)]

<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.54
     from ../texi/grub.texi on 15 October 2001 -->

<TITLE>GRUB Manual</TITLE>

</HEAD>
<BODY>
<H1>the GRUB manual</H1>
<H2>The GRand Unified Bootloader, version 0.90, 5 July 2001.</H2>
<ADDRESS>Gordon Matzigkeit</ADDRESS>
<ADDRESS>OKUJI Yoshinori</ADDRESS>
<P>
<P><HR><P>
<H1>Table of Contents</H1>
<UL>
<LI><A NAME="TOC1" HREF="grub.html#SEC1">Introduction to GRUB</A>
<UL>
<LI><A NAME="TOC2" HREF="grub.html#SEC2">Overview</A>
<LI><A NAME="TOC3" HREF="grub.html#SEC3">History of GRUB</A>
<LI><A NAME="TOC4" HREF="grub.html#SEC4">GRUB features</A>
<LI><A NAME="TOC5" HREF="grub.html#SEC5">The role of a boot loader</A>
</UL>
<LI><A NAME="TOC6" HREF="grub.html#SEC6">Naming convention</A>
<LI><A NAME="TOC7" HREF="grub.html#SEC7">Installation</A>
<UL>
<LI><A NAME="TOC8" HREF="grub.html#SEC8">Creating a GRUB boot floppy</A>
<LI><A NAME="TOC9" HREF="grub.html#SEC9">Installing GRUB natively</A>
<LI><A NAME="TOC10" HREF="grub.html#SEC10">Installing GRUB using grub-install</A>
</UL>
<LI><A NAME="TOC11" HREF="grub.html#SEC11">Booting</A>
<UL>
<LI><A NAME="TOC12" HREF="grub.html#SEC12">How to boot operating systems</A>
<UL>
<LI><A NAME="TOC13" HREF="grub.html#SEC13">How to boot an OS directly with GRUB</A>
<LI><A NAME="TOC14" HREF="grub.html#SEC14">Load another boot loader to boot \
unsupported operating systems</A> </UL>
<LI><A NAME="TOC15" HREF="grub.html#SEC15">Some caveats on OS-specific issues</A>
<UL>
<LI><A NAME="TOC16" HREF="grub.html#SEC16">GNU/Hurd</A>
<LI><A NAME="TOC17" HREF="grub.html#SEC17">GNU/Linux</A>
<LI><A NAME="TOC18" HREF="grub.html#SEC18">FreeBSD</A>
<LI><A NAME="TOC19" HREF="grub.html#SEC19">NetBSD</A>
<LI><A NAME="TOC20" HREF="grub.html#SEC20">OpenBSD</A>
<LI><A NAME="TOC21" HREF="grub.html#SEC21">DOS/Windows</A>
<LI><A NAME="TOC22" HREF="grub.html#SEC22">SCO UnixWare</A>
</UL>
</UL>
<LI><A NAME="TOC23" HREF="grub.html#SEC23">Configuration</A>
<LI><A NAME="TOC24" HREF="grub.html#SEC24">Downloading OS images from a network</A>
<UL>
<LI><A NAME="TOC25" HREF="grub.html#SEC25">How to set up your network</A>
<LI><A NAME="TOC26" HREF="grub.html#SEC26">Booting from a network</A>
</UL>
<LI><A NAME="TOC27" HREF="grub.html#SEC27">Using GRUB via a serial line</A>
<LI><A NAME="TOC28" HREF="grub.html#SEC28">Protecting your computer from cracking</A>
<LI><A NAME="TOC29" HREF="grub.html#SEC29">GRUB image files</A>
<LI><A NAME="TOC30" HREF="grub.html#SEC30">Filesystem syntax and semantics</A>
<UL>
<LI><A NAME="TOC31" HREF="grub.html#SEC31">How to specify devices</A>
<LI><A NAME="TOC32" HREF="grub.html#SEC32">How to specify files</A>
<LI><A NAME="TOC33" HREF="grub.html#SEC33">How to specify block lists</A>
</UL>
<LI><A NAME="TOC34" HREF="grub.html#SEC34">GRUB's user interface</A>
<UL>
<LI><A NAME="TOC35" HREF="grub.html#SEC35">The flexible command-line interface</A>
<LI><A NAME="TOC36" HREF="grub.html#SEC36">The simple menu interface</A>
<LI><A NAME="TOC37" HREF="grub.html#SEC37">Editing a menu entry</A>
<LI><A NAME="TOC38" HREF="grub.html#SEC38">The hidden menu interface</A>
</UL>
<LI><A NAME="TOC39" HREF="grub.html#SEC39">The list of available commands</A>
<UL>
<LI><A NAME="TOC40" HREF="grub.html#SEC40">The list of commands for the menu only</A>
<UL>
<LI><A NAME="TOC41" HREF="grub.html#SEC41">default</A>
<LI><A NAME="TOC42" HREF="grub.html#SEC42">fallback</A>
<LI><A NAME="TOC43" HREF="grub.html#SEC43">hiddenmenu</A>
<LI><A NAME="TOC44" HREF="grub.html#SEC44">timeout</A>
<LI><A NAME="TOC45" HREF="grub.html#SEC45">title</A>
</UL>
<LI><A NAME="TOC46" HREF="grub.html#SEC46">The list of general commands</A>
<UL>
<LI><A NAME="TOC47" HREF="grub.html#SEC47">bootp</A>
<LI><A NAME="TOC48" HREF="grub.html#SEC48">color</A>
<LI><A NAME="TOC49" HREF="grub.html#SEC49">device</A>
<LI><A NAME="TOC50" HREF="grub.html#SEC50">dhcp</A>
<LI><A NAME="TOC51" HREF="grub.html#SEC51">hide</A>
<LI><A NAME="TOC52" HREF="grub.html#SEC52">ifconfig</A>
<LI><A NAME="TOC53" HREF="grub.html#SEC53">partnew</A>
<LI><A NAME="TOC54" HREF="grub.html#SEC54">parttype</A>
<LI><A NAME="TOC55" HREF="grub.html#SEC55">password</A>
<LI><A NAME="TOC56" HREF="grub.html#SEC56">rarp</A>
<LI><A NAME="TOC57" HREF="grub.html#SEC57">serial</A>
<LI><A NAME="TOC58" HREF="grub.html#SEC58">setkey</A>
<LI><A NAME="TOC59" HREF="grub.html#SEC59">terminal</A>
<LI><A NAME="TOC60" HREF="grub.html#SEC60">tftpserver</A>
<LI><A NAME="TOC61" HREF="grub.html#SEC61">unhide</A>
</UL>
<LI><A NAME="TOC62" HREF="grub.html#SEC62">The list of command-line and menu entry \
commands</A> <UL>
<LI><A NAME="TOC63" HREF="grub.html#SEC63">blocklist</A>
<LI><A NAME="TOC64" HREF="grub.html#SEC64">boot</A>
<LI><A NAME="TOC65" HREF="grub.html#SEC65">cat</A>
<LI><A NAME="TOC66" HREF="grub.html#SEC66">chainloader</A>
<LI><A NAME="TOC67" HREF="grub.html#SEC67">cmp</A>
<LI><A NAME="TOC68" HREF="grub.html#SEC68">configfile</A>
<LI><A NAME="TOC69" HREF="grub.html#SEC69">debug</A>
<LI><A NAME="TOC70" HREF="grub.html#SEC70">displayapm</A>
<LI><A NAME="TOC71" HREF="grub.html#SEC71">displaymem</A>
<LI><A NAME="TOC72" HREF="grub.html#SEC72">embed</A>
<LI><A NAME="TOC73" HREF="grub.html#SEC73">find</A>
<LI><A NAME="TOC74" HREF="grub.html#SEC74">fstest</A>
<LI><A NAME="TOC75" HREF="grub.html#SEC75">geometry</A>
<LI><A NAME="TOC76" HREF="grub.html#SEC76">halt</A>
<LI><A NAME="TOC77" HREF="grub.html#SEC77">help</A>
<LI><A NAME="TOC78" HREF="grub.html#SEC78">impsprobe</A>
<LI><A NAME="TOC79" HREF="grub.html#SEC79">initrd</A>
<LI><A NAME="TOC80" HREF="grub.html#SEC80">install</A>
<LI><A NAME="TOC81" HREF="grub.html#SEC81">ioprobe</A>
<LI><A NAME="TOC82" HREF="grub.html#SEC82">kernel</A>
<LI><A NAME="TOC83" HREF="grub.html#SEC83">lock</A>
<LI><A NAME="TOC84" HREF="grub.html#SEC84">makeactive</A>
<LI><A NAME="TOC85" HREF="grub.html#SEC85">map</A>
<LI><A NAME="TOC86" HREF="grub.html#SEC86">md5crypt</A>
<LI><A NAME="TOC87" HREF="grub.html#SEC87">module</A>
<LI><A NAME="TOC88" HREF="grub.html#SEC88">modulenounzip</A>
<LI><A NAME="TOC89" HREF="grub.html#SEC89">pause</A>
<LI><A NAME="TOC90" HREF="grub.html#SEC90">quit</A>
<LI><A NAME="TOC91" HREF="grub.html#SEC91">reboot</A>
<LI><A NAME="TOC92" HREF="grub.html#SEC92">read</A>
<LI><A NAME="TOC93" HREF="grub.html#SEC93">root</A>
<LI><A NAME="TOC94" HREF="grub.html#SEC94">rootnoverify</A>
<LI><A NAME="TOC95" HREF="grub.html#SEC95">savedefault</A>
<LI><A NAME="TOC96" HREF="grub.html#SEC96">setup</A>
<LI><A NAME="TOC97" HREF="grub.html#SEC97">testload</A>
<LI><A NAME="TOC98" HREF="grub.html#SEC98">testvbe</A>
<LI><A NAME="TOC99" HREF="grub.html#SEC99">uppermem</A>
<LI><A NAME="TOC100" HREF="grub.html#SEC100">vbeprobe</A>
</UL>
</UL>
<LI><A NAME="TOC101" HREF="grub.html#SEC101">Error messages reported by GRUB</A>
<UL>
<LI><A NAME="TOC102" HREF="grub.html#SEC102">Errors reported by the Stage 1</A>
<LI><A NAME="TOC103" HREF="grub.html#SEC103">Errors reported by the Stage 1.5</A>
<LI><A NAME="TOC104" HREF="grub.html#SEC104">Errors reported by the Stage 2</A>
</UL>
<LI><A NAME="TOC105" HREF="grub.html#SEC105">Invoking the grub shell</A>
<UL>
<LI><A NAME="TOC106" HREF="grub.html#SEC106">Introduction into the grub shell</A>
<LI><A NAME="TOC107" HREF="grub.html#SEC107">How to install GRUB via \
@command{grub}</A> <LI><A NAME="TOC108" HREF="grub.html#SEC108">The map between BIOS \
drives and OS devices</A> </UL>
<LI><A NAME="TOC109" HREF="grub.html#SEC109">Invoking grub-install</A>
<LI><A NAME="TOC110" HREF="grub.html#SEC110">Invoking grub-md5-crypt</A>
<LI><A NAME="TOC111" HREF="grub.html#SEC111">Invoking mbchk</A>
<LI><A NAME="TOC112" HREF="grub.html#SEC112">Frequently asked questions</A>
<LI><A NAME="TOC113" HREF="grub.html#SEC113">How to obtain and build GRUB</A>
<LI><A NAME="TOC114" HREF="grub.html#SEC114">Reporting bugs</A>
<LI><A NAME="TOC115" HREF="grub.html#SEC115">Where GRUB will go</A>
<LI><A NAME="TOC116" HREF="grub.html#SEC116">Hacking GRUB</A>
<UL>
<LI><A NAME="TOC117" HREF="grub.html#SEC117">The memory map of various components</A>
<LI><A NAME="TOC118" HREF="grub.html#SEC118">Embedded variables in GRUB</A>
<LI><A NAME="TOC119" HREF="grub.html#SEC119">The generic interface for \
filesystems</A> <LI><A NAME="TOC120" HREF="grub.html#SEC120">The generic interface \
for built-ins</A> <LI><A NAME="TOC121" HREF="grub.html#SEC121">The bootstrap \
mechanism used in GRUB</A> <LI><A NAME="TOC122" HREF="grub.html#SEC122">How to probe \
I/O ports used by INT 13H</A> <LI><A NAME="TOC123" HREF="grub.html#SEC123">How to \
detect all installed RAM</A> <LI><A NAME="TOC124" HREF="grub.html#SEC124">INT 13H \
disk I/O interrupts</A> <LI><A NAME="TOC125" HREF="grub.html#SEC125">The structure of \
Master Boot Record</A> <LI><A NAME="TOC126" HREF="grub.html#SEC126">The format of \
partition tables</A> <LI><A NAME="TOC127" HREF="grub.html#SEC127">Where and how you \
should send patches</A> </UL>
<LI><A NAME="TOC128" HREF="grub.html#SEC128">Index</A>
</UL>
<P><HR><P>


<H1><A NAME="SEC1" HREF="grub.html#TOC1">Introduction to GRUB</A></H1>



<H2><A NAME="SEC2" HREF="grub.html#TOC2">Overview</A></H2>

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

</P>
<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 NAME="DOCF1" HREF="grub.html#FOOT1">(1)</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>
<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.

</P>
<P>
Thus you can load the kernel just by specifying its file name and the
drive (and the partition) where the kernel resides. To let GRUB know the
drive and the file name, you can either type in them manually via the
command-line interface (see section <A HREF="grub.html#SEC35">The flexible \
command-line interface</A>), or use the nice menu interface (see section <A \
HREF="grub.html#SEC36">The simple menu interface</A>) through which you can easily \
select which OS it boots. To allow you to customize the menu, GRUB will load a \
preexisting configuration file (see section <A \
HREF="grub.html#SEC23">Configuration</A>). Note that you can not only enter the \
command-line interface whenever you like, but also you can edit specific menu entries \
prior to using them.

</P>
<P>
In the following chapters, you will learn how to specify a drive or a
partition, and a file name (see section <A HREF="grub.html#SEC6">Naming \
convention</A>) to GRUB, how to install GRUB on your drive (see section <A \
HREF="grub.html#SEC7">Installation</A>), and how to boot your OSes (see section <A \
HREF="grub.html#SEC11">Booting</A>), step by step.

</P>



<H2><A NAME="SEC3" HREF="grub.html#TOC3">History of GRUB</A></H2>

<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 section `Motivation' in <CITE>The Multiboot Specification</CITE>), because they \
were determined not to add to the large number of mutually-incompatible PC boot \
methods.

</P>
<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>
<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 OKUJI Yoshinori adopted GRUB as an official
GNU package, and opened its development by making the latest sources
available via anonymous CVS. See section <A HREF="grub.html#SEC113">How to obtain and \
build GRUB</A>, for more information.

</P>



<H2><A NAME="SEC4" HREF="grub.html#TOC4">GRUB features</A></H2>

<P>
The primary requirement for GRUB is that it be compliant with the
<STRONG>Multiboot Specification</STRONG>, which is described in section `Motivation' \
in <CITE>The Multiboot Specification</CITE>.

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

</P>

<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
<STRONG>piggyback</STRONG> 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>
<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):

</P>
<DL COMPACT>

<DT>Recognize multiple executable formats
<DD>
Support many of the <STRONG>a.out</STRONG> variants plus <STRONG>ELF</STRONG>. Symbol
tables are also loaded.

<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.

<DT>Load multiples modules
<DD>
Fully support the Multiboot feature of loading multiple modules.

<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 section <A HREF="grub.html#SEC39">The list of available commands</A>) \
are a superset of those supported on the command-line. An example configuration file \
is provided in section <A HREF="grub.html#SEC23">Configuration</A>.

<DT>Provide a menu interface
<DD>
A menu interface listing the 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.

<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.

The list of commands (see section <A HREF="grub.html#SEC39">The list of available \
commands</A>) are a subset of those supported for configuration files. Editing \
commands closely resembles the Bash command-line (see section `Command Line Editing' \
in <CITE>Bash Features</CITE>), with <KBD>TAB</KBD>-completion of commands, devices, \
partitions, and files in a directory depending on context.

<DT>Support multiple filesystem types
<DD>
Support multiple filesystem types transparently, plus a useful explicit
blocklist notation. The currently supported filesystem types are
<STRONG>BSD FFS</STRONG>, <STRONG>DOS FAT16 and FAT32</STRONG>, <STRONG>Minix \
fs</STRONG>, <STRONG>Linux ext2fs</STRONG>, <STRONG>ReiserFS</STRONG>, and \
<STRONG>VSTa fs</STRONG>. See section <A HREF="grub.html#SEC30">Filesystem syntax and \
semantics</A>, for more information.

<DT>Support automatic decompression
<DD>
Can decompress files which were compressed by @command{gzip}. 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 the loading time, a
particularly major benefit for floppies.<A NAME="DOCF2" \
HREF="grub.html#FOOT2">(2)</A>

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.

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

<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.

<DT>Detect all installed RAM
<DD>
GRUB can generally find all the installed RAM on a PC-compatible
machine. It uses an advanced BIOS query technique for finding all
memory regions. As described on the Multiboot Specification (see section `Motivation' \
in <CITE>The Multiboot Specification</CITE>), not all kernels make use of this \
information, but GRUB provides it for those who do.

<DT>Support Logical Block Address mode
<DD>
In traditional disk calls (called <STRONG>CHS mode</STRONG>), 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 (<STRONG>LBA</STRONG>) mode. GRUB
automatically detects if LBA mode is available and uses it if
available. In LBA mode, GRUB can access the entire disk.

<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 <STRONG>TFTP</STRONG>
protocol.

<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>



<H2><A NAME="SEC5" HREF="grub.html#TOC5">The role of a boot loader</A></H2>

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

</P>

<BLOCKQUOTE>
<P>
Some people like to acknowledge both the operating system and kernel when
they talk about their computers, so they might say they use
"GNU/Linux" or "GNU/Hurd".  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 "Linux systems."

</P>
<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 "LILO"<A NAME="DOCF3" \
HREF="grub.html#FOOT3">(3)</A> or "GRUB" systems.

</P>
<P>
Unfortunately, nobody ever understood what I was talking about; now I
just use the word "GNU" as a pseudonym for GRUB.

</P>
<P>
So, if you ever hear people talking about their alleged "GNU" systems,
remember that they are actually paying homage to the best boot loader
around... 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.

</P>



<H1><A NAME="SEC6" HREF="grub.html#TOC6">Naming convention</A></H1>

<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>
<P>
Look at the following examples and explanations:

</P>

<PRE>
(fd0)
</PRE>

<P>
First of all, GRUB requires that the device name is enclosed with
<SAMP>`('</SAMP> and <SAMP>`)'</SAMP>. The <SAMP>`fd'</SAMP> part means that it is a \
floppy disk. The number <SAMP>`0'</SAMP> is the drive number, which is counted from
<EM>zero</EM>. This expression means that GRUB will use the whole floppy
disk.

</P>

<PRE>
(hd0,1)
</PRE>

<P>
Here, <SAMP>`hd'</SAMP> means it is a hard disk drive. The first integer
<SAMP>`0'</SAMP> indicates the drive number, that is, the first hard disk, while
the second integer, <SAMP>`1'</SAMP>, indicates the partition number (or the
PC slice number in the BSD terminology). Once again, please note
that the partition numbers are counted from <EM>zero</EM>, not from
one. 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.

</P>

<PRE>
(hd0,4)
</PRE>

<P>
This specifies the first <STRONG>extended partition</STRONG> of the first hard disk
drive. Note that the partition numbers for extended partitions are
counted from <SAMP>`4'</SAMP>, regardless of the actual number of primary
partitions on your hard disk.

</P>

<PRE>
(hd1,a)
</PRE>

<P>
This means the BSD <SAMP>`a'</SAMP> partition of the second hard disk. If you
need to specify which PC slice number should be used, use something
like this: <SAMP>`(hd1,0,a)'</SAMP>. If the PC slice number is omitted,
GRUB searches for the first PC slice which has a BSD <SAMP>`a'</SAMP>
partition.

</P>
<P>
Of course, to actually access the disks or partitions with GRUB, you
need to use the device specification in a command, like <SAMP>`root
(fd0)'</SAMP> or <SAMP>`unhide (hd0,2)'</SAMP>. To help you find out which number is \
a partition you want, the GRUB command-line (see section <A \
HREF="grub.html#SEC35">The flexible command-line interface</A>) options have argument \
completion. That means that, for example, you only need to type <SAMP>`root \
('</SAMP>, followed by a <KBD>TAB</KBD>, 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>
<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>
<P>
Now the question is, how to specify a file? Again, see this example:

</P>

<PRE>
(hd0,0)/vmlinuz
</PRE>

<P>
This specifies the file named <SAMP>`vmlinuz'</SAMP>, found on the first
partition of the first hard disk drive. Note that the argument
completion works with file names, too.

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

</P>



<H1><A NAME="SEC7" HREF="grub.html#TOC7">Installation</A></H1>

<P>
First, you need to have GRUB itself properly installed on your system,
(see section <A HREF="grub.html#SEC113">How to obtain and build GRUB</A>) either from \
the source tarball, or as a package for your OS.

</P>
<P>
To use GRUB, you need to install it on your drive. There are two ways of
doing that - either using the utility @command{grub-install}
(see section <A HREF="grub.html#SEC109">Invoking grub-install</A>) on a UNIX-like OS, \
or by using the native Stage 2. These are quite similar, however, the utility might
probe a wrong BIOS drive, so better be careful.

</P>
<P>
Also, if you install GRUB on a UNIX-like OS, please make sure that you
have an emergency boot disk ready, so that you can rescue your computer
if, by any chance, your hard drive becomes unusable (unbootable).

</P>
<P>
GRUB comes with boot images, which are normally installed in the
directory <TT>`/usr/share/grub/i386-pc'</TT>. You need to copy the files
<TT>`stage1'</TT>, <TT>`stage2'</TT>, and <TT>`*stage1_5'</TT> to the directory
<TT>`/boot/grub'</TT>. Here the directory where GRUB images are installed
and the directory where GRUB will use to find them are called <STRONG>image
directory</STRONG> and <STRONG>boot directory</STRONG>, respectively.

</P>



<H2><A NAME="SEC8" HREF="grub.html#TOC8">Creating a GRUB boot floppy</A></H2>

<P>
To create a GRUB boot floppy, you need to take the files <TT>`stage1'</TT>
and <TT>`stage2'</TT> from the image directory, and write them to the first
and the second block of the floppy disk, respectively.

</P>
<P>
<STRONG>Caution:</STRONG> This procedure will destroy any data currently stored
on the floppy.

</P>
<P>
On a UNIX-like operating system, that is done with the following
commands:

</P>

<PRE>
# <KBD>cd /usr/share/grub/i386-pc</KBD>
# <KBD>dd if=stage1 of=/dev/fd0 bs=512 count=1</KBD>
1+0 records in
1+0 records out
# <KBD>dd if=stage2 of=/dev/fd0 bs=512 seek=1</KBD>
153+1 records in
153+1 records out
#
</PRE>

<P>
The device file name may be different. Consult the manual for your OS.

</P>



<H2><A NAME="SEC9" HREF="grub.html#TOC9">Installing GRUB natively</A></H2>

<P>
<STRONG>Caution:</STRONG> Installing GRUB's stage1 in this manner will erase the
normal boot-sector used by an OS.

</P>
<P>
GRUB can currently boot GNU Mach, Linux, FreeBSD, NetBSD, and OpenBSD
directly, so using it on a boot sector should be okay. But generally, it
would be a good idea to back up the first sector of the partition on
which you are installing GRUB's stage1. This isn't as important if you
are installing GRUB on the first sector of a hard disk, since it's easy
to reinitialize it (e.g. by running <SAMP>`FDISK /MBR'</SAMP> from DOS).

</P>
<P>
If you decide to install GRUB in the native environment, which is
definitely desirable, you'll need to create the GRUB boot disk, and
reboot your computer with it. Otherwise, see section <A \
HREF="grub.html#SEC10">Installing GRUB using grub-install</A>, for more details.

</P>
<P>
Once started, GRUB will show the command-line interface
(see section <A HREF="grub.html#SEC35">The flexible command-line interface</A>). \
First, set the GRUB's <STRONG>root device</STRONG><A NAME="DOCF4" \
HREF="grub.html#FOOT4">(4)</A>.} to the boot directory, like this:

</P>

<PRE>
grub&#62; <KBD>root (hd0,0)</KBD>
</PRE>

<P>
If you are not sure which partition actually holds these files, use the
command @command{find} (see section <A HREF="grub.html#SEC73">find</A>), like this:

</P>

<PRE>
grub&#62; <KBD>find /boot/grub/stage1</KBD>
</PRE>

<P>
This will search for the file name <TT>`/boot/grub/stage1'</TT> and show the
devices which contain the file.

</P>
<P>
Once you've set the root device correctly, run the command
@command{setup} (see section <A HREF="grub.html#SEC96">setup</A>):

</P>

<PRE>
grub&#62; <KBD>setup (hd0)</KBD>
</PRE>

<P>
This command will install GRUB on the MBR in the first drive. If you
want to install GRUB into the <STRONG>boot sector</STRONG> of a partition instead
of the MBR, specify a partition into which you want to install GRUB:

</P>

<PRE>
grub&#62; <KBD>setup (hd0,0)</KBD>
</PRE>

<P>
If you install GRUB into a partition or a drive other than the first
one, you must chain-load GRUB from another boot loader. Refer to the
manual for the boot loader to know how to chain-load GRUB.

</P>
<P>
Now you can boot GRUB without a GRUB floppy. See the chapter
section <A HREF="grub.html#SEC11">Booting</A> to find out how to boot your operating \
systems from GRUB.

</P>



<H2><A NAME="SEC10" HREF="grub.html#TOC10">Installing GRUB using \
grub-install</A></H2>

<P>
<STRONG>Caution:</STRONG> This procedure is definitely deprecated, because there
are several posibilities that your computer can be unbootable. For
example, most operating systems don't tell GRUB how to map BIOS drives
to OS devices correctly, GRUB merely <STRONG>guesses</STRONG> the mapping. This
will succeed in most cases, but not always. So GRUB provides you with a
user-defined map file called <STRONG>device map</STRONG>, which you must fix, if it
is wrong. See section <A HREF="grub.html#SEC108">The map between BIOS drives and OS \
devices</A>, for more details.

</P>
<P>
Unfortunately, if you do want to install GRUB under a UNIX-like OS (such
as GNU), invoke the program @command{grub-install} (see section <A \
HREF="grub.html#SEC109">Invoking grub-install</A>) as the superuser \
(<STRONG>root</STRONG>).

</P>
<P>
The usage is basically very easy. You only need to specify one argument
to the program, namely, where to install GRUB. The argument can be
either of a device file or a GRUB's drive/partition. So, this will
install GRUB into the MBR of the first IDE disk under Linux:

</P>

<PRE>
# <KBD>grub-install /dev/hda</KBD>
</PRE>

<P>
Likewise, under Hurd, this has the same effect:

</P>

<PRE>
# <KBD>grub-install /dev/hd0</KBD>
</PRE>

<P>
If it is the first BIOS drive, this is the same as well:

</P>

<PRE>
# <KBD>grub-install '(hd0)'</KBD>
</PRE>

<P>
But all the above examples assume that you use GRUB images under
the root directory. If you want GRUB to use images under a directory
other than the root directory, you need to specify the option
@option{--root-directory}. The typical usage is that you create a GRUB
boot floppy with a filesystem. Here is an example:

</P>

<PRE>
# <KBD>mke2fs /dev/fd0</KBD>
# <KBD>mount -t ext2 /dev/fd0 /mnt</KBD>
# <KBD>grub-install --root-directory=/mnt '(fd0)'</KBD>
# <KBD>umount /mnt</KBD>
</PRE>

<P>
Another example is in case that you have a separate boot partition
which is mounted at <TT>`/boot'</TT>. Since GRUB is a boot loader, it
doesn't know anything about mountpoints at all. Thus, you need to run
@command{grub-install} like this:

</P>

<PRE>
# <KBD>grub-install --root-directory=/boot /dev/hda</KBD>
</PRE>

<P>
By the way, as noted above, it is quite difficult to guess BIOS drives
correctly under a UNIX-like OS. Thus, @command{grub-install} will prompt
you to check if it could really guess the correct mappings, after the
installation. The format is defined in section <A HREF="grub.html#SEC108">The map \
between BIOS drives and OS devices</A>. Please be careful enough. If the output is \
wrong, it is unlikely that your computer can boot with no problem.

</P>
<P>
Note that @command{grub-install} is actually just a shell script and the
real task is done by the grub shell @command{grub} (see section <A \
HREF="grub.html#SEC105">Invoking the grub shell</A>). Therefore, you may run \
@command{grub} directly to install GRUB, without using @command{grub-install}. 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.

</P>



<H1><A NAME="SEC11" HREF="grub.html#TOC11">Booting</A></H1>

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

</P>



<H2><A NAME="SEC12" HREF="grub.html#TOC12">How to boot operating systems</A></H2>

<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 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.

</P>



<H3><A NAME="SEC13" HREF="grub.html#TOC13">How to boot an OS directly with \
GRUB</A></H3>

<P>
Multiboot (see section `Motivation' in <CITE>The Multiboot Specification</CITE>) is \
the native format supported by GRUB. For the sake of convenience, there are also \
support for Linux, FreeBSD, NetBSD and OpenBSD. If you want to boot other operating \
systems, you will have to chain-load them (see section <A HREF="grub.html#SEC14">Load \
another boot loader to boot unsupported operating systems</A>).

</P>
<P>
Generally, GRUB can boot any Multiboot-compliant OS in the following
steps:

</P>

<OL>
<LI>

Set GRUB's root device to the drive where the OS images are stored by
the command @command{root} (see section <A HREF="grub.html#SEC93">root</A>).

<LI>

Load the kernel image by the command @command{kernel} (see section <A \
HREF="grub.html#SEC82">kernel</A>).

<LI>

If you need modules, load them with the command @command{module}
(see section <A HREF="grub.html#SEC87">module</A>) or @command{modulenounzip} (see \
section <A HREF="grub.html#SEC88">modulenounzip</A>).

<LI>

Run the command @command{boot} (see section <A HREF="grub.html#SEC64">boot</A>).
</OL>

<P>
Linux, FreeBSD, NetBSD and OpenBSD can be booted in a similar
manner. You can load a kernel image by the command @command{kernel} and
then run the command @command{boot}. If the kernel requires some
parameters, just append the parameters to @command{kernel}, after the
file name of the kernel. Also, please refer to section <A HREF="grub.html#SEC15">Some \
caveats on OS-specific issues</A>, for the information on your OS-specific issues.

</P>



<H3><A NAME="SEC14" HREF="grub.html#TOC14">Load another boot loader to boot \
unsupported operating systems</A></H3>

<P>
If you want to boot an unsupported operating system (e.g. Windows 95),
chain-load a boot loader for the operating system. Normally, the boot
loader is embedded in the <STRONG>boot sector</STRONG> of the partition on which
the operating system is installed.

</P>

<OL>
<LI>

Set GRUB's root device to the partition by the command
@command{rootnoverify} (see section <A HREF="grub.html#SEC94">rootnoverify</A>):


<PRE>
grub&#62; <KBD>rootnoverify (hd0,0)</KBD>
</PRE>

<LI>

Set the <STRONG>active</STRONG> flag in the partition by the command
@command{makeactive}<A NAME="DOCF5" HREF="grub.html#FOOT5">(5)</A> (see section <A \
HREF="grub.html#SEC84">makeactive</A>):


<PRE>
grub&#62; <KBD>makeactive</KBD>
</PRE>

<LI>

Load the boot loader by the command @command{chainloader}
(see section <A HREF="grub.html#SEC66">chainloader</A>):


<PRE>
grub&#62; <KBD>chainloader +1</KBD>
</PRE>

<SAMP>`+1'</SAMP> indicates that GRUB should read one sector from the start of
the partition. The complete description about this syntax can be found
in section <A HREF="grub.html#SEC33">How to specify block lists</A>.

<LI>

Run the command @command{boot} (see section <A HREF="grub.html#SEC64">boot</A>).
</OL>

<P>
However, DOS and Windows have some deficiencies, so you might have to
use more complicated instructions. See section <A \
HREF="grub.html#SEC21">DOS/Windows</A>, for more information.

</P>



<H2><A NAME="SEC15" HREF="grub.html#TOC15">Some caveats on OS-specific \
issues</A></H2>

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

</P>



<H3><A NAME="SEC16" HREF="grub.html#TOC16">GNU/Hurd</A></H3>

<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.

</P>

<OL>
<LI>

Set GRUB's root device to the same drive as GNU/Hurd's. Probably the
command <CODE>find /boot/gnumach</CODE> or similar can help you
(see section <A HREF="grub.html#SEC73">find</A>).

<LI>

Load the kernel and the module, like this:


<PRE>
grub&#62; <KBD>kernel /boot/gnumach root=hd0s1</KBD>
grub&#62; <KBD>module /boot/serverboot</KBD>
</PRE>

<LI>

Run the command @command{boot} (see section <A HREF="grub.html#SEC64">boot</A>).
</OL>



<H3><A NAME="SEC17" HREF="grub.html#TOC17">GNU/Linux</A></H3>

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

</P>

<OL>
<LI>

Set GRUB's root device to the same drive as GNU/Linux's. Probably the
command <CODE>find /vmlinuz</CODE> or similar can help you (see section <A \
HREF="grub.html#SEC73">find</A>).

<LI>

Load the kernel:


<PRE>
grub&#62; <KBD>kernel /vmlinuz root=/dev/hda1</KBD>
</PRE>

If you need to specify some kernel parameters, just append them to the
command. For example, to set @option{vga} to <SAMP>`ext'</SAMP>, do this:


<PRE>
grub&#62; <KBD>kernel /vmlinuz root=/dev/hda1 vga=ext</KBD>
</PRE>

See the documentation in the Linux source tree for the complete
information on the available options.

<LI>

If you use an initrd, execute the command @command{initrd}
(see section <A HREF="grub.html#SEC79">initrd</A>) after @command{kernel}:


<PRE>
grub&#62; <KBD>initrd /initrd</KBD>
</PRE>

<LI>

Finally, run the command @command{boot} (see section <A \
HREF="grub.html#SEC64">boot</A>). </OL>

<P>
<STRONG>Caution:</STRONG> If you use an initrd and specify the <SAMP>`mem='</SAMP>
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 @command{uppermem} <EM>before</EM> loading the
kernel. See section <A HREF="grub.html#SEC99">uppermem</A>, for more information.

</P>



<H3><A NAME="SEC18" HREF="grub.html#TOC18">FreeBSD</A></H3>

<P>
GRUB can load the kernel directly, either in ELF or a.out format. But
this is not recommended, since FreeBSD's bootstrap interface sometimes
changes heavily, so GRUB can't guarantee to pass kernel parameters
correctly.

</P>
<P>
Thus, we'd recommend loading the very flexible loader
<TT>`/boot/loader'</TT> instead. See this example:

</P>

<PRE>
grub&#62; <KBD>root (hd0,a)</KBD>
grub&#62; <KBD>kernel /boot/loader</KBD>
grub&#62; <KBD>boot</KBD>
</PRE>



<H3><A NAME="SEC19" HREF="grub.html#TOC19">NetBSD</A></H3>

<P>
GRUB can load NetBSD a.out and ELF directly, follow these steps:

</P>

<OL>
<LI>

Set GRUB's root device with @command{root} (see section <A \
HREF="grub.html#SEC93">root</A>).

<LI>

Load the kernel with @command{kernel} (see section <A \
HREF="grub.html#SEC82">kernel</A>). You should append the ugly option \
@option{--type=netbsd}, if you want to load an ELF kernel, like this:


<PRE>
grub&#62; <KBD>kernel --type=netbsd /netbsd-elf</KBD>
</PRE>

<LI>

Run @command{boot} (see section <A HREF="grub.html#SEC64">boot</A>).
</OL>

<P>
For now, however, GRUB doesn't allow you to pass kernel parameters, so
it may be better to chain-load it instead, for more information please
see section <A HREF="grub.html#SEC14">Load another boot loader to boot unsupported \
operating systems</A>.

</P>



<H3><A NAME="SEC20" HREF="grub.html#TOC20">OpenBSD</A></H3>

<P>
The booting instruction is exactly the same as for NetBSD
(see section <A HREF="grub.html#SEC19">NetBSD</A>).

</P>



<H3><A NAME="SEC21" HREF="grub.html#TOC21">DOS/Windows</A></H3>

<P>
GRUB cannot boot DOS or Windows directly, so you must chain-load them
(see section <A HREF="grub.html#SEC14">Load another boot loader to boot unsupported \
operating systems</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>
<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 @command{map} (see section <A HREF="grub.html#SEC85">map</A>), like this:

</P>

<PRE>
grub&#62; <KBD>map (hd0) (hd1)</KBD>
grub&#62; <KBD>map (hd1) (hd0)</KBD>
</PRE>

<P>
This performs a <STRONG>virtual</STRONG> swap between your first and second hard
drive.

</P>
<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>
<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>
<P>
If GRUB <STRONG>hide</STRONG>s a DOS (or Windows) partition (see section <A \
HREF="grub.html#SEC51">hide</A>), DOS (or Windows) will ignore the partition. If GRUB \
<STRONG>unhide</STRONG>s a DOS (or Windows) partition (see section <A \
HREF="grub.html#SEC61">unhide</A>), 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:

</P>

<PRE>
grub&#62; <KBD>unhide (hd0,0)</KBD>
grub&#62; <KBD>hide (hd0,1)</KBD>
grub&#62; <KBD>rootnoverify (hd0,0)</KBD>
grub&#62; <KBD>chainloader +1</KBD>
grub&#62; <KBD>makeactive</KBD>
grub&#62; <KBD>boot</KBD>
</PRE>



<H3><A NAME="SEC22" HREF="grub.html#TOC22">SCO UnixWare</A></H3>

<P>
It is known that the signature in the boot loader for SCO UnixWare is
wrong, so you will have to specify the option @option{--force} to
@command{chainloader} (see section <A HREF="grub.html#SEC66">chainloader</A>), like \
this:

</P>

<PRE>
grub&#62; <KBD>rootnoverify (hd1,0)</KBD>
grub&#62; <KBD>chainloader --force +1</KBD>
grub&#62; <KBD>makeactive</KBD>
grub&#62; <KBD>boot</KBD>
</PRE>



<H1><A NAME="SEC23" HREF="grub.html#TOC23">Configuration</A></H1>

<P>
You probably noticed that you need to type several commands to boot your
OS. There's a solution to that - GRUB provides a menu interface
(see section <A HREF="grub.html#SEC36">The simple menu interface</A>) from which you \
can select an item (using arrow keys) that will do everything to boot an OS.

</P>
<P>
To enable the menu, you need a configuration file,
<TT>`menu.lst'</TT> under the boot directory. We'll analyze an example
file.

</P>
<P>
The file first contains some general settings, the menu interface
related options. You can put these commands (see section <A \
HREF="grub.html#SEC40">The list of commands for the menu only</A>) before any of the \
items (starting with @command{title} (see section <A \
HREF="grub.html#SEC45">title</A>)).

</P>

<PRE>
#
# Sample boot menu configuration file
#
</PRE>

<P>
As you may have guessed, these lines are comments. Lines starting with a
hash character (<SAMP>`#'</SAMP>), and blank lines, are ignored by GRUB.

</P>

<PRE>
# By default, boot the first entry.
default 0
</PRE>

<P>
The first entry (here, counting starts with number zero, not one!) will
be the default choice.

</P>

<PRE>
# Boot automatically after 30 secs.
timeout 30
</PRE>

<P>
As the comment says, GRUB will boot automatically in 30 seconds, unless
interrupted with a keypress.

</P>

<PRE>
# Fallback to the second entry.
fallback 1
</PRE>

<P>
If, for any reason, the default entry doesn't work, fall back to the
second one (this is rarely used, for obvious reasons).

</P>
<P>
Note that the complete descriptions of these commands, which are menu
interface specific, can be found in section <A HREF="grub.html#SEC40">The list of \
commands for the menu only</A>. Other descriptions can be found in section <A \
HREF="grub.html#SEC39">The list of available commands</A>.

</P>
<P>
Now, on to the actual OS definitions. You will see that each entry
begins with a special command, @command{title} (see section <A \
HREF="grub.html#SEC45">title</A>), and the action is described after it. Note that \
there is no command @command{boot} (see section <A HREF="grub.html#SEC64">boot</A>) \
at the  end of each item. That is because GRUB automatically executes @command{boot} \
if it loads other commands successfully.

</P>
<P>
The argument for the command @command{title} is used to display a short
title/description of the entry in the menu. Since @command{title}
displays the argument as is, you can write basically anything in there.

</P>

<PRE>
# For booting the GNU Hurd
title  GNU/Hurd
root   (hd0,0)
kernel /boot/gnumach.gz root=hd0s1
module /boot/serverboot.gz
</PRE>

<P>
This boots GNU/Hurd from the first hard disk.

</P>

<PRE>
# For booting Linux
title  GNU/Linux
kernel (hd1,0)/vmlinuz root=/dev/hdb1
</PRE>

<P>
This boots GNU/Linux, but from the second hard disk.

</P>

<PRE>
# For booting Mach (getting kernel from floppy)
title  Utah Mach4 multiboot
root   (hd0,2)
pause  Insert the diskette now^G!!
kernel (fd0)/boot/kernel root=hd0s3
module (fd0)/boot/bootstrap
</PRE>

<P>
This boots Mach with a kernel on a floppy, but the root filesystem at
hd0s3. It also contains a @command{pause} line (see section <A \
HREF="grub.html#SEC89">pause</A>), which will cause GRUB to display a prompt and \
delay, before actually executing the rest of the commands and booting.

</P>

<PRE>
# For booting FreeBSD
title  FreeBSD
root   (hd0,2,a)
kernel /boot/loader
</PRE>

<P>
This item will boot FreeBSD kernel loaded from the <SAMP>`a'</SAMP> partition of
the third PC slice of the first hard disk.

</P>

<PRE>
# For booting OS/2
title OS/2
root  (hd0,1)
makeactive
# chainload OS/2 bootloader from the first sector
chainloader +1
# This is similar to "chainload", but loads a specific file
#chainloader /boot/chain.os2
</PRE>

<P>
This will boot OS/2, using a chain-loader (see section <A HREF="grub.html#SEC14">Load \
another boot loader to boot unsupported operating systems</A>).

</P>

<PRE>
# For booting Windows NT or Windows95
title Windows NT / Windows 95 boot menu
root        (hd0,0)
makeactive
chainloader +1
# For loading DOS if Windows NT is installed
# chainload /bootsect.dos
</PRE>

<P>
The same as the above, but for Windows.

</P>

<PRE>
# For installing GRUB into the hard disk
title Install GRUB into the hard disk
root    (hd0,0)
setup   (hd0)
</PRE>

<P>
This will just (re)install GRUB onto the hard disk.

</P>

<PRE>
# Change the colors.
title Change the colors
color light-green/brown blink-red/blue
</PRE>

<P>
In the last entry, the command @command{color} is used (see section <A \
HREF="grub.html#SEC48">color</A>), to change the menu colors (try it!). This command \
is somewhat special, because it can be used both in the command-line and in the menu. \
GRUB has several such commands, see section <A HREF="grub.html#SEC46">The list of \
general commands</A>.

</P>
<P>
We hope that you now understand how to use the basic features of
GRUB. To learn more about GRUB, see the following chapters.

</P>



<H1><A NAME="SEC24" HREF="grub.html#TOC24">Downloading OS images from a \
network</A></H1>

<P>
Although GRUB is a disk-based boot loader, it does provide network
support. To use the network support, you need to enable at least one
network driver in the GRUB build process. For more information please
see <TT>`netboot/README.netboot'</TT> in the source distribution.

</P>



<H2><A NAME="SEC25" HREF="grub.html#TOC25">How to set up your network</A></H2>

<P>
GRUB requires a file server and optionally a server that will assign an
IP address to the machine on which GRUB is running. For the former, only
TFTP is supported at the moment. The latter is either BOOTP, DHCP or a
RARP server<A NAME="DOCF6" HREF="grub.html#FOOT6">(6)</A>. It is not necessary to run \
both the servers on one computer. How to configure these servers is beyond the scope \
of this document, so please refer to the manuals specific to those
protocols/servers.

</P>
<P>
If you decided to use a server to assign an IP address, set up the
server and run @command{bootp} (see section <A HREF="grub.html#SEC47">bootp</A>), \
@command{dhcp} (see section <A HREF="grub.html#SEC50">dhcp</A>) or @command{rarp} \
(see section <A HREF="grub.html#SEC56">rarp</A>) for BOOTP, DHCP or RARP, \
respectively. Each command will show an assigned IP address, a netmask, an IP address \
for your TFTP server and a gateway. If any of the addresses is wrong or it causes an \
error, probably the configuration of your servers isn't set up properly.

</P>
<P>
Otherwise, run @command{ifconfig}, like this:

</P>

<PRE>
grub&#62; <KBD>ifconfig --address=192.168.110.23 --server=192.168.110.14</KBD>
</PRE>

<P>
You can also use @command{ifconfig} in conjugation with @command{bootp},
@command{dhcp} or @command{rarp} (e.g. to reassign the server address
manually). See section <A HREF="grub.html#SEC52">ifconfig</A>, for more details.

</P>
<P>
Finally, download your OS images from your network. The network can be
accessed using the network drive <SAMP>`(nd)'</SAMP>. Everything else is very
similar to the normal instructions (see section <A \
HREF="grub.html#SEC11">Booting</A>).

</P>
<P>
Here is an example:

</P>

<PRE>
grub&#62; <KBD>bootp</KBD>
Probing... [NE*000]
NE2000 base ...
Address: 192.168.110.23    Netmask: 255.255.255.0
Server: 192.168.110.14     Gateway: 192.168.110.1

grub&#62; <KBD>root (nd)</KBD>
grub&#62; <KBD>kernel /tftproot/gnumach.gz root=sd0s1</KBD>
grub&#62; <KBD>module /tftproot/serverboot.gz</KBD>
grub&#62; <KBD>boot</KBD>
</PRE>



<H2><A NAME="SEC26" HREF="grub.html#TOC26">Booting from a network</A></H2>

<P>
It is sometimes very useful to boot from a network, especially, when you
use a machine which has no local disk. In this case, you need to obtain
a kind of Net Boot ROM, such as a PXE ROM or a free software
package like Etherboot. Such a Boot ROM first boots the machine,
sets up the network card installed into the machine, and downloads a
second stage boot image from the network. Then, the second image will
try to boot an operating system from the network actually.

</P>
<P>
GRUB provides two second stage images, <TT>`nbgrub'</TT> and
<TT>`pxegrub'</TT> (see section <A HREF="grub.html#SEC29">GRUB image files</A>). \
Those images are the same as the normal Stage 2, except that they set up a network \
automatically, and try to load a configuration file from the network, if specified. \
The usage is very simple: If the machine has a PXE ROM, use
<TT>`pxegrub'</TT>. If the machine has a NBI loader such as Etherboot, use
<TT>`nbgrub'</TT>. There is no difference between them but their formats. As
how to load a second stage image you want to use should be described in
the manual on your Net Boot ROM, please refer to the manual, for
more information.

</P>
<P>
However, there is one thing specific to GRUB. Namely, how to specify a
configuration file in a BOOTP/DHCP server. For now, GRUB uses the tag
<SAMP>`150'</SAMP>, to get the name of a configuration file. This below is an
example about a BOOTP configuration:

</P>

<PRE>
.allhost:hd=/tmp:bf=null:\
        :ds=145.71.35.1 145.71.32.1:\
        :sm=255.255.254.0:\
        :gw=145.71.35.1:\
        :sa=145.71.35.5:

foo:ht=1:ha=63655d0334a7:ip=145.71.35.127:\
        :bf=/nbgrub:\
        :tc=.allhost:\
        :T150="/tftpboot/menu.lst.foo":
</PRE>

<P>
See the manual about your BOOTP/DHCP server, for more information. The
exact syntax should differ from the example, more or less.

</P>



<H1><A NAME="SEC27" HREF="grub.html#TOC27">Using GRUB via a serial line</A></H1>

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

</P>
<P>
If you have many computers or computers with no display/keyboard, it
would be very useful to control the computers with serial
communications. To connect a 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>
<P>
As for GRUB, the instruction to set up a serial terminal is quite
simple. First of all, make sure that you haven't specified the option
@option{--disable-serial} to the configure script when you built your
GRUB images. If you get them in binary form, probably they have serial
terminal support already.

</P>
<P>
Then, initialize your serial terminal after GRUB starts up. Here is an
example:

</P>

<PRE>
grub&#62; <KBD>serial --unit=0 --speed=9600</KBD>
grub&#62; <KBD>terminal serial</KBD>
</PRE>

<P>
The command @command{serial} initializes the serial unit 0 with the
speed 9600bps. The serial unit 0 is usually called <SAMP>`COM1'</SAMP>, so, if
you want to use COM2, you must specify <SAMP>`--unit=1'</SAMP> instead. This
command accepts many other options, so please refer to section <A \
HREF="grub.html#SEC57">serial</A>, for more details.

</P>
<P>
The command @command{terminal} (see section <A HREF="grub.html#SEC59">terminal</A>) \
chooses which type of terminal you want to use. In that case above, the terminal will \
be a serial terminal, but you can also pass <CODE>console</CODE> to the command,
like <SAMP>`terminal serial console'</SAMP>. In this case, a terminal in which
you press any key will be selected as a GRUB terminal.

</P>
<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 @option{--dumb} to
the command, if your terminal emulator is not VT100-compatible or
implements few VT100 escape sequences. If you specify the option, then
GRUB doesn't provide you with the menu interface, because the menu
requires several fancy features for your terminal. Instead, GRUB only
gives you the hidden menu interface and the command-line interface
(see section <A HREF="grub.html#SEC34">GRUB's user interface</A>).

</P>



<H1><A NAME="SEC28" HREF="grub.html#TOC28">Protecting your computer from \
cracking</A></H1>

<P>
You may be interested in how to prevent ordinary users from doing
whatever they like, if you share your computer with other people. So
this chapter describes how to improve the security of GRUB.

</P>
<P>
One thing which could be a security hole is that the user can do too
many things with GRUB, because GRUB allows to modify its configuration
and run arbitrary commands at run-time. For example, the user can read
even <TT>`/etc/passwd'</TT> in the command-line interface by the command
@command{cat} (see section <A HREF="grub.html#SEC65">cat</A>). So it is necessary to \
disable all the interactive operations.

</P>
<P>
Thus, GRUB provides <STRONG>password</STRONG> feature, so that only administrators
can start the interactive operations (i.e. editing menu entries and
entering the command-line interface). To use this feature, you need to
run the command @command{password} in your configuration file
(see section <A HREF="grub.html#SEC55">password</A>), like this:

</P>

<PRE>
password --md5 PASSWORD
</PRE>

<P>
If this is specified, GRUB disallows any interactive control, until you
press the key <KBD>p</KBD> and enter a correct password.  The option
@option{--md5} tells GRUB that <SAMP>`PASSWORD'</SAMP> is in MD5 format.  If it
is omitted, GRUB assumes the <SAMP>`PASSWORD'</SAMP> is in clear text.

</P>
<P>
You can encrypt your password with the command @command{md5crypt}
(see section <A HREF="grub.html#SEC86">md5crypt</A>). For example, run the grub shell \
(see section <A HREF="grub.html#SEC105">Invoking the grub shell</A>), and enter your \
password:

</P>

<PRE>
grub&#62; md5crypt
Password: **********
Encrypted: $1$U$JK7xFegdxWH6VuppCUSIb.
</PRE>

<P>
Then, cut and paste the encrypted password to your configuration file.

</P>
<P>
Also, you can specify an optional argument to @command{password}. See
this example:

</P>

<PRE>
password PASSWORD /boot/grub/menu-admin.lst
</PRE>

<P>
In this case, GRUB will load <TT>`/boot/grub/menu-admin.lst'</TT> as a
configuration file when you enter the valid password.

</P>
<P>
Another thing which may be dangerous is that any user can choose any
menu entry. Usually, this wouldn't be problematic, but you might want to
permit only administrators to run some of your menu entries, such as an
entry for booting an insecure OS like DOS.

</P>
<P>
GRUB provides the command @command{lock} (see section <A \
HREF="grub.html#SEC83">lock</A>). This command always fails until you enter a valid \
password, so you can use it, like this:

</P>

<PRE>
title Boot DOS
lock
rootnoverify (hd0,1)
makeactive
chainload +1
</PRE>

<P>
You should insert @command{lock} right after @command{title}, because
any user can execute commands in an entry, until GRUB encounters
@command{lock}.

</P>
<P>
You can also use the command @command{password} instead of
@command{lock}. In this case the boot process will ask for the password
and stop if it was entered incorrectly.  Since the @command{password}
takes its own <VAR>PASSWORD</VAR> argument this is useful if you want
different passwords for different entries.

</P>



<H1><A NAME="SEC29" HREF="grub.html#TOC29">GRUB image files</A></H1>

<P>
GRUB consists of several images: two essential stages, optional stages
called <STRONG>Stage 1.5</STRONG>, and two network boot images. Here is a short
overview of them. See section <A HREF="grub.html#SEC116">Hacking GRUB</A>, for more \
details.

</P>
<DL COMPACT>

<DT><TT>`stage1'</TT>
<DD>
This is an essential image used for booting up GRUB. Usually, this is
embedded in a MBR or the boot sector of a partition. Because a PC boot
sector is 512 bytes, the size of this image is exactly 512 bytes.

All <TT>`stage1'</TT> must do is to load Stage 2 or Stage 1.5 from a local
disk. Because of the size restriction, <TT>`stage1'</TT> encodes the
location of Stage 2 (or Stage 1.5) in a block list format, so it never
understand any filesystem structure.

<DT><TT>`stage2'</TT>
<DD>
This is the core image of GRUB. This does all things but booting up
itself. Usually, this is put in a filesystem, but that is not required.

<DT><TT>`e2fs_stage1_5'</TT>
<DD>
<DT><TT>`ffs_stage1_5'</TT>
<DD>
<DT><TT>`reiserfs_stage1_5'</TT>
<DD>
<DT><TT>`fat_stage1_5'</TT>
<DD>
<DT><TT>`minix_stage1_5'</TT>
<DD>
<DT><TT>`vstafs_stage1_5'</TT>
<DD>
These are called <STRONG>Stage 1.5</STRONG>, because the purpose is a bridge
between <TT>`stage1'</TT> and <TT>`stage2'</TT>, that is to say, Stage 1.5 is
loaded by Stage 1 and Stage 1.5 loads Stage 2. The difference between
<TT>`stage1'</TT> and <TT>`*_stage1_5'</TT> is that the former doesn't
understand any filesystem but the latter does an filesystem
(e.g. <TT>`e2fs_stage1_5'</TT> understands ext2fs). So you can move the
location of Stage 2 to another safely, even after GRUB has been
installed.

While Stage 2 cannot generally be embedded in a fixed area as the size
is so large, Stage 1.5 can be installed into the area right after a MBR,
or the boot loader area of a ReiserFS or a FFS.

<DT><TT>`nbgrub'</TT>
<DD>
This is a network boot image for the Network Image Proposal used by some
network boot loaders, such as Etherboot. This is mostly the same as
Stage 2, but this also sets up a network and loads a configuration file
from the network.

<DT><TT>`pxegrub'</TT>
<DD>
This is another network boot image for the Preboot Execution Environment
used by several Netboot ROMs. This is identical to <TT>`nbgrub'</TT>, except
for the format.
</DL>



<H1><A NAME="SEC30" HREF="grub.html#TOC30">Filesystem syntax and semantics</A></H1>

<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 @command{find}
(see section <A HREF="grub.html#SEC73">find</A>).

</P>



<H2><A NAME="SEC31" HREF="grub.html#TOC31">How to specify devices</A></H2>

<P>
The device syntax is like this:

</P>

<PRE>
<CODE>(<VAR>device</VAR>[,<VAR>part-num</VAR>][,<VAR>bsd-subpart-letter</VAR>])</CODE>
 </PRE>

<P>
<SAMP>`[]'</SAMP> means the parameter is optional. <VAR>device</VAR> should be
either <SAMP>`fd'</SAMP> or <SAMP>`hd'</SAMP> followed by a digit, like \
<SAMP>`fd0'</SAMP>. But you can also set <VAR>device</VAR> to a hexadecimal or a \
decimal, which is a BIOS drive number, so the following are equivalent:

</P>

<PRE>
(hd0)
(0x80)
(128)
</PRE>

<P>
<VAR>part-num</VAR> represents the partition number of <VAR>device</VAR>, starting
from zero for primary partitions and from four for extended partitions,
and <VAR>bsd-subpart-letter</VAR> represents the BSD disklabel subpartition,
such as <SAMP>`a'</SAMP> or <SAMP>`e'</SAMP>.

</P>
<P>
A shortcut for specifying BSD subpartitions is
<CODE>(<VAR>device</VAR>,<VAR>bsd-subpart-letter</VAR>)</CODE>, in this case, GRUB
searches for the first PC partition containing a BSD disklabel, then
finds the subpartition <VAR>bsd-subpart-letter</VAR>. Here is an example:

</P>

<PRE>
(hd0,a)
</PRE>

<P>
The syntax like <SAMP>`(hd0)'</SAMP> represents using the entire disk (or the
MBR when installing GRUB), while the syntax like <SAMP>`(hd0,0)'</SAMP>
represents using the partition of the disk (or the boot sector of the
partition when installing GRUB).

</P>
<P>
If you enabled the network support, the special drive, <SAMP>`(nd)'</SAMP>, is
also available. Before using the network drive, you must initialize the
network. See section <A HREF="grub.html#SEC24">Downloading OS images from a \
network</A>, for more information.

</P>



<H2><A NAME="SEC32" HREF="grub.html#TOC32">How to specify files</A></H2>

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

</P>
<P>
An absolute file name resembles a Unix absolute file name, using
<SAMP>`/'</SAMP> for the directory separator (not <SAMP>`\'</SAMP> as in DOS). One
example is <SAMP>`(hd0,0)/boot/grub/menu.lst'</SAMP>. This means the file
<TT>`/boot/grub/menu.lst'</TT> in the first partition of the first hard
disk. If you omit the device name in an absolute file name, GRUB uses
GRUB's <STRONG>root device</STRONG> implicitly. So if you set the root device to,
say, <SAMP>`(hd1,0)'</SAMP> by the command @command{root} (see section <A \
HREF="grub.html#SEC93">root</A>), then <CODE>/boot/kernel</CODE> is the same as \
<CODE>(hd1,0)/boot/kernel</CODE>.

</P>



<H2><A NAME="SEC33" HREF="grub.html#TOC33">How to specify block lists</A></H2>

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

</P>

<PRE>
<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>
<P>
Like the file name syntax (see section <A HREF="grub.html#SEC32">How to specify \
files</A>), if a blocklist does not contain a device name, then GRUB uses GRUB's \
<STRONG>root device</STRONG>. So <CODE>(hd0,1)+1</CODE> is the same as \
<CODE>+1</CODE> when the root device is <SAMP>`(hd0,1)'</SAMP>.

</P>



<H1><A NAME="SEC34" HREF="grub.html#TOC34">GRUB's user interface</A></H1>

<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>
<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 <STRONG>command-line</STRONG> menu
option, or if the configuration file was not found, then GRUB drops to
the command-line interface.

</P>



<H2><A NAME="SEC35" HREF="grub.html#TOC35">The flexible command-line \
interface</A></H2>

<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 NAME="DOCF7" \
HREF="grub.html#FOOT7">(7)</A>. The commands (see section <A \
HREF="grub.html#SEC62">The list of command-line and menu entry commands</A>) are a \
subset of those available in the configuration file, used with exactly the same \
syntax.

</P>
<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:

</P>
<DL COMPACT>

<DT><KBD>C-f</KBD>
<DD>
<DT><KBD>PC right key</KBD>
<DD>
Move forward one character.

<DT><KBD>C-b</KBD>
<DD>
<DT><KBD>PC left key</KBD>
<DD>
Move back one character.

<DT><KBD>C-a</KBD>
<DD>
<DT><KBD>HOME</KBD>
<DD>
Move to the start of the line.

<DT><KBD>C-e</KBD>
<DD>
<DT><KBD>END</KBD>
<DD>
Move the the end of the line.

<DT><KBD>C-d</KBD>
<DD>
<DT><KBD>DEL</KBD>
<DD>
Delete the character underneath the cursor.

<DT><KBD>C-h</KBD>
<DD>
<DT><KBD>BS</KBD>
<DD>
Delete the character to the left of the cursor.

<DT><KBD>C-k</KBD>
<DD>
Kill the text from the current cursor position to the end of the line.

<DT><KBD>C-u</KBD>
<DD>
Kill backward from the cursor to the beginning of the line.

<DT><KBD>C-y</KBD>
<DD>
Yank the killed text back into the buffer at the cursor.

<DT><KBD>C-p</KBD>
<DD>
<DT><KBD>PC up key</KBD>
<DD>
Move up through the history list.

<DT><KBD>C-n</KBD>
<DD>
<DT><KBD>PC down key</KBD>
<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 <KBD>TAB</KBD> key (or
<KBD>C-i</KBD>) will display a listing of the available commands, and if the
cursor is after the first word, the <KBD><KBD>TAB</KBD></KBD> will provide a
completion listing of disks, partitions, and file names depending on the
context.

</P>
<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.

</P>



<H2><A NAME="SEC36" HREF="grub.html#TOC36">The simple menu interface</A></H2>

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

</P>
<P>
Basically, the menu interface provides a list of <STRONG>boot entries</STRONG> to
the user to choose from. Use the arrow keys to select the entry of
choice, then press <KBD>RET</KBD> 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>
<P>
Commands are available to enter a bare command-line by pressing <KBD>c</KBD>
(which operates exactly like the non-config-file version of GRUB, but
allows one to return to the menu if desired by pressing <KBD>ESC</KBD>) or to
edit any of the <STRONG>boot entries</STRONG> by pressing <KBD>e</KBD>.

</P>
<P>
If you protect the menu interface with a password (see section <A \
HREF="grub.html#SEC28">Protecting your computer from cracking</A>), all you can do is \
choose an entry by pressing <KBD>RET</KBD>, or press <KBD>p</KBD> to enter the \
password.

</P>



<H2><A NAME="SEC37" HREF="grub.html#TOC37">Editing a menu entry</A></H2>

<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>
<P>
If an <KBD>ESC</KBD> is pressed in the editor, it aborts all the changes made
to the configuration entry and returns to the main menu interface.

</P>
<P>
When a particular line is selected, the editor places the user at a
special version of the GRUB command-line to edit that line.  When the
user hits <KBD>RET</KBD>, GRUB replaces the line in question in the boot
entry with the changes (unless it was aborted via <KBD>ESC</KBD>,
in which case the changes are thrown away).

</P>
<P>
If you want to add a new line to the menu entry, press <KBD>o</KBD> if adding
a line after the current line or press <KBD>O</KBD> if before the current
line.

</P>
<P>
To delete a line, hit the key <KBD>d</KBD>. Although GRUB does not support
<STRONG>undo</STRONG> unfortunately, you can do almost the same thing by just
returning to the main menu.

</P>



<H2><A NAME="SEC38" HREF="grub.html#TOC38">The hidden menu interface</A></H2>

<P>
When your terminal is dumb or you request GRUB of hiding the menu
interface explicitly with the command @command{hiddenmenu}
(see section <A HREF="grub.html#SEC43">hiddenmenu</A>), GRUB doesn't show the menu \
interface (see section <A HREF="grub.html#SEC36">The simple menu interface</A>) and \
automatically boots the default entry, unless interrupted by pressing <KBD>ESC</KBD>.

</P>
<P>
When you interrupt the timeout and your terminal is dumb, GRUB falls
back to the command-line interface (see section <A HREF="grub.html#SEC35">The \
flexible command-line interface</A>).

</P>



<H1><A NAME="SEC39" HREF="grub.html#TOC39">The list of available commands</A></H1>

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

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

</P>



<H2><A NAME="SEC40" HREF="grub.html#TOC40">The list of commands for the menu \
only</A></H2>

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

</P>

<UL>
<LI>

The menu-specific commands have to be used before any others.

<LI>

The files <EM>must</EM> be in plain-text format.

<LI>

<SAMP>`#'</SAMP> 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 <SAMP>`0x'</SAMP>, and is case-insensitive.

<LI>

Extra options or text at the end of the line is ignored unless otherwise
specified.

<LI>

Unrecognized commands are added to the current entry, except before entries
start, where they are ignored.
</UL>

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

</P>



<H3><A NAME="SEC41" HREF="grub.html#TOC41">default</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>default</B> <I>num</I>
<DD><A NAME="IDX1"></A>
Set the default entry to the entry number <VAR>num</VAR>. Numbering starts
from 0, and the entry number 0 is the default if the command is not
used.

</P>
<P>
You can specify <SAMP>`saved'</SAMP> instead of a number. In this case, the
default entry is the entry saved with the command
@command{savedefault}. See section <A HREF="grub.html#SEC95">savedefault</A>, for \
more information. </DL>

</P>



<H3><A NAME="SEC42" HREF="grub.html#TOC42">fallback</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>fallback</B> <I>num</I>
<DD><A NAME="IDX2"></A>
Go into unattended boot mode: if the default boot entry has any errors,
instead of waiting for the user to do anything, immediately start
over using the <VAR>num</VAR> entry (same numbering as the <CODE>default</CODE>
command (see section <A HREF="grub.html#SEC41">default</A>)). This obviously won't \
help if the machine was rebooted by a kernel that GRUB loaded.
</DL>

</P>



<H3><A NAME="SEC43" HREF="grub.html#TOC43">hiddenmenu</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>hiddenmenu</B>
<DD><A NAME="IDX3"></A>
Don't display the menu. If the command is used, no menu will be
displayed on the control terminal, and the default entry will be
booted after the timeout expired. The user can still request the
menu to be displayed by pressing <KBD>ESC</KBD> before the timeout
expires. See also section <A HREF="grub.html#SEC38">The hidden menu interface</A>.
</DL>

</P>



<H3><A NAME="SEC44" HREF="grub.html#TOC44">timeout</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>timeout</B> <I>sec</I>
<DD><A NAME="IDX4"></A>
Set a timeout, in <VAR>sec</VAR> seconds, before automatically booting the
default entry (normally the first entry defined).
</DL>

</P>



<H3><A NAME="SEC45" HREF="grub.html#TOC45">title</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>title</B> <I>name ...</I>
<DD><A NAME="IDX5"></A>
Start a new boot entry, and set its name to the contents of the rest of
the line, starting with the first non-space character.
</DL>

</P>



<H2><A NAME="SEC46" HREF="grub.html#TOC46">The list of general commands</A></H2>

<P>
Commands usable both in the menu and in the command-line.

</P>



<H3><A NAME="SEC47" HREF="grub.html#TOC47">bootp</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>bootp</B> <I>[@option{--with-configfile}]</I>
<DD><A NAME="IDX6"></A>
Initialize a network device via the <STRONG>BOOTP</STRONG> protocol. This command
is only available if GRUB is compiled with netboot support. See also
section <A HREF="grub.html#SEC24">Downloading OS images from a network</A>.

</P>
<P>
If you specify @option{--with-configfile} to this command, GRUB will
fetch and load a configuration file specified by your BOOTP server
with the vendor tag <SAMP>`150'</SAMP>.
</DL>

</P>



<H3><A NAME="SEC48" HREF="grub.html#TOC48">color</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>color</B> <I>normal [highlight]</I>
<DD><A NAME="IDX7"></A>
Change the menu colors. The color <VAR>normal</VAR> is used for most
lines in the menu (see section <A HREF="grub.html#SEC36">The simple menu \
interface</A>), and the color <VAR>highlight</VAR> is used to highlight the line \
where the cursor points. If you omit <VAR>highlight</VAR>, then the inverted color of
<VAR>normal</VAR> is used for the highlighted line. The format of a color is
<CODE><VAR>foreground</VAR>/<VAR>background</VAR></CODE>. <VAR>foreground</VAR> and
<VAR>background</VAR> are symbolic color names. A symbolic color name must be
one of these:

</P>

<UL>
<LI>

black

<LI>

blue

<LI>

green

<LI>

cyan

<LI>

red

<LI>

magenta

<LI>

brown

<LI>

light-gray

<STRONG>These below can be specified only for the foreground.</STRONG>

<LI>

dark-gray

<LI>

light-blue

<LI>

light-green

<LI>

light-cyan

<LI>

light-red

<LI>

light-magenta

<LI>

yellow

<LI>

white
</UL>

<P>
But only the first eight names can be used for <VAR>background</VAR>. You can
prefix <CODE>blink-</CODE> to <VAR>foreground</VAR> if you want a blinking
foreground color.

</P>
<P>
This command can be used in the configuration file and on the command
line, so you may write something like this in your configuration file:

</P>

<PRE>
# Set default colors.
color light-gray/blue black/light-gray

# Change the colors.
title OS-BS like
color magenta/blue black/magenta
</PRE>

</DL>



<H3><A NAME="SEC49" HREF="grub.html#TOC49">device</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>device</B> <I>drive file</I>
<DD><A NAME="IDX8"></A>
In the grub shell, specify the file <VAR>file</VAR> as the actual drive for a
BIOS drive <VAR>drive</VAR>. You can use this command to create a disk
image, and/or to fix the drives guessed by GRUB when GRUB fails to
determine them correctly, like this:

</P>

<PRE>
grub&#62; <KBD>device (fd0) /floppy-image</KBD>
grub&#62; <KBD>device (hd0) /dev/sd0</KBD>
</PRE>

<P>
This command can be used only in the grub shell (see section <A \
HREF="grub.html#SEC105">Invoking the grub shell</A>). </DL>

</P>



<H3><A NAME="SEC50" HREF="grub.html#TOC50">dhcp</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>dhcp</B> <I>[--with-configfile]</I>
<DD><A NAME="IDX9"></A>
Initialize a network device via the <STRONG>DHCP</STRONG> protocol. Currently,
this command is just an alias for @command{bootp}, since the two
protocols are very similar. This command is only available if GRUB is
compiled with netboot support. See also section <A HREF="grub.html#SEC24">Downloading \
OS images from a network</A>.

</P>
<P>
If you specify @option{--with-configfile} to this command, GRUB will
fetch and load a configuration file specified by your DHCP server
with the vendor tag <SAMP>`150'</SAMP>.
</DL>

</P>



<H3><A NAME="SEC51" HREF="grub.html#TOC51">hide</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>hide</B> <I>partition</I>
<DD><A NAME="IDX10"></A>
Hide the partition <VAR>partition</VAR> by setting the <STRONG>hidden</STRONG> bit in
its partition type code. This is useful only when booting DOS or Windows
and multiple primary FAT partitions exist in one disk. See also
section <A HREF="grub.html#SEC21">DOS/Windows</A>.
</DL>

</P>



<H3><A NAME="SEC52" HREF="grub.html#TOC52">ifconfig</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>ifconfig</B> <I>[@option{--server=server}] \
[@option{--gateway=gateway}] [@option{--mask=mask}] [@option{--address=address}]</I> \
<DD><A NAME="IDX11"></A> Configure the IP address, the netmask, the gateway, and the \
server address of a network device manually. The values must be in dotted
decimal format, like <SAMP>`192.168.11.178'</SAMP>. The order of the options is
not important. This command shows current network configuration, if no
option is specified. See also section <A HREF="grub.html#SEC24">Downloading OS images \
from a network</A>. </DL>

</P>



<H3><A NAME="SEC53" HREF="grub.html#TOC53">partnew</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>partnew</B> <I>part type from to</I>
<DD><A NAME="IDX12"></A>
Create a new primary partition. <VAR>part</VAR> is a partition specification
in GRUB syntax (see section <A HREF="grub.html#SEC6">Naming convention</A>); \
<VAR>type</VAR> is the partition type and must be a number in the range \
<CODE>0-0xff</CODE>; <VAR>from</VAR> and <VAR>to</VAR> are the starting and ending \
sectors, expressed as an absolute sector number.
</DL>

</P>



<H3><A NAME="SEC54" HREF="grub.html#TOC54">parttype</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>parttype</B> <I>part type</I>
<DD><A NAME="IDX13"></A>
Change the type of an existing partition.  <VAR>part</VAR> is a partition
specification in GRUB syntax (see section <A HREF="grub.html#SEC6">Naming \
convention</A>); <VAR>type</VAR> is the new partition type and must be a number in \
the range 0-0xff. </DL>

</P>



<H3><A NAME="SEC55" HREF="grub.html#TOC55">password</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>password</B> <I>[@option{--md5}] passwd [new-config-file]</I>
<DD><A NAME="IDX14"></A>
If used in the first section of a menu file, disable all interactive
editing control (menu entry editor and command-line) and entries
protected by the command @command{lock}. If the password <VAR>passwd</VAR> is
entered, it loads the <VAR>new-config-file</VAR> as a new config file and
restarts the GRUB Stage 2, if <VAR>new-config-file</VAR> is
specified. Otherwise, GRUB will just unlock the privileged instructions.
You can also use this command in the script section, in which case it
will ask for the password, before continueing.  The option
@option{--md5} tells GRUB that <VAR>passwd</VAR> is encrypted with
@command{md5crypt} (see section <A HREF="grub.html#SEC86">md5crypt</A>).
</DL>

</P>



<H3><A NAME="SEC56" HREF="grub.html#TOC56">rarp</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>rarp</B>
<DD><A NAME="IDX15"></A>
Initialize a network device via the <STRONG>RARP</STRONG> protocol.  This command
is only available if GRUB is compiled with netboot support. See also
section <A HREF="grub.html#SEC24">Downloading OS images from a network</A>.
</DL>

</P>



<H3><A NAME="SEC57" HREF="grub.html#TOC57">serial</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>serial</B> <I>[@option{--unit=unit}] [@option{--port=port}] \
[@option{--speed=speed}] [@option{--word=word}] [@option{--parity=parity}] \
[@option{--stop=stop}] [@option{--device=dev}]</I> <DD><A NAME="IDX16"></A>
Initialize a serial device. <VAR>unit</VAR> is a number in the range 0-3
specifying which serial port to use; default is 0, that corresponds
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 are 1 or 2. Default is 8 data bits
and one stop bit. <VAR>parity</VAR> is one of <SAMP>`no'</SAMP>, <SAMP>`odd'</SAMP>,
<SAMP>`even'</SAMP> and defaults to <SAMP>`no'</SAMP>. The option @option{--device}
can only be used in the grub shell and is used to specify the 
tty device to be used in the host operating system (see section <A \
HREF="grub.html#SEC105">Invoking the grub shell</A>).

</P>
<P>
The serial port is not used as a communication channel unless the
@command{terminal} command is used (see section <A \
HREF="grub.html#SEC59">terminal</A>).

</P>
<P>
This command is only available if GRUB is compiled with serial
support. See also section <A HREF="grub.html#SEC27">Using GRUB via a serial line</A>.
</DL>

</P>



<H3><A NAME="SEC58" HREF="grub.html#TOC58">setkey</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>setkey</B> <I>[to_key from_key]</I>
<DD><A NAME="IDX17"></A>
Change the keyboard map. The key <VAR>from_key</VAR> is mapped to the key
<VAR>to_key</VAR>. If no argument is specified, reset key mappings. Note that 
this command <EM>does not</EM> exchange the keys. If you want to exchange 
the keys, run this command again with the arguments exchanged, like this:

</P>

<PRE>
grub&#62; <KBD>setkey capslock control</KBD>
grub&#62; <KBD>setkey control capslock</KBD>
</PRE>

<P>
A key must be an alphabet, a digit, or one of these symbols:
<SAMP>`escape'</SAMP>, <SAMP>`exclam'</SAMP>, <SAMP>`at'</SAMP>, \
<SAMP>`numbersign'</SAMP>, <SAMP>`dollar'</SAMP>, <SAMP>`percent'</SAMP>, \
<SAMP>`caret'</SAMP>, <SAMP>`ampersand'</SAMP>, <SAMP>`asterisk'</SAMP>, \
<SAMP>`parenleft'</SAMP>, <SAMP>`parenright'</SAMP>, <SAMP>`minus'</SAMP>, \
<SAMP>`underscore'</SAMP>, <SAMP>`equal'</SAMP>, <SAMP>`plus'</SAMP>, \
<SAMP>`backspace'</SAMP>, <SAMP>`tab'</SAMP>, <SAMP>`bracketleft'</SAMP>, \
<SAMP>`braceleft'</SAMP>, <SAMP>`bracketright'</SAMP>, <SAMP>`braceright'</SAMP>, \
<SAMP>`enter'</SAMP>, <SAMP>`control'</SAMP>, <SAMP>`semicolon'</SAMP>, \
<SAMP>`colon'</SAMP>, <SAMP>`quote'</SAMP>, <SAMP>`doublequote'</SAMP>, \
<SAMP>`backquote'</SAMP>, <SAMP>`tilde'</SAMP>, <SAMP>`shift'</SAMP>, \
<SAMP>`backslash'</SAMP>, <SAMP>`bar'</SAMP>, <SAMP>`comma'</SAMP>, \
<SAMP>`less'</SAMP>, <SAMP>`period'</SAMP>, <SAMP>`greater'</SAMP>, \
<SAMP>`slash'</SAMP>, <SAMP>`question'</SAMP>, <SAMP>`alt'</SAMP>, \
<SAMP>`space'</SAMP>, <SAMP>`capslock'</SAMP>, <SAMP>`FX'</SAMP> (<SAMP>`X'</SAMP> is \
a digit), and <SAMP>`delete'</SAMP>. This table describes to which character each of \
the symbols corresponds:

</P>
<DL COMPACT>

<DT><SAMP>`exclam'</SAMP>
<DD>
<SAMP>`!'</SAMP>

<DT><SAMP>`at'</SAMP>
<DD>
<SAMP>`@'</SAMP>

<DT><SAMP>`numbersign'</SAMP>
<DD>
<SAMP>`#'</SAMP>

<DT><SAMP>`dollar'</SAMP>
<DD>
<SAMP>`$'</SAMP>

<DT><SAMP>`percent'</SAMP>
<DD>
<SAMP>`%'</SAMP>

<DT><SAMP>`caret'</SAMP>
<DD>
<SAMP>`^'</SAMP>

<DT><SAMP>`ampersand'</SAMP>
<DD>
<SAMP>`&#38;'</SAMP>

<DT><SAMP>`asterisk'</SAMP>
<DD>
<SAMP>`*'</SAMP>

<DT><SAMP>`parenleft'</SAMP>
<DD>
<SAMP>`('</SAMP>

<DT><SAMP>`parenright'</SAMP>
<DD>
<SAMP>`)'</SAMP>

<DT><SAMP>`minus'</SAMP>
<DD>
<SAMP>`-'</SAMP>

<DT><SAMP>`underscore'</SAMP>
<DD>
<SAMP>`_'</SAMP>

<DT><SAMP>`equal'</SAMP>
<DD>
<SAMP>`='</SAMP>

<DT><SAMP>`plus'</SAMP>
<DD>
<SAMP>`+'</SAMP>

<DT><SAMP>`bracketleft'</SAMP>
<DD>
<SAMP>`['</SAMP>

<DT><SAMP>`braceleft'</SAMP>
<DD>
<SAMP>`{'</SAMP>

<DT><SAMP>`bracketright'</SAMP>
<DD>
<SAMP>`]'</SAMP>

<DT><SAMP>`braceright'</SAMP>
<DD>
<SAMP>`}'</SAMP>

<DT><SAMP>`semicolon'</SAMP>
<DD>
<SAMP>`;'</SAMP>

<DT><SAMP>`colon'</SAMP>
<DD>
<SAMP>`:'</SAMP>

<DT><SAMP>`quote'</SAMP>
<DD>
<SAMP>`''</SAMP>

<DT><SAMP>`doublequote'</SAMP>
<DD>
<SAMP>`"'</SAMP>

<DT><SAMP>`backquote'</SAMP>
<DD>
<SAMP>``'</SAMP>

<DT><SAMP>`tilde'</SAMP>
<DD>
<SAMP>`~'</SAMP>

<DT><SAMP>`backslash'</SAMP>
<DD>
<SAMP>`\'</SAMP>

<DT><SAMP>`bar'</SAMP>
<DD>
<SAMP>`|'</SAMP>

<DT><SAMP>`comma'</SAMP>
<DD>
<SAMP>`,'</SAMP>

<DT><SAMP>`less'</SAMP>
<DD>
<SAMP>`&#60;'</SAMP>

<DT><SAMP>`period'</SAMP>
<DD>
<SAMP>`.'</SAMP>

<DT><SAMP>`greater'</SAMP>
<DD>
<SAMP>`&#62;'</SAMP>

<DT><SAMP>`slash'</SAMP>
<DD>
<SAMP>`/'</SAMP>

<DT><SAMP>`question'</SAMP>
<DD>
<SAMP>`?'</SAMP>

<DT><SAMP>`space'</SAMP>
<DD>
<SAMP>` '</SAMP>
</DL>
</DL>



<H3><A NAME="SEC59" HREF="grub.html#TOC59">terminal</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>terminal</B> <I>[@option{--dumb}] [@option{--timeout=secs}] \
[@option{console}] [@option{serial}] [@option{hercules}]</I> <DD><A NAME="IDX18"></A>
Select a terminal for user interaction. The terminal is assumed to be
VT100-compatible unless @option{--dumb} is specified. If both
@option{console} and @option{serial} are specified, then GRUB will use
the one where a key is entered first or the first when the timeout
expires. If neither are specified, the current setting is
reported. This command is only available if GRUB is compiled with serial
support. See also section <A HREF="grub.html#SEC27">Using GRUB via a serial line</A>.

</P>
<P>
This may not make sense for most users, but GRUB supports Hercules
console as well. Hercules console is usable like the ordinary console,
and the usage is quite similar to that for serial terminals: specify
@option{hercules} as the argument.
</DL>

</P>



<H3><A NAME="SEC60" HREF="grub.html#TOC60">tftpserver</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>tftpserver</B> <I>ipaddr</I>
<DD><A NAME="IDX19"></A>
<STRONG>Caution:</STRONG> This command exists only for backward
compatibility. Use @command{ifconfig} (see section <A \
HREF="grub.html#SEC52">ifconfig</A>) instead.

</P>
<P>
Override a TFTP server address returned by a BOOTP/DHCP/RARP server. The
argument <VAR>ipaddr</VAR> must be in dotted decimal format, like
<SAMP>`192.168.0.15'</SAMP>.  This command is only available if GRUB is compiled
with netboot support. See also section <A HREF="grub.html#SEC24">Downloading OS \
images from a network</A>. </DL>

</P>



<H3><A NAME="SEC61" HREF="grub.html#TOC61">unhide</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>unhide</B> <I>partition</I>
<DD><A NAME="IDX20"></A>
Unhide the partition <VAR>partition</VAR> by clearing the <STRONG>hidden</STRONG> bit \
in its partition type code. This is useful only when booting DOS or Windows
and multiple primary partitions exist in one disk. See also
section <A HREF="grub.html#SEC21">DOS/Windows</A>.
</DL>

</P>



<H2><A NAME="SEC62" HREF="grub.html#TOC62">The list of command-line and menu entry \
commands</A></H2>

<P>
These commands are usable in the command-line and in menu entries.  If
you forget a command, you can run the command @command{help}
(see section <A HREF="grub.html#SEC77">help</A>).

</P>



<H3><A NAME="SEC63" HREF="grub.html#TOC63">blocklist</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>blocklist</B> <I>file</I>
<DD><A NAME="IDX21"></A>
Print the block list notation of the file <VAR>file</VAR>. See section <A \
HREF="grub.html#SEC33">How to specify block lists</A>. </DL>

</P>



<H3><A NAME="SEC64" HREF="grub.html#TOC64">boot</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>boot</B>
<DD><A NAME="IDX22"></A>
Boot the OS/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).
</DL>

</P>



<H3><A NAME="SEC65" HREF="grub.html#TOC65">cat</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>cat</B> <I>file</I>
<DD><A NAME="IDX23"></A>
Display the contents of the file <VAR>file</VAR>. This command may be useful
to remind you of your OS's root partition:

</P>

<PRE>
grub&#62; <KBD>cat /etc/fstab</KBD>
</PRE>

</DL>



<H3><A NAME="SEC66" HREF="grub.html#TOC66">chainloader</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>chainloader</B> <I>[@option{--force}] file</I>
<DD><A NAME="IDX24"></A>
Load <VAR>file</VAR> as a chain-loader. Like any other file loaded by the
filesystem code, it can use the blocklist notation to grab the first
sector of the current partition with <SAMP>`+1'</SAMP>. If you specify the
option @option{--force}, 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 (see section <A \
HREF="grub.html#SEC22">SCO UnixWare</A>). </DL>

</P>



<H3><A NAME="SEC67" HREF="grub.html#TOC67">cmp</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>cmp</B> <I>file1 file2</I>
<DD><A NAME="IDX25"></A>
Compare the file <VAR>file1</VAR> with the file <VAR>file2</VAR>. If they differ
in size, print the sizes like this:

</P>

<PRE>
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:

</P>

<PRE>
Differ at the offset 777: 0xbe [foo], 0xef [bar]
</PRE>

<P>
If they are completely identical, nothing will be printed.
</DL>

</P>



<H3><A NAME="SEC68" HREF="grub.html#TOC68">configfile</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>configfile</B> <I>file</I>
<DD><A NAME="IDX26"></A>
Load <VAR>file</VAR> as a configuration file.
</DL>

</P>



<H3><A NAME="SEC69" HREF="grub.html#TOC69">debug</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>debug</B>
<DD><A NAME="IDX27"></A>
Toggle debug mode (by default it is off). When debug mode is on, some
extra messages are printed to show disk activity. This global debug flag
is mainly useful for GRUB developers when testing new code.
</DL>

</P>



<H3><A NAME="SEC70" HREF="grub.html#TOC70">displayapm</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>displayapm</B>
<DD><A NAME="IDX28"></A>
Display APM BIOS information.
</DL>

</P>



<H3><A NAME="SEC71" HREF="grub.html#TOC71">displaymem</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>displaymem</B>
<DD><A NAME="IDX29"></A>
Display what GRUB thinks the system address space map of the machine is,
including all regions of physical RAM installed. GRUB's
<STRONG>upper/lower memory</STRONG> display uses the standard BIOS interface for
the available memory in the first megabyte, or <STRONG>lower memory</STRONG>, and a
synthesized number from various BIOS interfaces of the memory starting
at 1MB and going up to the first chipset hole for <STRONG>upper memory</STRONG>
(the standard PC <STRONG>upper memory</STRONG> interface is limited to reporting a
maximum of 64MB).
</DL>

</P>



<H3><A NAME="SEC72" HREF="grub.html#TOC72">embed</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>embed</B> <I>stage1_5 device</I>
<DD><A NAME="IDX30"></A>
Embed the Stage 1.5 <VAR>stage1_5</VAR> in the sectors after the MBR if
<VAR>device</VAR> is a drive, or in the <STRONG>boot loader</STRONG> area if \
<VAR>device</VAR> is a FFS partition or a ReiserFS partition.<A NAME="DOCF8" \
HREF="grub.html#FOOT8">(8)</A> Print the number of sectors which <VAR>stage1_5</VAR> \
occupies, if successful.

</P>
<P>
Usually, you don't need to run this command directly. See section <A \
HREF="grub.html#SEC96">setup</A>. </DL>

</P>



<H3><A NAME="SEC73" HREF="grub.html#TOC73">find</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>find</B> <I>filename</I>
<DD><A NAME="IDX31"></A>
Search for the file name <VAR>filename</VAR> in all of partitions and print
the list of the devices which contain the file. The file name
<VAR>filename</VAR> should be an absolute file name like
<CODE>/boot/grub/stage1</CODE>.
</DL>

</P>



<H3><A NAME="SEC74" HREF="grub.html#TOC74">fstest</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>fstest</B>
<DD><A NAME="IDX32"></A>
Toggle filesystem test mode.
Filesystem test mode, when turned on, prints out data corresponding to
all the device reads and what values are being sent to the low-level
routines. The format is <SAMP>`&#60;<VAR>partition-offset-sector</VAR>,
<VAR>byte-offset</VAR>, <VAR>byte-length</VAR>&#62;'</SAMP> for high-level reads \
inside a partition, and <SAMP>`[<VAR>disk-offset-sector</VAR>]'</SAMP> for low-level \
sector requests from the disk.
Filesystem test mode is turned off by any use of the @command{install}
(see section <A HREF="grub.html#SEC80">install</A>) or @command{testload} (see \
section <A HREF="grub.html#SEC97">testload</A>) commands. </DL>

</P>



<H3><A NAME="SEC75" HREF="grub.html#TOC75">geometry</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>geometry</B> <I>drive [cylinder head sector \
[total_sector]]</I> <DD><A NAME="IDX33"></A>
Print the information for the drive <VAR>drive</VAR>. In the grub shell, you
can set the geometry of the drive arbitrarily. The number of the
cylinders, the one of the heads, the one of the sectors and the one of
the total sectors are set to CYLINDER, HEAD, SECTOR and TOTAL_SECTOR,
respectively. If you omit TOTAL_SECTOR, then it will be calculated
based on the C/H/S values automatically.
</DL>

</P>



<H3><A NAME="SEC76" HREF="grub.html#TOC76">halt</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>halt</B> <I>@option{--no-apm}</I>
<DD><A NAME="IDX34"></A>
The command halts the computer. If the @option{--no-apm} option
is specified, no APM BIOS call is performed. Otherwise, the computer
is shut down using APM.
</DL>

</P>



<H3><A NAME="SEC77" HREF="grub.html#TOC77">help</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>help</B> <I>[pattern ...]</I>
<DD><A NAME="IDX35"></A>
Display helpful information about builtin commands. If you do not
specify <VAR>pattern</VAR>, this command shows short descriptions of all
available commands.  If you specify any <VAR>patterns</VAR>, it displays
longer information about each of the commands which match those
<VAR>patterns</VAR>.
</DL>

</P>



<H3><A NAME="SEC78" HREF="grub.html#TOC78">impsprobe</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>impsprobe</B>
<DD><A NAME="IDX36"></A>
Probe the Intel Multiprocessor Specification 1.1 or 1.4 configuration
table and boot the various CPUs which are found into a tight loop. This
command can be used only in the Stage 2.
</DL>

</P>



<H3><A NAME="SEC79" HREF="grub.html#TOC79">initrd</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>initrd</B> <I>file ...</I>
<DD><A NAME="IDX37"></A>
Load an initial ramdisk for a Linux format boot image and set the
appropriate parameters in the Linux setup area in memory. See also
section <A HREF="grub.html#SEC17">GNU/Linux</A>.
</DL>

</P>



<H3><A NAME="SEC80" HREF="grub.html#TOC80">install</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>install</B> <I>[@option{--force-lba}] \
[@option{--stage2=os_stage2_file}] stage1_file [@option{d}] dest_dev stage2_file \
[addr] [@option{p}] [config_file] [real_config_file]</I> <DD><A NAME="IDX38"></A>
This command is fairly complex, and you should not use this command
unless you are familiar with GRUB. Use @command{setup} (see section <A \
HREF="grub.html#SEC96">setup</A>) instead.

</P>
<P>
In short, it will perform a full install presuming the Stage 2 or Stage
1.5<A NAME="DOCF9" HREF="grub.html#FOOT9">(9)</A> is in its final install location.

</P>
<P>
In slightly more detail, it will load <VAR>stage1_file</VAR>, validate that
it is a GRUB Stage 1 of the right version number, install a blocklist for
loading <VAR>stage2_file</VAR> as a Stage 2. If the option @option{d} is
present, the Stage 1 will always look for the actual disk
<VAR>stage2_file</VAR> was installed on, rather than using the booting
drive. The Stage 2 will be loaded at address <VAR>addr</VAR>, which must be
<SAMP>`0x8000'</SAMP> for a true Stage 2, and <SAMP>`0x2000'</SAMP> for a Stage 1.5. \
If <VAR>addr</VAR> is not present, GRUB will determine the address
automatically. It then writes the completed Stage 1 to the first block
of the device <VAR>dest_dev</VAR>. If the options @option{p} or
<VAR>config_file</VAR> are present, then it reads the first block of stage2,
modifies it with the values of the partition <VAR>stage2_file</VAR> was found
on (for @option{p}) or places the string <VAR>config_file</VAR> into the area
telling the stage2 where to look for a configuration file at boot
time. Likewise, if <VAR>real_config_file</VAR> is present and
<VAR>stage2_file</VAR> is a Stage 1.5, then the Stage 2 <VAR>config_file</VAR> is
patched with the configuration file name <VAR>real_config_file</VAR>. This
command preserves the DOS BPB (and for hard disks, the partition table)
of the sector the Stage 1 is to be installed into.

</P>
<P>
<STRONG>Caution:</STRONG> Several buggy BIOSes don't pass a booting drive
properly when booting from a hard disk drive. Therefore, you will have
to specify the option @option{d}, whether your Stage2 resides at the
booting drive or not, if you have such a BIOS unfortunately. We know
these are defective in that:

</P>
<DL COMPACT>

<DT>
<DD>
Fujitsu LifeBook 400 BIOS version 31J0103A

<DT>
<DD>
HP Vectra XU 6/200 BIOS version GG.06.11
</DL>

<P>
<STRONG>Caution2:</STRONG> A number of BIOSes don't return a correct LBA support
bitmap even if they do have the support. So GRUB provides a solution to
ignore the wrong bitmap, that is, the option @option{--force-lba}. Don't
use this option if you know that your BIOS doesn't have LBA support.

</P>
<P>
<STRONG>Caution3:</STRONG> You must specify the option @option{--stage2} in the
grub shell, if you cannot unmount the filesystem where your stage2 file
resides. The argument should be the file name in your operating system.
</DL>

</P>



<H3><A NAME="SEC81" HREF="grub.html#TOC81">ioprobe</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>ioprobe</B> <I>drive</I>
<DD><A NAME="IDX39"></A>
Probe I/O ports used for the drive <VAR>drive</VAR>. This command will list
the I/O ports on the screen. For technical information,
See section <A HREF="grub.html#SEC116">Hacking GRUB</A>.
</DL>

</P>



<H3><A NAME="SEC82" HREF="grub.html#TOC82">kernel</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>kernel</B> <I>[@option{--type=type}] \
[@option{--no-mem-option}] file ...</I> <DD><A NAME="IDX40"></A>
Attempt to load the primary boot image (Multiboot a.out or ELF,
Linux zImage or bzImage, FreeBSD a.out, NetBSD a.out, etc.) from
<VAR>file</VAR>. The rest of the line is passed verbatim as the <STRONG>kernel
command-line</STRONG>. Any modules must be reloaded after using this command.

</P>
<P>
This command also accepts the option @option{--type} so that you can
specify the kernel type of <VAR>file</VAR> explicitly. The argument
<VAR>type</VAR> must be one of these: <SAMP>`netbsd'</SAMP>, <SAMP>`freebsd'</SAMP>,
<SAMP>`openbsd'</SAMP>, <SAMP>`linux'</SAMP>, <SAMP>`biglinux'</SAMP>, and
<SAMP>`multiboot'</SAMP>. However, you need to specify it only if you want to
load a NetBSD ELF kernel, because GRUB can automatically determine
a kernel type in the other cases, quite safely.

</P>
<P>
The option @option{--no-mem-option} is effective only for Linux. If the
option is specified, GRUB doesn't pass the option @option{mem=} to the
kernel.
</DL>

</P>



<H3><A NAME="SEC83" HREF="grub.html#TOC83">lock</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>lock</B>
<DD><A NAME="IDX41"></A>
Prevent normal users from executing arbitrary menu entries. You must use
the command @command{password} if you really want this command to be
useful (see section <A HREF="grub.html#SEC55">password</A>).

</P>
<P>
This command is used in a menu, as shown in this example:

</P>

<PRE>
title This entry is too dangerous to be executed by normal users
lock
root (hd0,a)
kernel /no-security-os
</PRE>

<P>
See also section <A HREF="grub.html#SEC28">Protecting your computer from \
cracking</A>. </DL>

</P>



<H3><A NAME="SEC84" HREF="grub.html#TOC84">makeactive</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>makeactive</B>
<DD><A NAME="IDX42"></A>
Set the active partition on the root disk to GRUB's root device.
This command is limited to <EM>primary</EM> PC partitions on a hard disk.
</DL>

</P>



<H3><A NAME="SEC85" HREF="grub.html#TOC85">map</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>map</B> <I>to_drive from_drive</I>
<DD><A NAME="IDX43"></A>
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. Here is an example:

</P>

<PRE>
grub&#62; <KBD>map (hd0) (hd1)</KBD>
grub&#62; <KBD>map (hd1) (hd0)</KBD>
</PRE>

<P>
The example exchanges the order between the first hard disk and the
second hard disk. See also section <A HREF="grub.html#SEC21">DOS/Windows</A>.
</DL>

</P>



<H3><A NAME="SEC86" HREF="grub.html#TOC86">md5crypt</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>md5crypt</B>
<DD><A NAME="IDX44"></A>
Prompt to enter a password, and encrypt it in MD5 format. The encrypted
password can be used with the command @command{password}
(see section <A HREF="grub.html#SEC55">password</A>). See also section <A \
HREF="grub.html#SEC28">Protecting your computer from cracking</A>. </DL>

</P>



<H3><A NAME="SEC87" HREF="grub.html#TOC87">module</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>module</B> <I>file ...</I>
<DD><A NAME="IDX45"></A>
Load a boot module <VAR>file</VAR> for a Multiboot format boot image (no
interpretation of the file contents are made, so that user of this
command must know what the kernel in question expects). The rest of the
line is passed as the <STRONG>module command-line</STRONG>, like the
@command{kernel} command. You must load a Multiboot kernel image before
loading any module. See also section <A HREF="grub.html#SEC88">modulenounzip</A>.
</DL>

</P>



<H3><A NAME="SEC88" HREF="grub.html#TOC88">modulenounzip</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>modulenounzip</B> <I>file ...</I>
<DD><A NAME="IDX46"></A>
The same as @command{module} (see section <A HREF="grub.html#SEC87">module</A>), \
except that automatic decompression is disabled.
</DL>

</P>



<H3><A NAME="SEC89" HREF="grub.html#TOC89">pause</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>pause</B> <I>message ...</I>
<DD><A NAME="IDX47"></A>
Print the <VAR>message</VAR>, then wait until a key is pressed. Note that
placing <KBD>^G</KBD> (ASCII code 7) in the message will cause the speaker to
emit the standard beep sound, which is useful when prompting the user to
change floppies.
</DL>

</P>



<H3><A NAME="SEC90" HREF="grub.html#TOC90">quit</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>quit</B>
<DD><A NAME="IDX48"></A>
Exit from the grub shell @command{grub} (see section <A \
HREF="grub.html#SEC105">Invoking the grub shell</A>). This command can be used only \
in the grub shell. </DL>

</P>



<H3><A NAME="SEC91" HREF="grub.html#TOC91">reboot</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>reboot</B>
<DD><A NAME="IDX49"></A>
Reboot the computer.
</DL>

</P>



<H3><A NAME="SEC92" HREF="grub.html#TOC92">read</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>read</B> <I>addr</I>
<DD><A NAME="IDX50"></A>
Read a 32-bit value from memory at address <VAR>addr</VAR> and display it in
hex format.
</DL>

</P>



<H3><A NAME="SEC93" HREF="grub.html#TOC93">root</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>root</B> <I>device [hdbias]</I>
<DD><A NAME="IDX51"></A>
Set the current <STRONG>root device</STRONG> to the device <VAR>device</VAR>, then
attempt to mount it to get the partition size (for passing the partition
descriptor in <CODE>ES:ESI</CODE>, used by some chain-loaded boot loaders), the
BSD drive-type (for booting BSD kernels using their native boot format),
and correctly determine the PC partition where a BSD sub-partition is
located. The optional <VAR>hdbias</VAR> parameter is a number to tell a BSD
kernel how many BIOS drive numbers are on controllers before the current
one. For example, if there is an IDE disk and a SCSI disk, and your
FreeBSD root partition is on the SCSI disk, then use a <SAMP>`1'</SAMP> for
<VAR>hdbias</VAR>.

</P>
<P>
See also section <A HREF="grub.html#SEC94">rootnoverify</A>.
</DL>

</P>



<H3><A NAME="SEC94" HREF="grub.html#TOC94">rootnoverify</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>rootnoverify</B> <I>device [hdbias]</I>
<DD><A NAME="IDX52"></A>
Similar to @command{root} (see section <A HREF="grub.html#SEC93">root</A>), but don't \
attempt to mount the partition. This is useful for when an OS is outside of the area \
of the disk that GRUB can read, but setting the correct root device is still
desired. Note that the items mentioned in @command{root} above which
derived from attempting the mount will <EM>not</EM> work correctly.
</DL>

</P>



<H3><A NAME="SEC95" HREF="grub.html#TOC95">savedefault</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>savedefault</B>
<DD><A NAME="IDX53"></A>
Save the current menu entry as a default entry. Here is an example:

</P>

<PRE>
default saved
timeout 10

title GNU/Linux
root (hd0,0)
kernel /boot/vmlinuz root=/dev/sda1 vga=ext
initrd /boot/initrd
savedefault

title FreeBSD
root (hd0,a)
kernel /boot/loader
savedefault
</PRE>

<P>
With this configuration, GRUB will choose the entry booted previously as
the default entry. See also section <A HREF="grub.html#SEC41">default</A>.
</DL>

</P>



<H3><A NAME="SEC96" HREF="grub.html#TOC96">setup</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>setup</B> <I>[@option{--force-lba}] \
[@option{--stage2=os_stage2_file}] [@option{--prefix=dir}] install_device \
[image_device]</I> <DD><A NAME="IDX54"></A>
Set up the installation of GRUB automatically. This command uses the
more flexible command @command{install} (see section <A \
HREF="grub.html#SEC80">install</A>) in the backend and installs GRUB into the device \
<VAR>install_device</VAR>. If <VAR>image_device</VAR> is specified, then find the \
GRUB images (see section <A HREF="grub.html#SEC29">GRUB image files</A>) in the \
device <VAR>image_device</VAR>, otherwise use the current <STRONG>root \
device</STRONG>, which can be set by the command @command{root}. If \
<VAR>install_device</VAR> is a hard disk, then embed a Stage 1.5 in the disk if \
possible.

</P>
<P>
The option @option{--prefix} specifies the directory under which GRUB
images are put. If it is not specified, GRUB automatically searches them
in <TT>`/boot/grub'</TT> and <TT>`/grub'</TT>.

</P>
<P>
The options @option{--force-lba} and @option{--stage2} are just passed
to @command{install} if specified. See section <A HREF="grub.html#SEC80">install</A>, \
for more information.
</DL>

</P>



<H3><A NAME="SEC97" HREF="grub.html#TOC97">testload</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>testload</B> <I>file</I>
<DD><A NAME="IDX55"></A>
Read the entire contents of <VAR>file</VAR> in several different ways and
compares them, to test the filesystem code. The output is somewhat
cryptic, but if no errors are reported and the final <SAMP>`i=<VAR>X</VAR>,
filepos=<VAR>Y</VAR>'</SAMP> reading has <VAR>X</VAR> and <VAR>Y</VAR> equal, then it \
is definitely consistent, and very likely works correctly subject to a
consistent offset error. If this test succeeds, then a good next step is
to try loading a kernel.
</DL>

</P>



<H3><A NAME="SEC98" HREF="grub.html#TOC98">testvbe</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>testvbe</B> <I>mode</I>
<DD><A NAME="IDX56"></A>
Test the VESA BIOS EXTENSION mode <VAR>mode</VAR>. This command will switch
your video card to the graphics mode, and show an endless animation. Hit
any key to return. See also section <A HREF="grub.html#SEC100">vbeprobe</A>.
</DL>

</P>



<H3><A NAME="SEC99" HREF="grub.html#TOC99">uppermem</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>uppermem</B> <I>kbytes</I>
<DD><A NAME="IDX57"></A>
Force GRUB to assume that only <VAR>kbytes</VAR> kilobytes of upper memory
are installed. Any system address range maps are discarded.

</P>
<P>
<STRONG>Caution:</STRONG> This should be used with great caution, and should
only be necessary on some old machines. GRUB's BIOS probe can pick up
all RAM on all new machines the author has ever heard of. It can
also be used for debugging purposes to lie to an OS.
</DL>

</P>



<H3><A NAME="SEC100" HREF="grub.html#TOC100">vbeprobe</A></H3>

<P>
<DL>
<DT><U>Command:</U> <B>vbeprobe</B> <I>[mode]</I>
<DD><A NAME="IDX58"></A>
Probe VESA BIOS EXTENSION information. If the mode <VAR>mode</VAR> is
specified, show only the information about <VAR>mode</VAR>. Otherwise, this
command lists up available VBE modes on the screen. See also
section <A HREF="grub.html#SEC98">testvbe</A>.
</DL>

</P>



<H1><A NAME="SEC101" HREF="grub.html#TOC101">Error messages reported by GRUB</A></H1>

<P>
This chapter describes error messages reported by GRUB when you
encounter trouble. See section <A HREF="grub.html#SEC105">Invoking the grub \
shell</A>, if your problem is specific to the grub shell.

</P>



<H2><A NAME="SEC102" HREF="grub.html#TOC102">Errors reported by the Stage 1</A></H2>

<P>
The general way that the Stage 1 handles errors is to print an error
string and then halt. Pressing \
<KBD><KBD>CTRL</KBD>-<KBD>ALT</KBD>-<KBD>DEL</KBD></KBD> will reboot.

</P>
<P>
The following is a comprehensive list of error messages for the Stage 1:

</P>
<DL COMPACT>

<DT>Hard Disk Error
<DD>
The stage2 or stage1.5 is being read from a hard disk, and the attempt
to determine the size and geometry of the hard disk failed.

<DT>Floppy Error
<DD>
The stage2 or stage1.5 is being read from a floppy disk, and the attempt
to determine the size and geometry of the floppy disk failed. It's listed
as a separate error since the probe sequence is different than for hard
disks.

<DT>Read Error
<DD>
A disk read error happened while trying to read the stage2 or stage1.5.

<DT>Geom Error
<DD>
The location of the stage2 or stage1.5 is not in the portion of the disk
supported directly by the BIOS read calls.  This could occur because the
BIOS translated geometry has been changed by the user or the disk is
moved to another machine or controller after installation, or GRUB was
not installed using itself (if it was, the Stage 2 version of this error
would have been seen during that process and it would not have completed
the install).
</DL>



<H2><A NAME="SEC103" HREF="grub.html#TOC103">Errors reported by the Stage \
1.5</A></H2>

<P>
The general way that the Stage 1.5 handles errors is to print an error
number in the form <CODE>Error <VAR>num</VAR></CODE> and then halt. Pressing
<KBD><KBD>CTRL</KBD>-<KBD>ALT</KBD>-<KBD>DEL</KBD></KBD> will reboot.

</P>
<P>
The error numbers correspond to the errors reported by Stage
2. See section <A HREF="grub.html#SEC104">Errors reported by the Stage 2</A>.

</P>



<H2><A NAME="SEC104" HREF="grub.html#TOC104">Errors reported by the Stage 2</A></H2>

<P>
The general way that the Stage 2 handles errors is to abort the
operation in question, print an error string, then (if possible) either
continue based on the fact that an error occurred or wait for the user to
deal with the error.

</P>
<P>
The following is a comprehensive list of error messages for the Stage 2
(error numbers for the Stage 1.5 are listed before the colon in each
description):

</P>
<DL COMPACT>

<DT>1 : Filename must be either an absolute filename or blocklist
<DD>
This error is returned if a file name is requested which doesn't fit the
syntax/rules listed in the section <A HREF="grub.html#SEC30">Filesystem syntax and \
semantics</A>.

<DT>2 : Bad file or directory type
<DD>
This error is returned if a file requested is not a regular file, but
something like a symbolic link, directory, or FIFO.

<DT>3 : Bad or corrupt data while decompressing file
<DD>
This error is returned if the run-length decompression code gets an
internal error. This is usually from a corrupt file.

<DT>4 : Bad or incompatible header in compressed file
<DD>
This error is returned if the file header for a supposedly compressed
file is bad.

<DT>5 : Partition table invalid or corrupt
<DD>
This error is returned if the sanity checks on the integrity of the
partition table fail. This is a bad sign.

<DT>6 : Mismatched or corrupt version of stage1/stage2
<DD>
This error is returned if the install command is pointed to incompatible
or corrupt versions of the stage1 or stage2. It can't detect corruption
in general, but this is a sanity check on the version numbers, which
should be correct.

<DT>7 : Loading below 1MB is not supported
<DD>
This error is returned if the lowest address in a kernel is below the
1MB boundary. The Linux zImage format is a special case and can be
handled since it has a fixed loading address and maximum size.

<DT>8 : Kernel must be loaded before booting
<DD>
This error is returned if GRUB is told to execute the boot sequence
without having a kernel to start.

<DT>9 : Unknown boot failure
<DD>
This error is returned if the boot attempt did not succeed for reasons
which are unknown.

<DT>10 : Unsupported Multiboot features requested
<DD>
This error is returned when the Multiboot features word in the Multiboot
header requires a feature that is not recognized. The point of this is
that the kernel requires special handling which GRUB is likely unable to
provide.

<DT>11 : Unrecognized device string
<DD>
This error is returned if a device string was expected, and the string
encountered didn't fit the syntax/rules listed in the section <A \
HREF="grub.html#SEC30">Filesystem syntax and semantics</A>.

<DT>12 : Invalid device requested
<DD>
This error is returned if a device string is recognizable but does not
fall under the other device errors.

<DT>13 : Invalid or unsupported executable format
<DD>
This error is returned if the kernel image being loaded is not
recognized as Multiboot or one of the supported native formats (Linux
zImage or bzImage, FreeBSD, or NetBSD).

<DT>14 : Filesystem compatibility error, cannot read whole file
<DD>
Some of the filesystem reading code in GRUB has limits on the length of
the files it can read. This error is returned when the user runs into
such a limit.

<DT>15 : File not found
<DD>
This error is returned if the specified file name cannot be found, but
everything else (like the disk/partition info) is OK.

<DT>16 : Inconsistent filesystem structure
<DD>
This error is returned by the filesystem code to denote an internal
error caused by the sanity checks of the filesystem structure on disk
not matching what it expects. This is usually caused by a corrupt
filesystem or bugs in the code handling it in GRUB.

<DT>17 : Cannot mount selected partition
<DD>
This error is returned if the partition requested exists, but the
filesystem type cannot be recognized by GRUB.

<DT>18 : Selected cylinder exceeds maximum supported by BIOS
<DD>
This error is returned when a read is attempted at a linear block
address beyond the end of the BIOS translated area. This generally
happens if your disk is larger than the BIOS can handle (512MB for
(E)IDE disks on older machines or larger than 8GB in general).

<DT>19 : Linux kernel must be loaded before initrd
<DD>
This error is returned if the initrd command is used before loading a
Linux kernel. Similar to the above error, it only makes sense in that
case anyway.

<DT>20 : Multiboot kernel must be loaded before modules
<DD>
This error is returned if the module load command is used before loading
a Multiboot kernel. It only makes sense in this case anyway, as GRUB has
no idea how to communicate the presence of location of such modules to a
non-Multiboot-aware kernel.

<DT>21 : Selected disk does not exist
<DD>
This error is returned if the device part of a device- or full file name
refers to a disk or BIOS device that is not present or not recognized by
the BIOS in the system.

<DT>22 : No such partition
<DD>
This error is returned if a partition is requested in the device part of
a device- or full file name which isn't on the selected disk.

<DT>23 : Error while parsing number
<DD>
This error is returned if GRUB was expecting to read a number and
encountered bad data.

<DT>24 : Attempt to access block outside partition
<DD>
This error is returned if a linear block address is outside of the disk
partition. This generally happens because of a corrupt filesystem on the
disk or a bug in the code handling it in GRUB (it's a great debugging
tool).

<DT>25 : Disk read error
<DD>
This error is returned if there is a disk read error when trying to
probe or read data from a particular disk.

<DT>26 : Too many symbolic links
<DD>
This error is returned if the link count is beyond the maximum
(currently 5), possibly the symbolic links are looped.

<DT>27 : Unrecognized command
<DD>
This error is returned if an unrecognized command is entered into the
command-line or in a boot sequence section of a configuration file and
that entry is selected.

<DT>28 : Selected item cannot fit into memory
<DD>
This error is returned if a kernel, module, or raw file load command is
either trying to load its data such that it won't fit into memory or it
is simply too big.

<DT>29 : Disk write error
<DD>
This error is returned if there is a disk write error when trying to
write to a particular disk. This would generally only occur during an
install of set active partition command.

<DT>30 : Invalid argument
<DD>
This error is returned if an argument specified to a command is invalid.

<DT>31 : File is not sector aligned
<DD>
This error may occur only when you access a ReiserFS partition by
block-lists (e.g. the command @command{install}). In this case, you
should mount the partition with the <SAMP>`-o notail'</SAMP> option.

<DT>32 : Must be authenticated
<DD>
This error is returned if you try to run a locked entry. You should
enter a correct password before running such an entry.
</DL>



<H1><A NAME="SEC105" HREF="grub.html#TOC105">Invoking the grub shell</A></H1>

<P>
This chapter documents the grub shell @command{grub}. Note that the grub
shell is an emulator; it doesn't run under the native environment, so it
sometimes does something wrong. Therefore, you shouldn't trust it too
much. If there is anything wrong with it, don't hesitate to try the
native GRUB environment, especially when it guesses a wrong map between
BIOS drives and OS devices.

</P>



<H2><A NAME="SEC106" HREF="grub.html#TOC106">Introduction into the grub \
shell</A></H2>

<P>
You can use the command @command{grub} for installing GRUB under your
operating systems and for a testbed when you add a new feature into GRUB
or when fix a bug. @command{grub} is almost the same as the Stage 2,
and, in fact, it shares the source code with the Stage 2 and you can use
the same commands (see section <A HREF="grub.html#SEC39">The list of available \
commands</A>) in @command{grub}. It is emulated by replacing BIOS calls with UNIX \
system calls and libc functions.

</P>
<P>
The command @command{grub} accepts the following options:

</P>
<DL COMPACT>

<DT>@option{--help}
<DD>
Print a summary of the command-line options and exit.

<DT>@option{--version}
<DD>
Print the version number of GRUB and exit.

<DT>@option{--verbose}
<DD>
Print some verbose messages for debugging purpose.

<DT>@option{--device-map=<VAR>file</VAR>}
<DD>
Use the device map file <VAR>file</VAR>. The format is described in
section <A HREF="grub.html#SEC108">The map between BIOS drives and OS devices</A>.

<DT>@option{--no-floppy}
<DD>
Do not probe any floppy drive. This option has no effect if the option
@option{--device-map} is specified (see section <A HREF="grub.html#SEC108">The map \
between BIOS drives and OS devices</A>).

<DT>@option{--probe-second-floppy}
<DD>
Probe the second floppy drive. If this option is not specified, the grub
shell does not probe it, as that sometimes takes a long time. If you
specify the device map file (see section <A HREF="grub.html#SEC108">The map between \
BIOS drives and OS devices</A>), the grub shell just ignores this option.

<DT>@option{--config-file=<VAR>file</VAR>}
<DD>
Read the configuration file <VAR>file</VAR> instead of
<TT>`/boot/grub/menu.lst'</TT>. The format is the same as the normal GRUB
syntax. See section <A HREF="grub.html#SEC30">Filesystem syntax and semantics</A>, \
for more information.

<DT>@option{--boot-drive=<VAR>drive</VAR>}
<DD>
Set the stage2 <VAR>boot_drive</VAR> to <VAR>drive</VAR>. This argument should be
an integer (decimal, octal or hexadecimal).

<DT>@option{--install-partition=<VAR>par</VAR>}
<DD>
Set the stage2 <VAR>install_partition</VAR> to <VAR>par</VAR>. This argument
should be an integer (decimal, octal or hexadecimal).

<DT>@option{--no-config-file}
<DD>
Do not use the configuration file even if it can be read.

<DT>@option{--no-curses}
<DD>
Do not use the curses interface even if it is available.

<DT>@option{--batch}
<DD>
This option has the same meaning as <SAMP>`--no-config-file --no-curses'</SAMP>.

<DT>@option{--read-only}
<DD>
Disable writing to any disk.

<DT>@option{--hold}
<DD>
Wait until a debugger will attach. This option is useful when you want
to debug the startup code.
</DL>



<H2><A NAME="SEC107" HREF="grub.html#TOC107">How to install GRUB via \
@command{grub}</A></H2>

<P>
The installation procedure is the same as under the <STRONG>native</STRONG> Stage
2. See section <A HREF="grub.html#SEC7">Installation</A>, for more information. The \
command @command{grub}-specific information is described here.

</P>
<P>
What you should be careful about is <STRONG>buffer cache</STRONG>. @command{grub}
makes use of raw devices instead of filesystems that your operating
systems serve, so there exists a potential problem that some cache
inconsistency may corrupt your filesystems. What we recommend is:

</P>

<UL>
<LI>

If you can unmount drives to which GRUB may write any amount of data,
unmount them before running @command{grub}.

<LI>

If a drive cannot be unmounted but can be mounted with the read-only
flag, mount it in read-only mode. That should be secure.

<LI>

If a drive must be mounted with the read-write flag, make sure that any
activity is not being done on it during running the command
@command{grub}.

<LI>

Reboot your operating system as soon as possible. Probably that is not
required if you follow these rules above, but reboot is the most secure
way.
</UL>

<P>
In addition, enter the command @command{quit} when you finish the
installation. That is <EM>very important</EM> because @command{quit} makes
the buffer cache consistent. Do not push <KBD>C-c</KBD>.

</P>
<P>
If you want to install GRUB non-interactively, specify <SAMP>`--batch'</SAMP>
option in the command-line. This is a simple example:

</P>

<PRE>
#!/bin/sh

# Use /usr/sbin/grub if you are on an older system.
/sbin/grub --batch &#60;&#60;EOT 1&#62;/dev/null 2&#62;/dev/null
root (hd0,0)
setup (hd0)
quit
EOT
</PRE>



<H2><A NAME="SEC108" HREF="grub.html#TOC108">The map between BIOS drives and OS \
devices</A></H2>

<P>
When you specify the option @option{--device-map} (see section <A \
HREF="grub.html#SEC106">Introduction into the grub shell</A>), the grub shell creates \
the <STRONG>device map file</STRONG> automatically unless it already exists. The file \
name <TT>`/boot/grub/device.map'</TT> is preferred.

</P>
<P>
If the device map file exists, the grub shell reads it to map BIOS
drives to OS devices. This file consists of lines like this:

</P>

<PRE>
<VAR>device</VAR> <VAR>file</VAR>
</PRE>

<P>
<VAR>device</VAR> is a drive, which syntax is the same as the one in GRUB
(see section <A HREF="grub.html#SEC31">How to specify devices</A>), and \
<VAR>file</VAR> is an OS's file, which is normally a device file.

</P>
<P>
The reason why the grub shell gives you the device map file is that it
cannot guess the map between BIOS drives and OS devices correctly in
some environments. For example, if you exchange the boot sequence
between IDE and SCSI in your BIOS, it mistakes the order.

</P>
<P>
Thus, edit the file if the grub shell makes a mistake. You can put any
comments in the file if needed, as the grub shell assumes that a line is
just a comment if the first character is <SAMP>`#'</SAMP>.

</P>



<H1><A NAME="SEC109" HREF="grub.html#TOC109">Invoking grub-install</A></H1>

<P>
The program @command{grub-install} installs GRUB on your drive by the
grub shell (see section <A HREF="grub.html#SEC105">Invoking the grub shell</A>). You \
must specify the device name on which you want to install GRUB, like this:

</P>

<PRE>
grub-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>
<P>
@command{grub-install} accepts the following options:

</P>
<DL COMPACT>

<DT>@option{--help}
<DD>
Print a summary of the command-line options and exit.

<DT>@option{--version}
<DD>
Print the version number of GRUB and exit.

<DT>@option{--force-lba}
<DD>
Force GRUB to use LBA mode even for a buggy BIOS. Use this option only
if your BIOS doesn't work in LBA mode even though it supports LBA mode.

<DT>@option{--root-directory=<VAR>dir</VAR>}
<DD>
Install GRUB images under the directory <VAR>dir</VAR> instead of the root
directory. This option is useful when you want to install GRUB into a
separate partition or a removable disk. Here is an example when you have
a separate <STRONG>boot</STRONG> partition which is mounted on <TT>`/boot'</TT>:


<PRE>
<KBD>grub-install --root-directory=/boot '(hd0)'</KBD>
</PRE>

<DT>@option{--grub-shell=<VAR>file</VAR>}
<DD>
Use <VAR>file</VAR> as the grub shell. You can append arbitrary options to
<VAR>file</VAR> after the file name, like this:


<PRE>
<KBD>grub-install --grub-shell="grub --read-only" /dev/fd0</KBD>
</PRE>

<DT>@option{--recheck}
<DD>
Recheck the device map, even if <TT>`/boot/grub/device.map'</TT> already
exists. You should use this option whenever you add/remove a disk
into/from your computer.
</DL>



<H1><A NAME="SEC110" HREF="grub.html#TOC110">Invoking grub-md5-crypt</A></H1>

<P>
The program @command{grub-md5-crypt} encrypts a password in MD5 format.
This is just a frontend of the grub shell (see section <A \
HREF="grub.html#SEC105">Invoking the grub shell</A>). Passwords encrypted by this \
program can be used with the command @command{password} (see section <A \
HREF="grub.html#SEC55">password</A>).

</P>
<P>
@command{grub-md5-crypt} accepts the following options:

</P>
<DL COMPACT>

<DT>@option{--help}
<DD>
Print a summary of the command-line options and exit.

<DT>@option{--version}
<DD>
Print the version information and exit.

<DT>@option{--grub-shell=<VAR>file</VAR>}
<DD>
Use <VAR>file</VAR> as the grub shell.
</DL>



<H1><A NAME="SEC111" HREF="grub.html#TOC111">Invoking mbchk</A></H1>

<P>
The program @command{mbchk} checks for the format of a Multiboot
kernel. We recommend using this program before booting your own kernel
by GRUB.

</P>
<P>
@command{mbchk} accepts the following options:

</P>
<DL COMPACT>

<DT>@option{--help}
<DD>
Print a summary of the command-line options and exit.

<DT>@option{--version}
<DD>
Print the version number of GRUB and exit.

<DT>@option{--quiet}
<DD>
Suppress all normal output.
</DL>



<H1><A NAME="SEC112" HREF="grub.html#TOC112">Frequently asked questions</A></H1>

<DL COMPACT>

<DT>How does GNU GRUB differ from Erich's original GRUB?
<DD>
GNU GRUB is the successor of Erich's great GRUB. He couldn't work on
GRUB because of some other tasks, so the current maintainers OKUJI
Yoshinori and Gordon Matzigkeit took over the maintainership, and opened
the development in order for everybody to participate it.

Technically speaking, GNU GRUB has many features that are not seen in
the original GRUB. For example, GNU GRUB can be installed on UNIX-like
operating system (such as GNU/Hurd) via the grub shell
<TT>`/sbin/grub'</TT> (or <TT>`/usr/sbin/grub'</TT> on older systems), it
supports Logical Block Address (LBA) mode that solves the 1024 cylinders
problem, and <KBD><KBD>TAB</KBD></KBD> completes a file name when it's unique. Of
course, many bug fixes are done as well, so it is recommended to use GNU
GRUB.

<DT>Can GRUB boot my operating system from over 8GB hard disks?
<DD>
That depends on your BIOS and your operating system. You must make
sure that your drive is accessible in LBA mode. Generally, that is
configurable in BIOS setting utility. Read the manual for your BIOS
for more information.

Furthermore, some operating systems (i.e. DOS) cannot access any large
disk, so the problem is not solved by any kind of boot loader. GNU/Hurd
and GNU/Linux can surely boot from such a large disk.

<DT>Can I put Stage2 into a partition which is over 1024 cylinders?
<DD>
Yes, if your BIOS supports the LBA mode.

<DT>How to create a GRUB boot floppy with the menu interface?
<DD>
The easiest way is:


<OL>
<LI>

Create filesystem in your floppy disk. For example:


<PRE>
$ mke2fs /dev/fd0
</PRE>

<LI>

Mount it on somewhere, say, <TT>`/mnt'</TT>.

<LI>

Copy the GRUB images to <TT>`/mnt/boot/grub'</TT>. Only <TT>`stage1'</TT>,
<TT>`stage2'</TT> and <TT>`menu.lst'</TT> are necessary. You may not copy
<STRONG>stage1.5</STRONG>s.

<LI>

Run the following command (substitute <TT>`/usr/sbin/grub'</TT> for
<TT>`/sbin/grub'</TT> if you are using an older system):


<PRE>
$ /sbin/grub --batch &#60;&#60;EOT
root (fd0)
setup (fd0)
quit
EOT
</PRE>

</OL>

<DT>How to specify a partition?
<DD>
See section <A HREF="grub.html#SEC31">How to specify devices</A>.

<DT>GRUB does not recognize my GNU/Hurd partition.
<DD>
I don't know why, but the authors of FDISK programs have assigned the
partition type <SAMP>`0x63'</SAMP> to GNU Hurd incorrectly. A partition type
should mean what format is used in the partition, such as filesystem and
BSD slices, and should not be used to represent what operating system
owns the partition. So use <SAMP>`0x83'</SAMP> if the partition contains ext2fs
filesystem, and use <SAMP>`0xA5'</SAMP> if the partition contains ffs
filesystem, whether the partition owner is Hurd or not. We will use
<SAMP>`0x63'</SAMP> for GNU Hurd filesystem that has not been implemented yet.

<DT>I've installed a recent version of binutils, but GRUB still crashes.
<DD>
Please check for the version of your binutils by this command:


<PRE>
<KBD>ld -v</KBD>
</PRE>

This will show two versions, but only the latter is important. If the
version is identical with what you have installed, the installation was
not bad.

Well, please try:


<PRE>
<KBD>gcc -Wl,-v 2&#62;&#38;1 | grep "GNU ld"</KBD>
</PRE>

If this is not identical with the result above, you should specify the
directory where you have installed binutils for the script configure,
like this:


<PRE>
<KBD>./configure --with-binutils=/usr/local/bin</KBD>
</PRE>

If you follow the instructions above but GRUB still crashes, probably
there is a serious bug in GRUB. See section <A HREF="grub.html#SEC114">Reporting \
bugs</A>.

<DT>GRUB hangs up when accessing my SCSI disk.
<DD>
Check if you have turned on the support for INT 13 extension (LBA). If
so, disable the support and see if GRUB can now access your SCSI
disk. This will make it clear that your SCSI BIOS sucks.

For now, we know the following doesn't provide working LBA mode:

<DL COMPACT>

<DT>
<DD>
Adaptec AIC-7880
</DL>

In the case where you have such a SCSI controller unfortunately, you
cannot use the LBA mode, though GRUB still works fine in the CHS mode
(so the well-known 1024 cylinders problem comes again to you).

<STRONG>Caution:</STRONG> Actually it has not been verified yet if this bug is
due to the SCSI BIOS or GRUB itself, frankly speaking. Because the
developers haven't seen it by their own eyes. This is why it is
desirable that you investigate the cause seriously if you have the
skill.

<DT>How can I specify an arbitrary memory size to Linux?
<DD>
Pass a <SAMP>`mem='</SAMP> option to your Linux kernel, like this:


<PRE>
grub&#62; <KBD>kernel /vmlinuz mem=128M</KBD>
</PRE>

You may pass other options in the same way. See See section <A \
HREF="grub.html#SEC17">GNU/Linux</A>, for more details.

<DT>I have a separate boot partition and GRUB doesn't recognize it.
<DD>
This is often reported as a <STRONG>bug</STRONG>, but this is not a bug
really. This is a feature.

Because GRUB is a boot loader and it normally runs under no operating
system, it doesn't know where a partition is mounted under your
operating systems. So, if you have the partition <TT>`/boot'</TT> and you
install GRUB images into the directory <TT>`/boot/grub'</TT>, GRUB
recognizes that the images lies under the directory <TT>`/grub'</TT> but not
<TT>`/boot/grub'</TT>. That's fine, since there is no guarantee that all of
your operating systems mount the same partition as <TT>`/boot'</TT>.

There are several solutions for this situation.


<OL>
<LI>

Install GRUB into the directory <TT>`/boot/boot/grub'</TT> instead of
<TT>`/boot/grub'</TT>. This may sound ugly but should work fine.

<LI>

Create a symbolic link before installing GRUB, like <SAMP>`cd /boot &#38;&#38; ln
-s . boot'</SAMP>. This works only if the filesystem of the boot partition
supports symbolic links and GRUB supports the feature as well.

<LI>

Install GRUB with the command @command{install}, to specify the paths of
GRUB images explicitly. Here is an example:


<PRE>
grub&#62; <KBD>root (hd0,1)</KBD>
grub&#62; <KBD>install /grub/stage1 d (hd0) /grub/stage2 p /grub/menu.lst</KBD>
</PRE>

</OL>

<DT>How to uninstall GRUB from my hard disk drive?
<DD>
There is no concept <STRONG>uninstall</STRONG> in boot loaders, because if you
<STRONG>uninstall</STRONG> a boot loader, an unbootable machine would simply
remain. So all you need to do is overwrite another boot loader you like
to your disk, that is, install the boot loader without uninstalling
GRUB.

For example, if you want to install the boot loader for Windows, just
run <CODE>FDISK /MBR</CODE> on Windows. If you want to install LILO<A NAME="DOCF10" \
HREF="grub.html#FOOT10">(10)</A>, run <CODE>/sbin/lilo</CODE> on GNU/Linux.

<DT>GRUB hangs when accessing my large IDE disk.
<DD>
If your disk is bigger than 32GB, probably updating your mainboard BIOS
will solve your problem. This bug is well-known and most vendors should
provide fixed versions. For example, if you have ASUS-P3BF, upgrading
the BIOS to V1007beta1 or later can fix it. Please ask your vendor, for
more information.

<DT>Why don't Linux, FreeBSD, NetBSD, etc. become Multiboot-compliant?
<DD>
Please ask the relevant maintainers. If all free kernels were
Multiboot-compliant (see section `Motivation' in <CITE>The Multiboot \
Specification</CITE>), the world would be an utopia...
</DL>



<H1><A NAME="SEC113" HREF="grub.html#TOC113">How to obtain and build GRUB</A></H1>


<BLOCKQUOTE>
<P>
<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://sourceware.cygnus.com/binutils/"><TT>http://sourceware.cygnus.com/binutils/</TT></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://alpha.gnu.org/gnu/grub"><TT>ftp://alpha.gnu.org/gnu/grub</TT></A> or \
any of its mirrors. The file will be named grub-version.tar.gz. The current version \
is 0.90, so the file you should grab is:

</P>
<P>
<A HREF="ftp://alpha.gnu.org/gnu/grub/grub-0.90.tar.gz"><TT>ftp://alpha.gnu.org/gnu/grub/grub-0.90.tar.gz</TT></A>


</P>
<P>
To unbundle GRUB use the instruction:

</P>

<PRE>
<KBD>zcat grub-0.90.tar.gz | tar xvf -</KBD>
</PRE>

<P>
which will create a directory called <TT>`grub-0.90'</TT> with
all the sources. You can look at the file <TT>`INSTALL'</TT> for detailed
instructions on how to build and install GRUB, but you should be able to
just do:

</P>

<PRE>
<KBD>cd grub-0.90</KBD>
<KBD>./configure</KBD>
<KBD>make install</KBD>
</PRE>

<P>
This will install the grub shell <TT>`grub'</TT> (see section <A \
HREF="grub.html#SEC105">Invoking the grub shell</A>), the Multiboot checker \
<TT>`mbchk'</TT> (see section <A HREF="grub.html#SEC111">Invoking mbchk</A>), and the \
GRUB images. This will also install the GRUB manual.

</P>
<P>
Also, the latest version is available from the CVS. The repository is:

</P>
<P>
<CODE>:pserver:anoncvs@subversions.gnu.org:/cvsroot/grub</CODE>

</P>
<P>
and the module is:

</P>
<P>
<CODE>grub</CODE>

</P>
<P>
The password for anoncvs is empty. So the instruction is:

</P>

<PRE>
<KBD>cvs -d :pserver:anoncvs@subversions.gnu.org:/cvsroot/grub login</KBD>
<KBD>Password: <KBD>ENTER</KBD></KBD>
<KBD>cvs -d :pserver:anoncvs@subversions.gnu.org:/cvsroot/grub co grub</KBD>
</PRE>



<H1><A NAME="SEC114" HREF="grub.html#TOC114">Reporting bugs</A></H1>

<P>
This is the guideline of how to report bugs. Take a look at this list
below before you send e-mail to <A \
HREF="mailto:bug-grub@gnu.org"><TT>bug-grub@gnu.org</TT></A>:

</P>

<OL>
<LI>

Before unsettled, read this manual through and through, in particular
See section <A HREF="grub.html#SEC112">Frequently asked questions</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 get troubled with the installation, inform us of how you
installed GRUB. Don't omit error messages, if any. Just <SAMP>`GRUB hangs
up when it boots'</SAMP> is not enough.

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>all</EM> on the
screen. Don't paraphrase them, like <SAMP>`The foo OS crashes with GRUB,
even though it can boot with the bar boot loader fine'</SAMP>. 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.

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 encounterred in our
environment. So your information should be sufficient for us to do the
same thing--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 quite better than omitting an important
thing.
</OL>

<P>
If you realize the guideline above, send e-mail to
<A HREF="mailto:bug-grub@gnu.org"><TT>bug-grub@gnu.org</TT></A>, and we will try to \
fix the bugs.

</P>



<H1><A NAME="SEC115" HREF="grub.html#TOC115">Where GRUB will go</A></H1>

<P>
Here are some ideas that might happen in the future:

</P>

<UL>
<LI>

Support dynamic loading.

<LI>

Add real memory management.

<LI>

Add a real scripting language.

<LI>

Support internationalization.

<LI>

Support other architectures than i386-pc.
</UL>

<P>
See the file <TT>`TODO'</TT> in the source distribution, for more
information.

</P>



<H1><A NAME="SEC116" HREF="grub.html#TOC116">Hacking GRUB</A></H1>

<P>
This chapter documents the user-invisible aspect of GRUB.

</P>
<P>
As a general rule of software development, it is impossible to keep the
descriptions of the internals up-to-date, and it is quite hard to
document everything. So refer to the source code, whenever you are not
satisfied with this documentation.  Please assume that this gives just
hints to you.

</P>



<H2><A NAME="SEC117" HREF="grub.html#TOC117">The memory map of various \
components</A></H2>

<P>
GRUB consists of two distinct components, called <STRONG>stages</STRONG>, which are
loaded at different times in the boot process. Because they run
mutual-exclusively, sometimes a memory area overlaps with another
memory area. And, even in one stage, a single memory area can be used
for various purposes, because their usages are mutually exclusive.

</P>
<P>
Here is the memory map of the various components:

</P>
<DL COMPACT>

<DT>0 to 4K-1
<DD>
BIOS and real mode interrupts

<DT>0x07BE to 0x07FF
<DD>
Partition table passed to another boot loader

<DT>down from 8K-1
<DD>
Real mode stack

<DT>0x2000 to ?
<DD>
The optional Stage 1.5 is loaded here

<DT>0x2000 to 0x7FFF
<DD>
Command-line buffer for Multiboot kernels and modules

<DT>0x7C00 to 0x7DFF
<DD>
Stage 1 is loaded here by BIOS or another boot loader

<DT>0x7F00 to 0x7F42
<DD>
LBA drive parameters

<DT>0x8000 to ?
<DD>
Stage2 is loaded here

<DT>The end of Stage 2 to 416K-1
<DD>
Heap, in particular used for the menu

<DT>down from 416K-1
<DD>
Protected mode stack

<DT>416K to 448K-1
<DD>
Filesystem buffer

<DT>448K to 479.5K-1
<DD>
Raw device buffer

<DT>479.5K to 480K-1
<DD>
512-byte scratch area

<DT>480K to 512K-1
<DD>
Buffers for various functions, such as password, command-line, cut and
paste, and completion.

<DT>The last 1K of lower memory
<DD>
Disk swapping code and data
</DL>

<P>
See the file <TT>`stage2/shared.h'</TT>, for more information.

</P>



<H2><A NAME="SEC118" HREF="grub.html#TOC118">Embedded variables in GRUB</A></H2>

<P>
Stage 1 and Stage 2 have embedded variables whose locations are
well-defined, so that the installation can patch the binary file
directly without recompilation of the stages.

</P>
<P>
In Stage 1, these are defined:

</P>
<DL COMPACT>

<DT><CODE>0x3E</CODE>
<DD>
The version number (not GRUB's, but the installation mechanism's).

<DT><CODE>0x40</CODE>
<DD>
The boot drive. If it is 0xFF, use a drive passed by BIOS.

<DT><CODE>0x41</CODE>
<DD>
The flag for if forcing LBA.

<DT><CODE>0x42</CODE>
<DD>
The starting address of Stage 2.

<DT><CODE>0x44</CODE>
<DD>
The first sector of Stage 2.

<DT><CODE>0x48</CODE>
<DD>
The starting segment of Stage 2.

<DT><CODE>0x1FE</CODE>
<DD>
The signature (<CODE>0xAA55</CODE>).
</DL>

<P>
See the file <TT>`stage1/stage1.S'</TT>, for more information.

</P>
<P>
In the first sector of Stage 1.5 and Stage 2, the block lists are
recorded between <CODE>firstlist</CODE> and <CODE>lastlist</CODE>. The address of
<CODE>lastlist</CODE> is determined when assembling the file
<TT>`stage2/start.S'</TT>.

</P>
<P>
The trick here is that it is actually read backward, and the first
8-byte block list is not read here, but after the pointer is decremented
8 bytes, then after reading it, it decrements again, reads, and so on,
until it is finished. The terminating condition is when the number of
sectors to be read in the next block list is zero.

</P>
<P>
The format of a block list can be seen from the example in the code just
before the <CODE>firstlist</CODE> label. Note that it is always from the
beginning of the disk, but <EM>not</EM> relative to the partition 
boundaries.

</P>
<P>
In the second sector of Stage 1.5 and Stage 2, these are defined:

</P>
<DL COMPACT>

<DT><CODE>0x6</CODE>
<DD>
The version number (likewise, the installation mechanism's).

<DT><CODE>0x8</CODE>
<DD>
The installed partition.

<DT><CODE>0xC</CODE>
<DD>
The saved entry number.

<DT><CODE>0x10</CODE>
<DD>
The identifier.

<DT><CODE>0x11</CODE>
<DD>
The flag for if forcing LBA.

<DT><CODE>0x12</CODE>
<DD>
The version string (GRUB's).

<DT><CODE>0x12</CODE> + <STRONG>the length of the version string</STRONG>
<DD>
The name of a configuration file.
</DL>

<P>
See the file <TT>`stage2/asm.S'</TT>, for more information.

</P>



<H2><A NAME="SEC119" HREF="grub.html#TOC119">The generic interface for \
filesystems</A></H2>

<P>
For any particular partition, it is presumed that only one of the
<STRONG>normal</STRONG> filesystems such as FAT, FFS, or ext2fs can be used, so
there is a switch table managed by the functions in
<TT>`disk_io.c'</TT>. The notation is that you can only <STRONG>mount</STRONG> one at \
a time.

</P>
<P>
The block list filesystem has a special place in the system. In addition
to the <STRONG>normal</STRONG> filesystem (or even without one mounted), you can
access disk blocks directly (in the indicated partition) via the block
list notation. Using the block list filesystem doesn't effect any other
filesystem mounts.

</P>
<P>
The variables which can be read by the filesystem backend are:

</P>
<DL COMPACT>

<DT><CODE>current_drive</CODE>
<DD>
<A NAME="IDX59"></A>
The current BIOS drive number (numbered from 0, if a floppy, and
numbered from 0x80, if a hard disk).

<DT><CODE>current_partition</CODE>
<DD>
<A NAME="IDX60"></A>
The current partition number.

<DT><CODE>current_slice</CODE>
<DD>
<A NAME="IDX61"></A>
The current partition type.

<DT><CODE>saved_drive</CODE>
<DD>
<A NAME="IDX62"></A>
The <STRONG>drive</STRONG> part of the root device.

<DT><CODE>saved_partition</CODE>
<DD>
<A NAME="IDX63"></A>
The <STRONG>partition</STRONG> part of the root device.

<DT><CODE>part_start</CODE>
<DD>
<A NAME="IDX64"></A>
The current partition starting address, in sectors.

<DT><CODE>part_length</CODE>
<DD>
<A NAME="IDX65"></A>
The current partition length, in sectors.

<DT><CODE>print_possibilities</CODE>
<DD>
<A NAME="IDX66"></A>
True when the <CODE>dir</CODE> function should print the possible completions
of a file, and false when it should try to actually open a file of that
name.

<DT><CODE>FSYS_BUF</CODE>
<DD>
<A NAME="IDX67"></A>
Filesystem buffer which is 32K in size, to use in any way which the
filesystem backend desires.
</DL>

<P>
The variables which need to be written by a filesystem backend are:

</P>
<DL COMPACT>

<DT><CODE>filepos</CODE>
<DD>
<A NAME="IDX68"></A>
The current position in the file, in sectors.

<STRONG>Caution:</STRONG> the value of <VAR>filepos</VAR> can be changed out from
under the filesystem code in the current implementation. Don't depend on
it being the same for later calls into the backend code!

<DT><CODE>filemax</CODE>
<DD>
<A NAME="IDX69"></A>
The length of the file.

<DT><CODE>disk_read_func</CODE>
<DD>
<A NAME="IDX70"></A>
The value of <VAR>disk_read_hook</VAR> <EM>only</EM> during reading of data
for the file, not any other fs data, inodes, FAT tables, whatever, then
set to <CODE>NULL</CODE> at all other times (it will be <CODE>NULL</CODE> by
default). If this isn't done correctly, then the @command{testload} and
@command{install} commands won't work correctly.
</DL>

<P>
The functions expected to be used by the filesystem backend are:

</P>
<DL COMPACT>

<DT><CODE>devread</CODE>
<DD>
<A NAME="IDX71"></A>
Only read sectors from within a partition. Sector 0 is the first sector
in the partition.

<DT><CODE>grub_read</CODE>
<DD>
<A NAME="IDX72"></A>
If the backend uses the block list code, then <CODE>grub_read</CODE> can be
used, after setting <VAR>block_file</VAR> to 1.

<DT><CODE>print_a_completion</CODE>
<DD>
<A NAME="IDX73"></A>
If <VAR>print_possibilities</VAR> is true, call <CODE>print_a_completion</CODE> for
each possible file name. Otherwise, the file name completion won't work.
</DL>

<P>
The functions expected to be defined by the filesystem backend are
described at least moderately in the file <TT>`filesys.h'</TT>. Their usage
is fairly evident from their use in the functions in <TT>`disk_io.c'</TT>,
look for the use of the <VAR>fsys_table</VAR> array.

</P>
<P>
<STRONG>Caution:</STRONG> The semantics are such that then <SAMP>`mount'</SAMP>ing \
the filesystem, presume the filesystem buffer <CODE>FSYS_BUF</CODE> is corrupted,
and (re-)load all important contents. When opening and reading a file,
presume that the data from the <SAMP>`mount'</SAMP> is available, and doesn't
get corrupted by the open/read (i.e. multiple opens and/or reads will be
done with only one mount if in the same filesystem).

</P>



<H2><A NAME="SEC120" HREF="grub.html#TOC120">The generic interface for \
built-ins</A></H2>

<P>
GRUB built-in commands are defined in a uniformal interface, whether
they are menu-specific or can be used anywhere. The definition of a
builtin command consists of two parts: the code itself and the table of
the information.

</P>
<P>
The code must be a function which takes two arguments, a command-line
string and flags, and returns an <SAMP>`int'</SAMP> value. The <STRONG>flags</STRONG>
argument specifies how the function is called, using a bit mask. The
return value must be zero if successful, otherwise non-zero. So it is
normally enough to return <VAR>errnum</VAR>.

</P>
<P>
The table of the information is represented by the structure
<CODE>struct builtin</CODE>, which contains the name of the command, a pointer
to the function, flags, a short description of the command and a long
description of the command. Since the descriptions are used only for
help messages interactively, you don't have to define them, if the
command may not be called interactively (such as @command{title}).

</P>
<P>
The table is finally registered in the table <VAR>builtin_table</VAR>, so
that <CODE>run_script</CODE> and <CODE>enter_cmdline</CODE> can find the
command. See the files <TT>`cmdline.c'</TT> and <TT>`builtins.c'</TT>, for more
details.

</P>



<H2><A NAME="SEC121" HREF="grub.html#TOC121">The bootstrap mechanism used in \
GRUB</A></H2>

<P>
The disk space can be used in a boot loader is very restricted because
a MBR (see section <A HREF="grub.html#SEC125">The structure of Master Boot \
Record</A>) is only 512 bytes but it also contains a partition table (see section <A \
HREF="grub.html#SEC126">The format of partition tables</A>) and a BPB. So the \
question is how to make a boot loader code enough small to be fit in a MBR.

</P>
<P>
However, GRUB is a very large program, so we break GRUB into 2 (or 3)
distinct components, <STRONG>Stage 1</STRONG> and <STRONG>Stage 2</STRONG> (and \
optionally <STRONG>Stage 1.5</STRONG>). See section <A HREF="grub.html#SEC117">The \
memory map of various components</A>, for more information.

</P>
<P>
We embed Stage 1 in a MBR or in the boot sector of a partition, and
place Stage 2 in a filesystem. The optional Stage 1.5 can be installed
in a filesystem, in the <STRONG>boot loader</STRONG> area in a FFS or a ReiserFS,
and in the sectors right after a MBR, because Stage 1.5 is enough small
and the sectors right after a MBR is normally an unused region. The size
of this region is the number of sectors per head minus 1.

</P>
<P>
Thus, all Stage1 must do is just load Stage2 or Stage1.5. But even if
Stage 1 needs not to support the user interface or the filesystem
interface, it is impossible to make Stage 1 less than 400 bytes, because
GRUB should support both the CHS mode and the LBA mode (see section <A \
HREF="grub.html#SEC124">INT 13H disk I/O interrupts</A>).

</P>
<P>
The solution used by GRUB is that Stage 1 loads only the first sector of
Stage 2 (or Stage 1.5) and Stage 2 itself loads the rest. The flow of
Stage 1 is:

</P>

<OL>
<LI>

Initialize the system briefly.

<LI>

Detect the geometry and the accessing mode of the <STRONG>loading drive</STRONG>.

<LI>

Load the first sector of Stage 2.

<LI>

Jump to the starting address of the Stage 2.
</OL>

<P>
The flow of Stage 2 (and Stage 1.5) is:

</P>

<OL>
<LI>

Load the rest of itself to the real starting address, that is, the
starting address plus 512 bytes. The block lists are stored in the last
part of the first sector.

<LI>

Long jump to the real starting address.
</OL>

<P>
Note that Stage 2 (or Stage 1.5) does not probe the geometry
or the accessing mode of the <STRONG>loading drive</STRONG>, since Stage 1 has
already probed them.

</P>



<H2><A NAME="SEC122" HREF="grub.html#TOC122">How to probe I/O ports used by INT \
13H</A></H2>

<P>
FIXME: I will write this chapter after implementing the new technique.

</P>



<H2><A NAME="SEC123" HREF="grub.html#TOC123">How to detect all installed RAM</A></H2>

<P>
FIXME: I doubt if Erich didn't write this chapter only himself wholly,
so I will rewrite this chapter.

</P>



<H2><A NAME="SEC124" HREF="grub.html#TOC124">INT 13H disk I/O interrupts</A></H2>

<P>
FIXME: I'm not sure where some part of the original chapter is derived,
so I will rewrite this chapter.

</P>



<H2><A NAME="SEC125" HREF="grub.html#TOC125">The structure of Master Boot \
Record</A></H2>

<P>
FIXME: Likewise.

</P>



<H2><A NAME="SEC126" HREF="grub.html#TOC126">The format of partition tables</A></H2>

<P>
FIXME: Probably the original chapter is derived from "How It Works", so
I will rewrite this chapter.

</P>



<H2><A NAME="SEC127" HREF="grub.html#TOC127">Where and how you should send \
patches</A></H2>

<P>
When you write patches for GRUB, please send them to the mailing list
<A HREF="mailto:bug-grub@gnu.org"><TT>bug-grub@gnu.org</TT></A>. Here is the list of \
items of which you should take care:

</P>

<UL>
<LI>

Please make your patch as small as possible. Generally, it is not a good
thing to make one big patch which changes many things. Instead,
segregate features and produce many patches.

<LI>

Use as late code as possible, for the original code. The CVS repository
always has the current version (see section <A HREF="grub.html#SEC113">How to obtain \
and build GRUB</A>).

<LI>

Write ChangeLog entries. See section `Change Logs' in <CITE>GNU Coding \
Standards</CITE>, if you don't know how to write ChangeLog.

<LI>

Make patches in unified diff format. <SAMP>`diff -urN'</SAMP> is appropriate in
most cases.

<LI>

Don't make patches reversely. Reverse patches are difficult to read and
use.

<LI>

Be careful enough of the license term and the copyright. Because GRUB
is under GNU General Public License, you may not steal code from
software whose license is incompatible against GPL. And, if you copy
code written by others, you must not ignore their copyrights. Feel free
to ask GRUB maintainers, whenever you are not sure what you should do.

<LI>

If your patch is too large to send in e-mail, put it at somewhere we can
see. Usually, you shouldn't send e-mail over 20K.
</UL>



<H1><A NAME="SEC128" HREF="grub.html#TOC128">Index</A></H1>

<P>
<H2>b</H2>
<DIR>
<LI><A HREF="grub.html#IDX21">blocklist</A>
<LI><A HREF="grub.html#IDX22">boot</A>
<LI><A HREF="grub.html#IDX6">bootp</A>
</DIR>
<H2>c</H2>
<DIR>
<LI><A HREF="grub.html#IDX23">cat</A>
<LI><A HREF="grub.html#IDX24">chainloader</A>
<LI><A HREF="grub.html#IDX25">cmp</A>
<LI><A HREF="grub.html#IDX7">color</A>
<LI><A HREF="grub.html#IDX26">configfile</A>
<LI><A HREF="grub.html#IDX59">current_drive</A>
<LI><A HREF="grub.html#IDX60">current_partition</A>
<LI><A HREF="grub.html#IDX61">current_slice</A>
</DIR>
<H2>d</H2>
<DIR>
<LI><A HREF="grub.html#IDX27">debug</A>
<LI><A HREF="grub.html#IDX1">default</A>
<LI><A HREF="grub.html#IDX8">device</A>
<LI><A HREF="grub.html#IDX71">devread</A>
<LI><A HREF="grub.html#IDX9">dhcp</A>
<LI><A HREF="grub.html#IDX70">disk_read_func</A>
<LI><A HREF="grub.html#IDX28">displayapm</A>
<LI><A HREF="grub.html#IDX29">displaymem</A>
</DIR>
<H2>e</H2>
<DIR>
<LI><A HREF="grub.html#IDX30">embed</A>
</DIR>
<H2>f</H2>
<DIR>
<LI><A HREF="grub.html#IDX2">fallback</A>
<LI><A HREF="grub.html#IDX69">filemax</A>
<LI><A HREF="grub.html#IDX68">filepos</A>
<LI><A HREF="grub.html#IDX31">find</A>
<LI><A HREF="grub.html#IDX32">fstest</A>
<LI><A HREF="grub.html#IDX67">FSYS_BUF</A>
</DIR>
<H2>g</H2>
<DIR>
<LI><A HREF="grub.html#IDX33">geometry</A>
<LI><A HREF="grub.html#IDX72">grub_read</A>
</DIR>
<H2>h</H2>
<DIR>
<LI><A HREF="grub.html#IDX34">halt</A>
<LI><A HREF="grub.html#IDX35">help</A>
<LI><A HREF="grub.html#IDX3">hiddenmenu</A>
<LI><A HREF="grub.html#IDX10">hide</A>
</DIR>
<H2>i</H2>
<DIR>
<LI><A HREF="grub.html#IDX11">ifconfig</A>
<LI><A HREF="grub.html#IDX36">impsprobe</A>
<LI><A HREF="grub.html#IDX37">initrd</A>
<LI><A HREF="grub.html#IDX38">install</A>
<LI><A HREF="grub.html#IDX39">ioprobe</A>
</DIR>
<H2>k</H2>
<DIR>
<LI><A HREF="grub.html#IDX40">kernel</A>
</DIR>
<H2>l</H2>
<DIR>
<LI><A HREF="grub.html#IDX41">lock</A>
</DIR>
<H2>m</H2>
<DIR>
<LI><A HREF="grub.html#IDX42">makeactive</A>
<LI><A HREF="grub.html#IDX43">map</A>
<LI><A HREF="grub.html#IDX44">md5crypt</A>
<LI><A HREF="grub.html#IDX45">module</A>
<LI><A HREF="grub.html#IDX46">modulenounzip</A>
</DIR>
<H2>p</H2>
<DIR>
<LI><A HREF="grub.html#IDX65">part_length</A>
<LI><A HREF="grub.html#IDX64">part_start</A>
<LI><A HREF="grub.html#IDX12">partnew</A>
<LI><A HREF="grub.html#IDX13">parttype</A>
<LI><A HREF="grub.html#IDX14">password</A>
<LI><A HREF="grub.html#IDX47">pause</A>
<LI><A HREF="grub.html#IDX73">print_a_completion</A>
<LI><A HREF="grub.html#IDX66">print_possibilities</A>
</DIR>
<H2>q</H2>
<DIR>
<LI><A HREF="grub.html#IDX48">quit</A>
</DIR>
<H2>r</H2>
<DIR>
<LI><A HREF="grub.html#IDX15">rarp</A>
<LI><A HREF="grub.html#IDX50">read</A>
<LI><A HREF="grub.html#IDX49">reboot</A>
<LI><A HREF="grub.html#IDX51">root</A>
<LI><A HREF="grub.html#IDX52">rootnoverify</A>
</DIR>
<H2>s</H2>
<DIR>
<LI><A HREF="grub.html#IDX62">saved_drive</A>
<LI><A HREF="grub.html#IDX63">saved_partition</A>
<LI><A HREF="grub.html#IDX53">savedefault</A>
<LI><A HREF="grub.html#IDX16">serial</A>
<LI><A HREF="grub.html#IDX17">setkey</A>
<LI><A HREF="grub.html#IDX54">setup</A>
</DIR>
<H2>t</H2>
<DIR>
<LI><A HREF="grub.html#IDX18">terminal</A>
<LI><A HREF="grub.html#IDX55">testload</A>
<LI><A HREF="grub.html#IDX56">testvbe</A>
<LI><A HREF="grub.html#IDX19">tftpserver</A>
<LI><A HREF="grub.html#IDX4">timeout</A>
<LI><A HREF="grub.html#IDX5">title</A>
</DIR>
<H2>u</H2>
<DIR>
<LI><A HREF="grub.html#IDX20">unhide</A>
<LI><A HREF="grub.html#IDX57">uppermem</A>
</DIR>
<H2>v</H2>
<DIR>
<LI><A HREF="grub.html#IDX58">vbeprobe</A>
</DIR>

</P>

<P><HR><P>
<H1>Footnotes</H1>
<H3><A NAME="FOOT1" HREF="grub.html#DOCF1">(1)</A></H3>
<P><STRONG>chain-load</STRONG> is the mechanism for loading
unsupported operating systems by loading another boot loader. It is
typically used for loading DOS or Windows.
<H3><A NAME="FOOT2" HREF="grub.html#DOCF2">(2)</A></H3>
<P>There are a few
pathological cases where loading a very badly organized ELF kernel might
take longer, but in practice this never happen.
<H3><A NAME="FOOT3" HREF="grub.html#DOCF3">(3)</A></H3>
<P>The LInux LOader,
a boot loader that everybody uses, but nobody likes.
<H3><A NAME="FOOT4" HREF="grub.html#DOCF4">(4)</A></H3>
<P>Note that GRUB's root device doesn't necessarily mean
your OS's root partition; if you need to specify a root partition for
your OS, add the argument into the command @command{kernel
<H3><A NAME="FOOT5" HREF="grub.html#DOCF5">(5)</A></H3>
<P>This is not necessary for most of the
modern operating systems.
<H3><A NAME="FOOT6" HREF="grub.html#DOCF6">(6)</A></H3>
<P>RARP is deprecated, since it cannot serve much
information
<H3><A NAME="FOOT7" HREF="grub.html#DOCF7">(7)</A></H3>
<P>However, this
behavior will be changed in the future version, in a user-invisible
way.
<H3><A NAME="FOOT8" HREF="grub.html#DOCF8">(8)</A></H3>
<P>The latter feature
has not been implemented yet.
<H3><A NAME="FOOT9" HREF="grub.html#DOCF9">(9)</A></H3>
<P>They're loaded the same way, so we will refer to the Stage
1.5 as a Stage 2 from now on.
<H3><A NAME="FOOT10" HREF="grub.html#DOCF10">(10)</A></H3>
<P>I
can't imagine why you want to do such a thing, though
<P><HR><P>
This document was generated on 15 October 2001 using the
<A HREF="http://wwwcn.cern.ch/dci/texi2html/">texi2html</A>
translator version 1.54.</P>
</BODY>
</HTML>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic