6

I've been trying to install FreeBSD alongside my Debian installation in a single partition. All examples readily present on the Internet had shortcomings:

  1. Some required chainloading the FreeBSD chainloader in ways GRUB2 refused to accept with "invalid signature".
  2. Some assume you've installed FreeBSD inside a BSD disklabel.
  3. None of the solutions (including loading /boot/loader) boot after changing the order of the devices or moving them from server to server.
  4. None of the solutions work on Debian: The naming of the GRUB2 options on Debian seems to be different from e.g. Ubuntu.

So how do I dual boot Debian and FreeBSD in the most reliable way?

1
  • 1
    Instead of putting your answer in the question, please instead post it as an answer...
    – derobert
    Sep 27, 2012 at 18:49

3 Answers 3

4

Append the following to your /etc/grub.d/40_custom replacing UUID with the UUID of the disk discovered with grub-probe -d /dev/sda2 -t fs_uuid

menuentry 'FreeBSD' {
   insmod ufs2
   insmod bsd

   search --fs-uuid --no-floppy --set=root UUID

   kfreebsd /boot/kernel/kernel
   kfreebsd_loadenv /boot/device.hints

   set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ufsid/UUID
   set kFreeBSD.vfs.root.mountfrom.options=rw
}

Note that for other distros and/or GRUB versions, kfreebsd might have to be changed to just freebsd.

Reference:

1
  • I tried this. The first time the boot process stopped at a screen of many multi-colored squares blinking. Some with letters, some with extended ascii symbols. I went back and replaced --set=root UUID w/ --set root=UUID. This time I got three error msgs no argument specified, file not found, and you need to load the kernel first
    – user32578
    Feb 18, 2013 at 2:49
0

I have used grub2 before while trying to dual boot with kubuntu and ubuntu . I used this tutorial: http://www.dedoimedo.com/computers/grub-2.html#mozTocId16468. It was extremely helpful and very reliable .

"Dual boot: two operating systems with GRUB 2

This is probably the simplest dual-boot configuration. Both operating systems use GRUB 2, so they can easily interact with one another. The two systems are Ubuntu 9.10 and Kubuntu 9.10, both formatted with Ext4."

Hope this is helpful for people who are trying to use this one .

0

I stumbled across this while looking to dual boot FreeBSD 11.0 and Ubuntu 16.04 using Ubuntu's GRUB 2, all under EFI.

Ultimately I had a number of issues with the direct boot, but I did have success chainloading FreeBSD. A simple chainloader +1 didn't work for me, and I wound up using the following:

menuentry "FreeBSD 11.0 chainload" {
    insmod part_gpt
    insmod fat
    root = hd0,7
    chainloader /efi/boot/bootx64.efi
}

followed by an update-grub. It's possible I missed something simple which would make the above answers work for efi.

You must log in to answer this question.

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