The documentation for grub-install in docs/grub.texi is mostly just a leftover from the GRUB legacy documentation, and is therefore inaccurate in many ways with respect to GRUB2. Attached is a merge proposal that fixes most of the problems I found with the grub-install documentation. One problem that I did find that I don't know quite how to deal with (and haven't in this patch) is this paragraph:
By the way, as noted above, it is quite difficult to guess BIOS drives correctly under a UNIX-like OS. Thus, grub-install will prompt you to check if it could really guess the correct mappings, after the installation. The format is defined in 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. The device.map is not needed in most cases, and GRUB2 for all but a few odd and uncommon cases is completely independent of device enumeration. Despite that, a user can create a device.map that would cause problems with grub-install, for instance "(hd0) /dev/md0". So some mention of device.map with regard to grub-install is probably needed, but I'll leave that to someone else to write.
# Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: jordan.ug...@gmail.com-20100920210151-vdf1002s87z46my8 # target_branch: file:///home/jordan/grub-bzr/grub-trunk/ # testament_sha1: 672157381054a4b4f1842f87eb01970813e873c2 # timestamp: 2010-09-20 14:06:06 -0700 # base_revision_id: phco...@gmail.com-20100920202430-j7zw8icehfwb7g25 # # Begin patch === modified file 'ChangeLog' --- ChangeLog 2010-09-20 20:24:30 +0000 +++ ChangeLog 2010-09-20 21:01:51 +0000 @@ -1,3 +1,8 @@ +2010-09-20 Jordan Uggla <jordan.ug...@gmail.com> + + Update grub-install documetation to account for changes between + GRUB legacy and GRUB2. + 2010-09-20 Vladimir Serbinenko <phco...@gmail.com> Make cutmem accept a region specification. === modified file 'docs/grub.texi' --- docs/grub.texi 2010-09-20 13:03:47 +0000 +++ docs/grub.texi 2010-09-20 21:01:51 +0000 @@ -523,13 +523,10 @@ 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 -drive (floppy or hard disk). There are two ways of doing that - either -using the utility @command{grub-install} (@pxref{Invoking -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. +drive using the utility @command{grub-install} (@pxref{Invoking +grub-install}) on a UNIX-like OS. -Also, if you install GRUB on a UNIX-like OS, please make sure that you +Before installing grub to your hard drive 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). @@ -550,20 +547,11 @@ @node 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. - -If you still do want to install GRUB under a UNIX-like OS (such -as @sc{gnu}), invoke the program @command{grub-install} (@pxref{Invoking -grub-install}) as the superuser (@dfn{root}). - -The usage is basically very simple. You only need to specify one +To install GRUB under a UNIX-like OS (such as @sc{gnu}), invoke the program +...@command{grub-install} (@pxref{Invoking grub-install}) as the superuser +(@dfn{root}). + +The usage is very simple. In most cases you only need to specify one 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 partition specified in GRUB's notation. For example, under Linux the @@ -579,7 +567,8 @@ # @kbd{grub-install /dev/hd0} @end example -If it is the first BIOS drive, this is the same as well: +If @samp{/dev/hd0} is mapped to @samp{(hd0)} in the @file{device.map}, this is +the same as well: @example # @kbd{grub-install '(hd0)'} @@ -591,7 +580,13 @@ # @kbd{grub-install hd0} @end example -But all the above examples assume that GRUB should use images under +Because device names specified using grub's internal notation are mapped to +device nodes as presented by the OS using the @xref{Device map}, which device +grub is actually installed to depends on the contents of the @file{device.map}. +To avoid ambiguity and the chance of writing to the wrong device use of the OS's +device naming is recommended. + +All the above examples assume that GRUB should use 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 @@ -601,19 +596,11 @@ @group # @kbd{mke2fs /dev/fd0} # @kbd{mount -t ext2 /dev/fd0 /mnt} -# @kbd{grub-install --root-directory=/mnt fd0} +# @kbd{grub-install --force --root-directory=/mnt /dev/fd0} # @kbd{umount /mnt} @end group @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 @@ -626,8 +613,7 @@ real task is done by @command{grub-mkimage} and @command{grub-setup}. Therefore, you may run those commands 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. +familiar with the internals of GRUB. @node Making a GRUB bootable CD-ROM # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWUSotucAAsffgAAwWOf/9361 nkC////6YAas+me57bQtvQPd646YWmQEpCJkMp+ppPU2U9MT1TJ6E0DTQHpGmgGglRNPVT9Kfpgg mk2oA0AAAAAAGp6U2QRT0ynpNAaNAABoBoNNB6gJIJNNRppNNNNNpE0ZAxAABoAA5piZMmjCYJia YBMAhgjAjAJJAQ0CCeiYk8QyI0aNJtEGIGT1FFqqIkxMYM+NlHvwfubrpjqJ0hpWm7iZTNDXBhqh bdWIVqc7RYzRlgw5kpE2jQKMj65PfV4JiEMuevGPnMIkEFwGp7h1arMaw1WGGGnc0VYRodhIgUMi aEAWSQyXX2je2Ptrhnyh9jdSQUMjez6FKrlH7w3zdNid8KxozdvwJvUBoqYPBkjbk2fSeVPhpLlB CmzdCCRwKEFqP5MEAyko5JM+t4UAieKqCVWLdCcZ2wEAQ+1tKKk76B4hbG9K/FRzV0tr9s0Ggql1 oMUgaJXluOCi44LrljwxvG0wHQgi7HITduRciJfCdDec0EOoDVllnzYn3Rw4DPYJUNSkDcZNv/cN Oqp3NHM1ktrCZl2adjSEuBRDITJJmqcBxeAZwOybQwixJGuYgoD1UbpkYfhFxS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Q0iXMGCIcG74LTQ7zA08Q8LAl7I/m7NBZkOdSHqd1gfFJW0CWjjGPYzbVUwYo77L4Ggmwcd pqrnXRiBpJkvOyHCBDIwLBCJRdgNBdRigzJQjXEkiNFSqKSOmZEaYDMdBzh4GZlwDcGWN4emofwC SQRtZhbmc3jJ8XBcWobgG8BYdiDnwmmkUbzPEL1XPNrlCg1jySkZVFVAEqmlvIwI9xIitiPmjWii oWSHpPRwxdBkJo27fFQSww7pKnr8OstUDbXHlPyhNE2zITnMy9McGgD3NmGi6bnZ3fl+SC7iy4cl WS9nbZDLXrKlFgiDMtDFC1uDnERnR6Maw1KkuPV3Y5AlIm8mhRyzHuVQaOhGDwXSwV0258CcQkBg i1ZMVMEZO6o5iBRYqpCy00zgZp9kKLAgdUBzPxYowY4GsCeJBRihTeuYcrgzk0TDP1DkQxGv1lTs 3tQ4yAai5gY5la8LixPLtSz9eB+HONuexf+LuSKcKEgiVFtzgA==
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel