Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Wanting to try several operating-systems, I installed the following on a MBR-partitioned harddrive:

Partition 1: FreeBSD on UFS split in root-slice and swap.

No problem booting...

Partition 2: PC-BSD on UFS split in root-slice, swap, var and usr

Got a menu allowing me to choose between the two, no problem booting either...

Partition 5: (logical 1): LinuxMint root-partition (using other logical partitions for swap etc.)

Installed GRUB2, no problem booting LinuxMint, but no way to select other OS'.

In /etc/grub.d I then added the following entries:

15_freebsd:

#!/bin/sh -e
echo "Adding FreeBSD..."
cat << EOF
menuentry "FreeBSD" {
   set root=(hd0,1)
   chainloader (hd0,1)+1
   }
EOF

16_pcbsd:

#!/bin/sh -e
echo "Adding PC-BSD..."
cat << EOF
menuentry "PC-BSD" {
   set root=(hd0,2)
   chainloader (hd0,2)+1
   }
EOF

I set them both to executable, ran grub2-update and grub-install /dev/sda.

I now had entries for both FreeBSD and PC-BSD. Using the one for FreeBSD worked as expected, I booted into FreeBSD... But using the one for PC-BSD, also booted into FreeBSD - not PC-BSD as I'd expected.

I can't frankly see what I did wrong, so chainloading obviously doesn't work for my set-up. I was therefor wondering what the correct parameters to boot PC-BSD directly (ie. without chainloading) from GRUB installed under LinuxMint? The weirdest part is of course that the PC-BSD entry "worked" - it just booted the wrong OS...

(Of course, any ideas on why chainloading worked with FreeBSD but not PC-BSD would also be a help.)

share|improve this question
1  
Your grub setup seems to be correct. Inside Linux, what is the result of a fdisk -l. Could you post it here? –  nwildner Jun 10 '13 at 13:55
    
I pasted the result here: pastebin.com/038yc5K3 I did fool around a bit, and by changing the boot-flag from FreeBSD to PC-BSD, PC-BSD booted instead. However, boot-flag for both, for another OS (Solaris) or for non at all (no boot-flag at all); all caused FreeBSD to boot. Obviously I need an alternative to chainloader. –  Baard Kopperud Jun 12 '13 at 1:03
    
I was a bit unclear: "by changing the boot-flag from FreeBSD to PC-BSD, PC-BSD booted instead." Unfortunately, it was now PC-BSD which was booted for both the FreeBSD and PC-BSD menu-choice (instead of FreeBSD for both). –  Baard Kopperud Jun 12 '13 at 1:12
    
So, Looking at your configuration, it seems that the setroot is ok(since partitions now start with 1 on grub2...what a mess). What about if you use the ufs2 module taking a different way as explained here: - slackwiki.com/Dual_Booting_With_FreeBSD_9 - The root entries of each OS remains the same, for sure ;) –  nwildner Jun 12 '13 at 10:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.