Comment 23 for bug 432254

Revision history for this message
Peter Belew (peterbe) wrote :

This problem, at least for FreeBSD, seems to have been solved in 12.04 "Precise Pangolin":

I just upgraded a system from 11.04 to 11.10, then to 12.04 yesterday. It has Ubuntu, Windows XP, and FreeBSD 8.1 installed in it, similar to the configuration of the system I originally reported this bug on. (That system, with a C3 CPU, won't run recent versions of Ubuntu, and now has a recent 486 version of Debian on it).

Ubuntu version and kernel version
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"
Linux billy 3.2.0-24-generic #37-Ubuntu SMP Wed Apr 25 08:43:52 UTC 2012 i686 i686 i386 GNU/Linux
model name : Intel(R) Celeron(R) CPU 1.70GHz
cpu MHz : 1691.571
MemTotal: 2029480 kB
SwapTotal: 522076 kB

Partitioning looks like:
# fdisk -l /dev/sda

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8f800000

   Device Boot Start End Blocks Id System
/dev/sda1 63 81915434 40957686 7 HPFS/NTFS/exFAT
/dev/sda2 81915435 82493774 289170 83 Linux
/dev/sda3 * 82493775 192715739 55110982+ a5 FreeBSD
/dev/sda4 192715740 312576704 59930482+ 5 Extended
/dev/sda5 192715803 217295189 12289693+ 83 Linux
/dev/sda6 217295253 218339414 522081 82 Linux swap / Solaris
/dev/sda7 218339478 312576704 47118613+ 83 Linux

/dev/sda2 is a /boot partition
/dev/sda5 is "/"
/dev/sda7 is "/home"

After running update-grub, the stanzas for Windows XP and FreeBSD in /boot/grub/grub.cfg now look like

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" --class windows --class os {
        insmod part_msdos
        insmod ntfs
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root 127855CF7855B1E9
        drivemap -s (hd0) ${root}
        chainloader +1
}
menuentry "FreeBSD 8.1-RELEASE (GENERIC) (on /dev/sda3)" --class windows --class os {
        insmod part_msdos
        insmod ufs2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 4b2e8da4ae6a55e3
        drivemap -s (hd0) ${root}
        chainloader +1
}
### END /etc/grub.d/30_os-prober ###

I believe there is a FreeBSD bootloader in /dev/sda3. At any rate, when I select the FreeBSD entry in the Grub2 menu, it loads the FreeBSD bootloader, which displays the usual boot options.

Previously, I had this content in /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 8.1" {
      set root=(hd0,3)
      chainloader +1
}

After upgrading to "precise", there were 2 entries for BSD in the Grub2 boot menu: the one produced automatically and the one produced by my 40_custom file. So I commented out the FreeBSD stuff in this file, re-ran update-grub, and am left with only the "FreeBSD 8.1-RELEASE (GENERIC) (on /dev/sda3)" entry created by the partition scan.

Actually, this may have been fixed already in 11.10, but I didn't notice whether there were one or two FreeBSD entries in the boot menu after that upgrade; I upgraded right away to 12.04.

I believe that it's necessary to have the FreeBSD boot loader in the FreeBSD partition ("slice"). It might be possible to install FreeBSD without a boot loader at all, and have the code run by update-grub find the FreeBSD kernel, but someone needs to verify whether this is possible.