How-to boot FreeBSD with Grub2 under Ubuntu 10.10
I recently upgrade to Ubuntu 10.10. Which also caused grub to be updated to version 1.98 (to be exactly {1.98+201000804-5ubuntu3), which used a different syntax to define partitions instead of numbers which where off by one, they now use msdosX style formatting.
My FreeBSD is located at /dev/sda3 on a good old MBR partition table and I want to use the good old FreeBSD boot loader as well (so chainloading is required). To activate within Ubuntu. Put the following contents in file:/etc/grub.d/40_custom:
#!/bin/sh
exec tail -n +3 $0
# 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 (on /dev/sda3)" {
savedefault
insmod chain
set root='(hd0,msdos3)'
chainloader +1
}
Note
My hd0 is file:/dev/sda under Linux and got named file:/dev/ad6 under FreeBSD If you want to boot of a GPT partion use the following syntax
#!/bin/sh
exec tail -n +3 $0
# 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 (on /dev/ad6p3)" {
savedefault
insmod ufs2
set root='(hd0,gpt3)'
kfreebsd /boot/loader
}
Update your grub and use should be done: rick-eee$ sudo update-grub
Download as: plain text
