2

I am new to FreeBSD world and currently using pfsense as a guest on Virtualbox. FreeBSD comes with default BTX bootloader. I want to replace it with Grub.

I tried running grub-install on /dev/ad1 or something grub complains of "Unable to mount partition" .

The root partition (slice) is ufs, I looked under /boot/grub and there is a ufs2 ( I hope it is backward compatible ) module for grub, but still no luck.

Has anyone has ever tried similar scenario.

1
  • First question that comes to mind: Why would you want to do that? All Grub does in that scenario is load the FreeBSD Boot loader, which then loads FreeBSD. The only scenario where a Grub in front of FreeBSDs own loader would seem to make sense is a multiboot, and since I take from your post that your FreeBSD is running within VirtualBox I don't see that happening. So allow me this question: What are you trying to achieve and why?
    – juwi
    Jan 19, 2012 at 22:20

1 Answer 1

2

I have just successfully done just this.

Here's how:

# cd /usr/ports/sysutils/grub
# make install
... make commences ...
# sysctl kern.geom.debugflags=16
kern.geom.debugflags: 0 -> 16
# /usr/local/sbin/grub-install
# reboot

That left me at the grub> prompt at which I issued:

grub> kernel /boot/loader
... loader loads ...
grub> boot

And I am into FreeBSD>

The latter part should be done through the grub configuration file.

By the looks of things it was the sysctl line you may have missed out. This turns on the ability to write to the hard drive's system areas which is denied by default.

Addendum

Setting up a simple boot menu:

Add the following to the file /boot/grub/menu.lst:

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

and you will get a simple boot menu with one entry in it for FreeBSD.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .