My disk partition scheme, as seen by Grub, is as follows:
hd0,gpt1: EFI system
hd0,gpt2: Linux Swap
hd0,gpt3: Linux Filesystem
hd0,gpt4: FreeBSD UFS`
The install process of FreeBSD 11.0-RELEASE went fine, I also tried chrooting and updating the system, just in case. I then booted into Arch Linux and edited /etc/grub/40_custom
, trying various configurations (see FreeBSD menu entry in GRUB on wiki.archlinux.org), and ran grub-mkconfig -o /boot/grub/grub.cfg
.
(Note: I edited the "mountfrom" parameter specifying the correct dev file for the root fs, which in my case is ada0p4, and omitted the "bsd1" entry, only setting (hd0,gpt4), otherwise it couldn't find the partition.)
If I load kfreebsd /boot/loader
and boot, I get a black screen.
If I load
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0p4
set kFreeBSD.vfs.root.mountfrom.options=rw
and boot, I get this:
My laptop is a Thinkpad X220 (stock BIOS up-to-date). Grub version: 2.02.beta3-4
.
Any ideas what's wrong here? Please leave a comment if you need further info.
My grub.cfg
(link):
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 ff637c2e-1e42-4533-9a12-6ac2f6d43c9b
else
search --no-floppy --fs-uuid --set=root ff637c2e-1e42-4533-9a12-6ac2f6d43c9b
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=1024x768
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-ff637c2e-1e42-4533-9a12-6ac2f6d43c9b' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 BE35-0EC9
else
search --no-floppy --fs-uuid --set=root BE35-0EC9
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=ff637c2e-1e42-4533-9a12-6ac2f6d43c9b rw
echo 'Loading initial ramdisk ...'
initrd /intel-ucode.img /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-ff637c2e-1e42-4533-9a12-6ac2f6d43c9b' {
menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-ff637c2e-1e42-4533-9a12-6ac2f6d43c9b' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 BE35-0EC9
else
search --no-floppy --fs-uuid --set=root BE35-0EC9
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=ff637c2e-1e42-4533-9a12-6ac2f6d43c9b rw
echo 'Loading initial ramdisk ...'
initrd /intel-ucode.img /initramfs-linux.img
}
menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-ff637c2e-1e42-4533-9a12-6ac2f6d43c9b' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 BE35-0EC9
else
search --no-floppy --fs-uuid --set=root BE35-0EC9
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=ff637c2e-1e42-4533-9a12-6ac2f6d43c9b rw
echo 'Loading initial ramdisk ...'
initrd /intel-ucode.img /initramfs-linux-fallback.img
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# 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 11.0' {
insmod ufs2
set root=(hd0,gpt4)
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0p4
set kFreeBSD.vfs.root.mountfrom.options=rw
}
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
EDIT: forgot to mention, just before the disk partitioning, I get a warning with the following text
Your model of Lenovo is known to have a BIOS bug that prevents it booting from GPT partitions without UEFI. Would you like the installer to apply a workaround for you?
Since I'm booting with UEFI, i choose not to apply it (I even tried applying it with no success).
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub
, then generated the config file addinginsmod bsd
and--class freebsd --class bsd --class os
to my previous configuration. I get the same output as in the picture. Note that my drive is GPT partitioned. Furthermore, os-prober doesn't detect the FreeBSD partition properly, defining it as an "unknown Linux partition". Thank you for formatting my question.