GRUB Installation Guide

by Erich Boleyn


Contents

Getting Started Quickly

If you just want to use GRUB, or simply try it out quickly, try the Install using "rawrite" or "dd" to floppy disk in the following section to create a "raw" GRUB floppy.


Install using "rawrite" or "dd" to floppy disk

This installation method can generally only access the command-line part of the interface (since there is no filesystem in which to find a config-file). It is also by far the simplest installation method to get going.

NOTE: This will destroy any data currently on the floppy.

Execute your OS's equivalent of (this should work for recent FreeBSD versions and Linux just fine):

	dd if=bin/stage1 of=/dev/fd0 bs=512 count=1
	dd if=bin/stage2 of=/dev/fd0 bs=512 seek=1
Under DOS/Windows/NT, courtesy of Eric Hanchrow (erich@microsoft.com):

Automated Install using GRUB

IMPORTANT NOTE: If the stage1 is installed on a specific partition, this can erase the normal boot-sector used by an OS. GRUB can boot Linux, FreeBSD, NetBSD, Mach, and the GNU HURD directly, so this may be desired. Generally, it is a good idea to back up the first sector of a partition if installing GRUB's stage1 there. For the first sector of a hard disk, this is OK, since it's easy to reinitialize it via "FDISK /MBR" in DOS, or other methods in other OSes.

GRUB has a command called "install=" which is described in the list of commands. The purpose of this section is to give examples and describe how to use the command in different situations.

NOTE: Given that "install=" can be used in config-file entries, this could very easily be used as part of a completely automated set of install scripts for an OS.

First, you make a "raw" GRUB floppy created via Install using "rawrite" or "dd" to floppy disk above. Actually, any booting copy of GRUB of the right version number will work fine, this is simply a way to get the process started easily.

On the partition that is the desired area for GRUB to be installed in (call it the "install partition"), make a "/boot/grub" directory and place the stage2 and menu.lst (config file) there. (If desired, place a stage1.5 there as well)

Now use the "install=" command appropriately, and you're done!

Examples of how to use the "install=" command:

An easily imaginable way of using this as part of an automated installation process would be to note that the commands listed above can be part of any sequence of commands in an entry in a GRUB config file, so this could be automated even more by using a GRUB floppy with a filesystem and config file, with an entry such as:

	# Start of entries
	title=	   Linux HD install

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


erich@uruk.org