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=1Under DOS/Windows/NT, courtesy of Eric Hanchrow (erich@microsoft.com):
copy /b stage1 + stage2 grub.raw
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:
install= (fd0)+1 (hd0) (hd0,2)/boot/grub/stage2 0x8000 pThis 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 to 0x8000 (correct for a stage2), write the "install partition" number into the first sector of the stage2 (the "p" at the end), then write the result to the first sector of the hard disk.
install= (fd0)+1 d (fd0) (hd0,2)/boot/grub/stage2 0x8000 pThe "d" option near the beginning is what sets the "forced" loading from the disk where the stage2 was installed from. The rest of the options are the same except for the "destination device" to place the finished stage1 on is changed to the floppy disk.
install= (hd0,2)/boot/grub/stage1 (hd1) (hd1,a)/boot/grub/stage2 0x8000 p /grubdir/configfile
# 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.