I've penned out some slightly-updated installation docs for grub.  I still
need to work on the "Automated installation" section, but I want to make sure
that I'm covering everything I need to.  I'll convert it to texi when it's
all done.

Please send feedback!

Tks,
Jeff Bailey
-- 
"People are more violently opposed to fur than leather
because it is safer to harrass rich women than motorcycle gangs." 

Unknown 
How to install GRUB on your computer
************************************

  For GRUB to work as intended, it has to be loaded on some sort of bootable
media - this could be anything from hard disk, to a floppy disk or even a 
compact disk.  Support hasn't been completed for anything but a floppy disk or
hard drive yet, but other support is expected soon.

Because GRUB supports boot almost any operating system, you can use it to
replace other bootloaders like LiLo.  If you don't want to do this, however, 
you can always make a bootfloppy so that you can play with it and be
comfortable.  It is also useful as an emergency repair disk because, unlike
LiLo, GRUB is configurable at runtime.

Creating a GRUB boot floppy
===========================

    *Caution:* This will DESTROY any data currently on your floppy!

When making a boot floppy to play with or use as an emergency disk you will
not be able to build a menu, so write down the commands you want before hand.
To get the menu interface, see *Note Automated install::.

Under a UNIX-like operating system, such as GNU, use `dd' as
follows, where `/lib/grub/i386-pc' is the GRUB install directory and
`/dev/fd0' is the floppy device:

     $ cd /lib/grub/i386-pc
     $ dd if=stage1 of=/dev/fd0 bs=512 count=1
     1+0 records in
     1+0 records out
     $ dd if=stage2 of=/dev/fd0 bs=512 seek=1
     67+1 records in
     67+1 records out
     $

Under DOS-based systems, such as Windows, use `copy' and `rawrite':

     copy /b stage1 + stage2 grub.raw
     rawrite grub.raw a:

`rawrite' is available as a part of the installation tools that come
with many GNU and GNU/Linux distributions.

Reboot the machine and you will be presented with the command-line interface
of GRUB.

Installing to a hard drive
==========================

*Caution:* When installing GRUB to a harddrive you will be overwriting the
sectors on your hard drive that boot your operating systems.  Do NOT proceed
with this unless you have the original boot diskettes or CDs that you used
to install originally.  You have been warned.

GRUB has a command called `install' which is described in *Note
Using::.  This section will give practical examples of how to use the command.

This installation can be done either from the command-line interface or from
the `grub' binary which is produced during compilation.  With the `grub'
binary you no longer have to boot to a floppy in order to install the
`stage1' bootloader.

Make a `/boot/grub' directory (`\boot\grub' under DOS or Windows) in the
"install partition".  Place the GRUB `stage2' file, any optional
`stage1.5' file, and the configuration file (`menu.lst') in that
directory.

Next, use the install command to load the `stage1' file into the right place
and you're done!

Remember: the `stage1' file does not work on hard drives that are set in LBA
mode.  If your hard drive is setup that way, use the `stage1_lba' file
instead.

Examples of how to use the `install' command:

  * *Make a hard disk bootable with GRUB's stage2 on PC partition
     number 2:* Make a directory in the partition called `/boot/grub',
     place the `stage2' (and if desired, the `menu.lst' configuration
     file), then run the following command at GRUB's command line:

          install (fd0)+1 (hd0) (hd0,1)/boot/grub/stage2 0x8000 p

     This tells GRUB to grab the first sector of the floppy and use it
     as the stage1, create a blocklist using the file
     `/boot/grub/stage2' on the first hard disk (partition number 2),
     merge them together, set the load address correctly for a stage2
     (0x8000), save the "install partition" in the first sector of the
     stage2 (the `p' at the end), then write the result to the first
     sector of the hard disk.

   * *Same as above, but place the stage1 on the floppy, then have it
     start the stage2 on the hard disk:* The difference here is you're
     telling GRUB's stage1 to read from the first hard disk no matter
     where the stage1 was loaded from:

          install (fd0)+1 d (fd0) (hd0,1)/boot/grub/stage2 0x8000 p

     By default, GRUB loads the stage2 from the disk where the stage1
     was installed.  The `d' option near the beginning of this command
     line forces GRUB to load the stage2 from the disk where it was
     installed.  Also, the "destination device" is changed to place the
     finished stage1 on the floppy disk.

   * *Same as above, but place the stage1.5 in the first cylinder of
     the hard disk, and load the stage2 via the stage1.5:* Each of
     Stage 1.5s supports only one filesystem, so choose a stage1.5 that
     supports the filesystem where stage2 is located. Here it is
     assumed that the filesystem is ext2fs.

     First, copy `e2fs_stage1_5' to the first sector after the MBR
     (*note MBR::.):

          dd if=stage2/e2fs_stage1_5 of=/dev/hda bs=512 seek=1

     Second, specify the stage1.5 argument in blocklist format:

          install (fd0)+1 (hd0) (hd0)1+1 0x2000 p (hd0,1)/boot/grub/stage2

       Here we're loading the stage1 from a file on the first hard disk,
     installing stage2 from the first BSD `a' partition on the second
     hard disk, and setting the stage2's "configuration file" to
     `(hd1,a)/grubdir/configfile':

          install (hd0,1)/boot/grub/stage1 (hd1) (hd1,a)/boot/grub/stage2 0x8000 p 
/grubdir/configfile

   You can automate these steps by using a GRUB floppy with a filesystem
or using the `grub' binary and a configuration file which contains 
entries such as:

     # Start of entry:
     title GNU/Linux installation
     
     # Installation command:
     install (fd0)+1 (hd0) (hd0,1)/boot/grub/stage2 0x8000 p
     
     # Actually boot here:
     root (hd0,1)
     kernel /zImage root=/dev/hda2

   ... then have the install script continue from there after boot of
the OS.


Reply via email to