Hi all,
I am trying to dual boot openSUSE 12.2 and FreeBSD 9.0, but FreeBSD does not appear in the openSUSE grub2 menu. I have installed ‘gawk’ package (got this idea from the Ubuntu forums). I tried adding the following to 40_custom (got this too from Ubuntu forums), but it didn’t detect FreeBSD:
menuentry “FreeBSD” {
set root=(hd0,1)
chainloader+1
}
You need this version of os-prober to read ufs2 partitions. Here’s an example:
# os-prober
No volume groups found
/dev/sda1:Windows NT/2000/XP (loader):Windows:chain
/dev/sda11:Linux Mint 12 Lisa (12):LinuxMint:linux
/dev/sda13:Arch Linux (rolling):archlinux:linux
/dev/sda16:Debian GNU/Linux (squeeze/sid):Debian:linux
/dev/sda3:FreeBSD:FreeBSD 8.1-RELEASE:freebsd
/dev/sda6:Ubuntu 12.04.1 LTS (12.04):Ubuntu:linux
/dev/sdb1:Windows NT/2000/XP (loader):Windows1:chain
/dev/sdb6:Mandriva Linux 2010.2 (2010.2):MandrivaLinux:linux
Further, if you want Grub2 to generate boot entries for BSD, you need to add this code to /etc/grub.d/30_os-prober. Saying that, I realize that I should have written a separate script … anyway.
freebsd)
cat << EOF
menuentry "${LABEL} (on ${DEVICE})" --class freebsd --class os {
EOF
ufsid=`${grub_probe} --device ${DEVICE} --target=fs_uuid`
save_default_entry | sed -e "s/^/ /"
${grub_probe} --device ${DEVICE} --target=fs | sed "s|^| insmod |"
${grub_probe} --device ${DEVICE} --target=drive | sed "s|^\((.*,\)^0-9]*\([0-9]*\))| set root='\1\2,a)'|"
cat << EOF
search --no-floppy --fs-uuid --set=root $ufsid
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:ufsid/$ufsid
set kFreeBSD.vfs.root.mountfrom.options=rw
}
EOF
;;
netbsd)
cat << EOF
menuentry "${LABEL} (on ${DEVICE})" --class netbsd --class os {
EOF
save_default_entry | sed -e "s/^/ /"
${grub_probe} --device ${DEVICE} --target=fs | sed 's|^| insmod |'
${grub_probe} --device ${DEVICE} --target=drive | sed 's|^| set root=|p;$s|set root=(hd\([0-9]*\),.*|knetbsd /netbsd --root=wd\1a|'
cat << EOF
}
EOF
;;
openbsd)
cat << EOF
menuentry "${LABEL} (on ${DEVICE})" --class openbsd --class os {
EOF
save_default_entry | sed -e "s/^/ /"
${grub_probe} --device ${DEVICE} --target=drive | sed 's|,[a-zA-Z]*|,|;s|^| set root=|'
cat << EOF
chainloader +1
}
EOF
;;
But if you have no idea how to edit this script, then don’t!
@ please_try_again,
thank you for your reply. The isssue solved after an update. Now, FreeBSD appears in the grub2 menu but when I select FreeBSD, the following error appears:
There was an update of grub2-branding-openSUSE yesterday, and it did rewrite the Grub menu. That’s why you can see the entries you added in 40_custom now. So you were lucky. But next time don’t wait for a Grub or kernel update to refresh your Grub menu (you might wait long). just run:
# grub2-mkconfig -o /boot/grub2/grub.cfg
Do you get it? Each time you modify 40_custom, you’ll have to run this command. And you will have to do it pretty soon because …
@please_try_again
sorry for the late reply. but it didnt work out. gave me the same error. anyway, i am setting aside my plan to install FreeBSD as i just discovered that FreeBSD does not support ext4 partitions. maybe, i’ll try LFS or Gentoo. not yet decided. and thank you for your support.