Thursday, July 23, 2009

FreeBSD - Adding/setting up Grub

So your from linux land or you just want to try something new... Try grub :)

Lets located grub:
#> whereis grub
/usr/ports/sysutils/grub

Move to grubs port directory and install it:
#> cd /usr/ports/sysutils/grub
#> make install clean

Make the Mbr writeable, which is needed for grub:
#> sysctl kern.geom.debugflags=16

Now for the fun part! Installing - if you have a basic install this work just fine
#> grub-install hd0
Entering the grub subsystem:
#> grub
grub> root (hd0,0,a)
grub> setup --stage2=/boot/grub/stage2 --prefix=/boot/grub (hd0)
grub> quit

Making a menu.lst file that will take you to a free bsd booter.
#> nano /boot/grub/menu.lst

title FreeBSD 7.2
root (hd0,0,a)
kernel /boot/loader

Reboot the box and cross your fingers ;)
#>reboot

So I hope this worked for you, it worked great on my VM machine, and a few other boxes i've installed.

No comments: