Dual boot FreeBSD & Linux

ada0 => freebsd
ada1 => SElinux

both on x86 machine. Both using MBR.
What do I need to dual boot? How do I set that up. Thx!
 
Sure, but that's just a matter of using the correct (hd<d>,<p>) specs in the grub config, with <d> being the disk number and <p> being the partition number.
 
Sure, but that's just a matter of using the correct (hd<d>,<p>) specs in the grub config, with <d> being the disk number and <p> being the partition number.
Okay thx. I’ll give it a shot. BTW, should I install GRUB2 on freebsd, linux or both? And which gets the config treatment?
 
Never tried that myself, I assume it doesn't matter. But isn't it the "default" bootloader on Linux anyways? So I'd just try to configure it from there I guess…
 
Just an alternative idea: turn on and immediately open BIOS menu selections for boot sequence. Select the boot device directly from there.
 
Never tried that myself, I assume it doesn't matter. But isn't it the "default" bootloader on Linux anyways? So I'd just try to configure it from there I guess…
No boot loader got installed on Gentoo when I installed it yesterday. What confuses me is that both HDDs have an MBR. So if I install GRUB2 on the Gentoo HDD-the second one- then I suppose I should tell BIOS to boot from there first in order to get the boot menu?
 
No boot loader got installed on Gentoo when I installed it yesterday.
That would mean there would be no way to boot the system. So maybe double-check that. A boot loader doesn't HAVE to display something while doing its work. I don't know Gentoo, but I'd be surprised if it did use something other than grub.
So if I install GRUB2 on the Gentoo HDD-the second one- then I suppose I should tell BIOS to boot from there first in order to get the boot menu?
Yes, probably. Or alternatively, just install grub to the MBR of the first disk. Which is possible from either system, IIRC with command grub-install.
 
That would mean there would be no way to boot the system. So maybe double-check that. A boot loader doesn't HAVE to display something while doing its work. I don't know Gentoo, but I'd be surprised if it did use something other than grub.

Yes, probably. Or alternatively, just install grub to the MBR of the first disk. Which is possible from either system, IIRC with command grub-install.
Okay! Lot’s of help!! Thx.
 
I usually use Linux's grub to boot FreeBSD. Gentoo may require you to explicitly install the boot loader, I've not done a Gentoo install since a 2 month recuperation period after surgery a few years ago. I have a page on grub2. https://srobb.net/grub2.html
I'm guessing this isn't a UEFI boot. Depending upon how Linux is referring to your hard drives, (the ad sounds like FreeBSD, with Linux, it's probably sd), you'd install grub in Linux (Gentoo?) and then in /boot/grub/ (if that's the name, again, I don't know about Gentoo, in RedHat based systems it's /boot/grub2), you have a custom.cfg. There are various versions. This one works for me on legacy bios with FreeBSD.
Code:
menuentry "FreeBSD" {
set root='(hd0,1)'
kfreebsd /boot/loader
}

That assumes that FreeBSD is on the first partition. Grub counts partitions as 1,2,3 rather than 0,1,2.
If that doesn't work, then replacing kfreebsd /boot/loader with

Code:
chainloader (hd0,1)+1
may work.
 
I usually use Linux's grub to boot FreeBSD. Gentoo may require you to explicitly install the boot loader, I've not done a Gentoo install since a 2 month recuperation period after surgery a few years ago. I have a page on grub2. https://srobb.net/grub2.html
I'm guessing this isn't a UEFI boot. Depending upon how Linux is referring to your hard drives, (the ad sounds like FreeBSD, with Linux, it's probably sd), you'd install grub in Linux (Gentoo?) and then in /boot/grub/ (if that's the name, again, I don't know about Gentoo, in RedHat based systems it's /boot/grub2), you have a custom.cfg. There are various versions. This one works for me on legacy bios with FreeBSD.
Code:
menuentry "FreeBSD" {
set root='(hd0,1)'
kfreebsd /boot/loader
}

That assumes that FreeBSD is on the first partition. Grub counts partitions as 1,2,3 rather than 0,1,2.
If that doesn't work, then replacing kfreebsd /boot/loader with

Code:
chainloader (hd0,1)+1
may work.
Much obliged scottro!! I just tried the BIOS boot from 2nd HDD trick. It wanted to work but got a kernel panic. Root partition hosed. Got to gox THAT and try YOUR “good stuff!”. Thx
 
Got it working like a champ!!

Code:
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LM048-2E71
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 6D886D0A-6F2B-4AB1-B7CE-2539B137FA06

Device          Start        End   Sectors   Size Type
/dev/sda1        2048  976476159 976474112 465.6G Linux filesystem
/dev/sda2   976476160  980672511   4196352     2G Linux swap
/dev/sda3   980672512  980673535      1024   512K FreeBSD boot
/dev/sda4   980673536 1945362423 964688888   460G FreeBSD UFS
/dev/sda5  1945362424 1953525134   8162711   3.9G FreeBSD swap

Thanks everybody!!
 
Back
Top