Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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 '12 at 22:20

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.


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.

share|improve this answer
Thanks Matt, I will try it out and update. – Bharat Jun 8 '11 at 10:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.