![]() |
| February 2001 | Get BSD | New to BSD? | Search BSD | Submit News | FAQ | Contact Us | Join Us |
|
Grub
is a bootloader which is compliant to the multiboot standard.
understands filesystems (FFS, FAT16, FAT32, minixfs, ext2fs)
is able to boot a multitude of OSes.
is able to boot from the net (RARP, BOOTP, DHCP)
gets around the 1024 cylinder limitation.
has a boot menu, which can be configured by editing a file.
also has a command line interface, which is accessible during the boot process.
has an integrated help system; when pressing the tab-key, possible completions of entered commands are suggested.
I was never able to compile grub from source on a FreeBSD system before release 4.0. Therefore I used to rip grub out of a Debian Linux distribution. Nowadays you can download a precompiled copy from ftp://alpha.gnu.org/gnu/grub/.
The last version I used is: grub-0.5.96.1-i386-pc.tar.gz
There is even a working port in the port collection now.
Unzip and detar the tarball by:
Now change to the directory /boot, create a subdirectory named grub and copy the files stage1, stage2, and menu.lst into the new directory.
# su toor
# mkdir grub
# cd grub
# cp /path_to_grub/grub-0.5.96.1-i386-pc/stage1 .
# cp path_to_grub/grub-0.5.96.1-i386-pc/stage2 .
# cp /path_to_grub/grub-0.5.96.1-i386-pc/menu.lst .
Edit the file /boot/grub/menu.It should contain the following contents:
title FreeBSD
root (hd1,a)
kernel /boot/loader
# For booting Windows NT or Windows95
title Windows NT / Windows 95 boot menu
root (hd0,0)
makeactive
chainloader +1
boot
# For loading DOS if Windows NT is installed
# chainload /bootsect.dos
The same as the above, just for Windows.
# For installing GRUB into the hard disk
title Install GRUB into the hard disk
root (hd0,0)
setup (hd0)
Remarks: The install string should reflect your personal system. On my machine, FreeBSD resides on the second SCSI disk sd1 and I prefer to boot from floppy disk.
Older versions of grub could not load the new ELF-kernel of FreeBSD. Therefore it was necessary to boot the kernel indirectly via /boot/loader. Even now this is the preferred method, because of the many useful features of /boot/loader.
Since I could not compile grub under FreeBSD the final installation has to be done via the boot disk (otherwise you could use the grub shell directly).
Insert a floppy disk into your drive, su to root, then issue the commands:
# cd /boot/grub
# dd if=stage1 of=/dev/fd0 bs=512 count=1
# dd if=stage2 of /dev/fd0 bs=512 seek=1
If everything worked you should have now a bootable install disk for booting from floppy.
Reboot your machine and wait until you are in the grub shell. Then enter (all on one line):
(hd1,a)/boot/grub/stage2 0x8000 p
(hd1,a)/boot/grub/menu.lst
The first part tells grub where to find its stage1. The second part tells grub to install its bootsector on a floppy (fd0) (insert a new one before hitting return, if you want to keep your install disk). The third part tells where to find stage2 and the last part tells where the menu file resides. I omitted the part with 0x8000 p, if you want to know more read the manual. One interesting point: the d in front of (fd0) is described as optional in the manual, but all installations I tried failed when this option was omitted.