[SOLVED] GRUB2 can't boot FreeBSD, neither directly nor via the loader
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
GRUB2 can't boot FreeBSD, neither directly nor via the loader
Only chainloading works. Here is part of my grub.cfg, first entry (chainloader) works, second (BSD loader) and third (BSD kernel) don't work:
Code:
### BEGIN /etc/grub.d/54_FreeBSD-9.1-chainloader+1 ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'FreeBSD 9.1 per Chainloader von /dev/sda3' --class freebsd --class bsd --class os {
# 'osprober-gnulinux-simple-66c11328-0deb-4ccf-a076-289178d8c1a5'
# /dev/sda3 ist /dev/disk/by-uuid/50d5e52c10f44cae ... geht aber so nicht.
insmod part_msdos
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos3' 50d5e52c10f44cae
else
search --no-floppy --fs-uuid --set=root 50d5e52c10f44cae
fi
set root='hd0,msdos3'
set gfxpayload=vga=normal
chainloader +1
}
### END /etc/grub.d/54_FreeBSD-9.1-chainloader+1 ###
### BEGIN /etc/grub.d/55_FreeBSD-9.1-GRUB2 ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'FreeBSD 9.1 via /boot/loader' --class freebsd --class bsd --class os {
insmod part_msdos
insmod ufs2
search --no-floppy --fs-uuid --set=root 50d5e52c10f44cae
set gfxpayload=vga=normal
set root=(hd0,msdos3)
kfreebsd /boot/loader
}
### END /etc/grub.d/55_FreeBSD-9.1-GRUB2 ###
### BEGIN /etc/grub.d/56_FreeBSD-9.1-GRUB2-direkt ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
# nach http://forums.freebsd.org/showpost.php?p=56726&postcount=10
menuentry 'FreeBSD 9.1 per kFreeBSD direkt' --class freebsd --class bsd --class os {
insmod part_msdos
insmod ufs2
set gfxpayload=vga=normal
set root=(hd0,msdos3)
search --no-floppy --fs-uuid --set=root 50d5e52c10f44cae
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ad0s3a
set kFreeBSD.vfs.root.mountfrom.options=rw
}
### END /etc/grub.d/56_FreeBSD-9.1-GRUB2-direkt ###
The second entry produces a "can't load kernel" when selected and stays at the BSD-loader prompt. Trying "load /boot/kernel/kernel" shows no error but issueing a "boot" command just produces a new "can't load kernel"
Selecting the third entry shows some colorful spots on the screen and then reboots after 5 seconds or so. What could be wrong?
So I created the necessary files in /etc/grub.d/ by hand to get the grub.cfg from which I showed a snippet in my first post. Which fails ignominiously.
I suppose GRUB2 is properly installed, it boots uncomplainingly openSuSE 12.2, Ubuntu 12.04, Fedora 17, Mint 14 and chainloads the FreeBSD-loader. Exactly how would I check whether it is properly installed?
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Well, no, this would be just fishing in muddy waters. As stated in my second post GRUB2 boots 4 Linux distributions and successfully chainloads the FreeBSD-loader. Just direct loading is botched. I suspect a wrong syntax (or parameterizatiion) in the grub.cfg but I have no clue where to set it straight.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Okay, I found out why it won't work. First, though, I have to amdend this:
Quote:
Originally Posted by JZL240I-U
...Yes, it is supposed to auto-detect FreeBSD...
No, it is not GRUB2 which doing the detection, but the "os-prober". It works now correctly after applying the methods from the links I posted earlier. "os-prober" is usually launched during a call to "grub2-mkconfig (-o /boot/grub2/grub.cfg)" (if not disabled).
Launching "grub2-mkconfig" and scanning the output revealed:
Code:
Found FreeBSD on /dev/sda3
FreeBSD is not yet supported by grub-mkconfig.
Sorry off topic here.
I read you mentioned about "one had to change the values of the bits five to seven times to make it forensically impossible to reconstruct the contents of the disk."
Where did you read that?
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
That is not from this thread. When you have questions like these I'd suggest you open your own new thread or mail the member in question (currently me ). Anyhow, I don't exactly remember where I read that, but I can offer some links, where you might find more information:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.