How do you dual boot Debian and FreeBSD using GRUB2?
10,550
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:
Related videos on Youtube
Author by
Fuyash Porchant
Updated on September 18, 2022Comments
-
Fuyash Porchant over 1 year
I've been trying to install FreeBSD alongside my Debian installation in a single partition. All examples readily present on the Internet had shortcomings:
- Some required chainloading the FreeBSD chainloader in ways GRUB2 refused to accept with "invalid signature".
- Some assume you've installed FreeBSD inside a BSD disklabel.
- None of the solutions (including loading /boot/loader) boot after changing the order of the devices or moving them from server to server.
- 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?
-
Admin over 11 yearsInstead of putting your answer in the question, please instead post it as an answer...
-
Admin about 11 yearsI 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 msgsno argument specified
,file not found
, andyou need to load the kernel first