Grub 2 Boot Loader – Adding PC BSD / FreeBSD

bootdual-bootfreebsdgrub2

I have Ubuntu 10.04 installed as my primary operating system, and I installed PC BSD in a different partition: /dev/sda4 without installing it's boot loader. I figured out that I need to edit /etc/grub.d/40_custom to add an entry for PC-BSD. So far, nothing seems to work, though.

EDIT: this sort of works, but doesn't fully boot the OS, it then asks me for the MOUNTROOT partition.

menuentry "PC-BSD 8.1" {
    insmod ufs2
    set root=(hd0,4)
    kfreebsd /boot/kernel/kernel
}

The selected answer below is correct. If you are dual-booting with Linux I suggest NOT installing the PC-BSD bootloader as the documentation suggests, unless you enjoy pain.

Best Answer

this is what I have in /etc/grub.d/40_custom. Works for me :) Just remember to subsitude hd0,3 with your correct entry

menuentry 'FreeBSD 8.0 64bit' --class os {
    set root='(hd0,3)'
    chainloader +1
}
Related Question