1

I have a computer with several operating-systems installed on different partitions:

  1. FreeBSD
  2. PC-BSD
  3. Solaris
  4. Extended Partition
  5. / -partition for Linux-Mint
  6. Swap for Linux-Mint
  7. /home for Linux-Mint
  8. / -partition (and everything) for Linux CentOS

My main OS is Linux-Mint, an Ubuntu derivitive.

I have GRUB2 installed in MBR, and it (GRUB) uses data from the Linux-Mint installation (/boot/grub etc.).

FreeBSD and PC-BSD each has their own 2nd stage boot-loader in their partition. Solaris has it's own GRUB-installation in it's partition (which act as a 2nd stage boot-loader, enabling me to select between different Solaris-kernels). Linux-Mint and CentOS are booted by the GRUB in MBR.

+++

My problem is FreeBSD and PC-BSD -- they just won't play nice with eachother! Even though I've specified different root-partitions etc. in the GRUB-entries for the two BSD-installation; the same one (either FreeBSD or PC-BSD) is booted, no matter if I selected FreeBSD or PC-BSD from the GRUB-menu.

Booting *BSD appears to be a three stage process: The MBR-loader (1st stage), loads a 2nd stage in the BSD-partitions, which finally loads the actual kernel (3rd stage).

Finally lowering myself to RTFM about booting in *BSD, I discovered the following tidbit about the 2nd stage BSD-bootloader (which has been installed in both of my BSD-partitions):

  • If no BSD-partition is marked as the active one (the bootable) in the partition-table, then the loader will commence 3rd stage loading of the BSD-kernel loacated in the 1st BSD-partition on the disk -- no matter from which BSD-partition the 2nd stage was loaded. In my case, it'll always load FreeBSD (since it's first).
  • If on the other hand a BSD-partition is marked as active (bootable), this will be the BSD-kernel that will be loaded as 3rd stage. In my case, I'll either always get FreeBSD or always get PC-BSD.

Surely there must be some way around this?! Perhaps somehow skipping the 2nd stage, and let GRUB load the 3rd stage kernel directly -- and then different kernels depending on my choice... Or perhaps some special arguments or configurations for the 2nd stage -- or maybe an alternative 2nd stage loader? Has someone here come across a similar problem and solved it?

PS: The installation of GRUB in the MBR, overwrote the 1st stage boot-loader installed by FreeBSD (and PC-BSD). I howver doubt using the FreeBSD 1st stage would've solved my problem, since the problem is (AFAIK) the 2nd stage loader.

0

First, I would not use MBR, because you have there 4 OS's and that will not go far. You need to have the /boot partition as primary and not extended. So you either throw out the Solaris installation, or the Linux one. Booting into FreeBSD (or PC-BSD... whatever, makes no difference) with GRUB2 is easy. You just define your "set root=..." and then you say "kfreebsd /boot/loader" and there you go. For your type, I would use GUID/GPT partition table, there you can also split all partitions up into it, you do not need to have extra BSD slices then.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.