That is why I was trying it first in virtualbox. I simulated 3 linux partitions that I have in my machine and rechecked them after installation. Luckily I found out the problem within virtualbox itself
I was able to solve the problem by
1. Booting into Ubuntu Linux and creating a primary partition with the type as '
a5 - FreeBSD'
Code:
Disk /dev/sda: 27.8 GB, 27796701184 bytes
255 heads, 63 sectors/track, 3379 cylinders, total 54290432 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: 0xa5991122
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 16779263 8388608 83 Linux
/dev/sda2 16779264 18876415 1048576 82 Linux swap / Solaris
/dev/sda3 18876416 20973567 1048576 83 Linux
/dev/sda4 20973568 54290431 16658432 a5 FreeBSD
I used PCBSD instead of FreeBSD since the installer doesn
't corrupt the partition table. In the PCBSD graphical installer during the "Disk" option just selected the above FreeBSD partition, clicked on Next and continuted the installation. Now, PCBSD installer won
't even touch the MBR boot loader which is what I wanted. Once the installation is over, I reboot and Grub2 is still there and I was able to boot into Ubuntu Linux as before, although I didn
't see the FreeBSD entry.
Once inside Ubuntu Linux opened the terminal and tried to do
update-grub. This didn
't work and it failed to auto-detect PCBSD. I had to add the entry for PCBSD manually:
1. Edited the file
/etc/default/grub and changed the following entry:
Code:
GRUB_DEFAULT_TIMEOUT=10
GRUB_HIDDEN_TIMEOUT_QUITE=false
2. Edited the file
/etc/grub.d/40_custom and added the following:
Code:
menuentry "PCBSD" {
set root=(hd0,4)
chainloader +1
}
Note that the value of root is (
hd0,4) where the corresponding FreeBSD partition is
/dev/sda4.
You need to run
update-grub again after step 2 before rebooting. Now reboot and you will see the PCBSD entry in the grub selection. Enjoy.