And just for the record, this one is a solution for
MBR/GPT (Not
ZFS/UEFI) for MBR/GPT user who has the same problem.
Suppose, FreeBSD has installed on the 2nd partition (partition as in non-FreeBSD temenology)
partition 1: Ubuntu
partition 2: FreeBSD => (hd0,1) second primary partition of the first hard disk
In case of dual-boot windows, it's probably reside on 3rd partition, because you have a Windows hidden system partition, therefore (hd0,2)
partition 1: Windows hidden system
partition 2: Windows
partition 3: FreeBSD => (hd0,2)
Code:
/etc/grub.d/40_custom
menuentry "FreeBSD" {
set root='(hd0,1)'
kfreebsd /boot/loader
}
# grub-mkconfig -o /boot/grub/grub.cfg
[EDIT]: add extra information
And in the process if you managed to destory grub, don't panic, run a Live CD and:
An example on /dev/sda (/dev/sda1) # it works on Arch.
Code:
mount /dev/sda1 /mnt
mount --bind /dev /mnt/dev
mount --bind /dev/pts /mnt/dev/pts
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
grub-install /dev/sda1
grub-install --recheck /dev/sda1
update-grub
exit
umount /mnt/sys
umount /mnt/proc
umount /mnt/dev/pts
umount /mnt/dev
umount /mnt
Then reboot.