OTOH that link deals with s single HDD with 4 partitions. I’ve got 2 HDDs each dedicated to an OS.grub should be able to handle that, see for example https://forums.freebsd.org/threads/how-do-i-configure-grub2-to-boot-freebsd-11-1.65992/
But I'd recommend rethinking that, most of the time, you have one "preferred" system and it's easy (and more flexible) to virtualize the other one (bhyve, kvm, virtualbox, ...). Well, just as a suggestion.
Okay thx. I’ll give it a shot. BTW, should I install GRUB2 on freebsd, linux or both? And which gets the config treatment?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.
Very good! A KISS solution to boot. I’ll give it a shot. Thx!Just an alternative idea: turn on and immediately open BIOS menu selections for boot sequence. Select the boot device directly from there.
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?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…
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.No boot loader got installed on Gentoo when I installed it yesterday.
Yes, probably. Or alternatively, just install grub to the MBR of the first disk. Which is possible from either system, IIRC with commandSo 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?
grub-install
.Okay! Lot’s of help!! Thx.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 commandgrub-install
.
menuentry "FreeBSD" {
set root='(hd0,1)'
kfreebsd /boot/loader
}
chainloader (hd0,1)+1
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!”. ThxI 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
may work.Code:chainloader (hd0,1)+1
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