* docs/grub.texi (Installation): Fix several outdated claims.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-05-14 17:50:48 +02:00
parent 2217a1430e
commit 0cac83df85
2 changed files with 20 additions and 46 deletions

View file

@ -1,3 +1,7 @@
2011-05-14 Vladimir Serbinenko <phcoder@gmail.com>
* docs/grub.texi (Installation): Fix several outdated claims.
2011-05-14 Vladimir Serbinenko <phcoder@gmail.com> 2011-05-14 Vladimir Serbinenko <phcoder@gmail.com>
Handle module_license on windows. Handle module_license on windows.

View file

@ -528,21 +528,15 @@ system (@pxref{Obtaining and Building GRUB}). You can do this either
from the source tarball, or as a package for your OS. from the source tarball, or as a package for your OS.
After you have done that, you need to install the boot loader on a After you have done that, you need to install the boot loader on a
drive (floppy or hard disk). There are two ways of doing that - either drive (floppy or hard disk) by using the utility
using the utility @command{grub-install} (@pxref{Invoking @command{grub-install} (@pxref{Invoking grub-install}) on a UNIX-like OS.
grub-install}) on a UNIX-like OS, or by running GRUB itself from a
floppy. These are quite similar, however the utility might probe a
wrong BIOS drive, so you should be careful.
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).
GRUB comes with boot images, which are normally put in the directory GRUB comes with boot images, which are normally put in the directory
@file{/usr/lib/grub/i386-pc}. Hereafter, the directory where GRUB images are @file{/usr/lib/grub/<cpu>-<platform>} (for BIOS-based machines
initially placed (normally @file{/usr/lib/grub/i386-pc}) will be @file{/usr/lib/grub/i386-pc}). Hereafter, the directory where GRUB images are
initially placed (normally @file{/usr/lib/grub/<cpu>-<platform>}) will be
called the @dfn{image directory}, and the directory where the boot called the @dfn{image directory}, and the directory where the boot
loader needs to find them (usually @file{/boot/grub}) will be called loader needs to find them (usually @file{/boot}) will be called
the @dfn{boot directory}. the @dfn{boot directory}.
@menu @menu
@ -556,27 +550,18 @@ the @dfn{boot directory}.
@node Installing GRUB using grub-install @node Installing GRUB using grub-install
@section Installing GRUB using grub-install @section Installing GRUB using grub-install
@strong{Caution:} This procedure is definitely less safe, because
there are several ways in which your computer can become
unbootable. For example, most operating systems don't tell GRUB how to
map BIOS drives to OS devices correctly---GRUB merely @dfn{guesses}
the mapping. This will succeed in most cases, but not
always. Therefore, GRUB provides you with a map file called the
@dfn{device map}, which you must fix if it is wrong. @xref{Device
map}, for more details.
For information on where GRUB should be installed on PC BIOS platforms, For information on where GRUB should be installed on PC BIOS platforms,
@pxref{BIOS installation}. @pxref{BIOS installation}.
If you still do want to install GRUB under a UNIX-like OS (such In order to install GRUB under a UNIX-like OS (such
as @sc{gnu}), invoke the program @command{grub-install} (@pxref{Invoking as @sc{gnu}), invoke the program @command{grub-install} (@pxref{Invoking
grub-install}) as the superuser (@dfn{root}). grub-install}) as the superuser (@dfn{root}).
The usage is basically very simple. You only need to specify one The usage is basically very simple. You only need to specify one
argument to the program, namely, where to install the boot loader. The argument to the program, namely, where to install the boot loader. The
argument can be either a device file (like @samp{/dev/hda}) or a argument has to be either a device file (like @samp{/dev/hda}).
partition specified in GRUB's notation. For example, under Linux the For example, under Linux the following will install GRUB into the MBR
following will install GRUB into the MBR of the first IDE disk: of the first IDE disk:
@example @example
# @kbd{grub-install /dev/hda} # @kbd{grub-install /dev/hda}
@ -588,37 +573,22 @@ Likewise, under GNU/Hurd, this has the same effect:
# @kbd{grub-install /dev/hd0} # @kbd{grub-install /dev/hd0}
@end example @end example
But all the above examples assume that GRUB should use images under But all the above examples assume that GRUB should put images under
the root directory. If you want GRUB to use images under a directory the @file{/boot} directory. If you want GRUB to put images under a directory
other than the root directory, you need to specify the option other than @file{/boot}, you need to specify the option
@option{--root-directory}. The typical usage is that you create a GRUB @option{--boot-directory}. The typical usage is that you create a GRUB
boot floppy with a filesystem. Here is an example: boot floppy with a filesystem. Here is an example:
@example @example
@group @group
# @kbd{mke2fs /dev/fd0} # @kbd{mke2fs /dev/fd0}
# @kbd{mount -t ext2 /dev/fd0 /mnt} # @kbd{mount -t ext2 /dev/fd0 /mnt}
# @kbd{grub-install --root-directory=/mnt fd0} # @kbd{mkdir /mnt/boot}
# @kbd{grub-install --boot-directory=/mnt/boot /dev/fd0}
# @kbd{umount /mnt} # @kbd{umount /mnt}
@end group @end group
@end example @end example
Another example is when you have a separate boot partition
which is mounted at @file{/boot}. 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:
@example
# @kbd{grub-install --root-directory=/boot /dev/hda}
@end example
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 @ref{Device map}. Please be
quite careful. If the output is wrong, it is unlikely that your
computer will be able to boot with no problem.
Some BIOSes have a bug of exposing the first partition of a USB drive as a Some BIOSes have a bug of exposing the first partition of a USB drive as a
floppy instead of exposing the USB drive as a hard disk (they call it floppy instead of exposing the USB drive as a hard disk (they call it
``USB-FDD'' boot). In such cases, you need to install like this: ``USB-FDD'' boot). In such cases, you need to install like this: