Solved Ubuntu install on second hard drive corrupted FreeBSD install on first

Long story short : Installed Ubuntu on a nvme drive connected as second hard drive - that somehow affected the primary hard drive booting process which has FreeBSD installed.

Now when I boot the system and try to boot from the first hard drive - it says something like "Reset System".

I can see the primary drive having the EFI boot on one of the partitions when I check lsbld output from the Ubuntu install - so hopefully the data/partitions aren't affected.

How do I recover the FreeBSD login?

(And additionally why does Ubuntu install interfere with the primary hard drive ? I totally didn't expect that and it makes no sense. I thought my system would boot normally after the install on the secondary hard drive, but turns out I was wrong!)
 
Ubuntu being helpful it probably recognized that you can't normally boot from a second harddrive and tried to fix it for you.

The easiest way forward is probably to have the Ubuntu make a grub2 menu entry for FreeBSD, so that you can select FreeBSD from there. Once FreeBSD is up you can fix its bootloader.
 
Ubuntu being helpful it probably recognized that you can't normally boot from a second harddrive and tried to fix it for you.

The easiest way forward is probably to have the Ubuntu make a grub2 menu entry for FreeBSD, so that you can select FreeBSD from there. Once FreeBSD is up you can fix its bootloader.
Tried to follow this post for grub entry - didn't seem to work. Here is my primary freebsd installation
And this is what I tried to put in /etc/grub.d/40_custom :
Code:
#adding entry for freebsd
menuentry "FreeBSD" {
set root=(sda2,2)                   
chainloader (sda2,gpt2)/boot/loader_4th.efi
}
followed by sudo update-grub

I must be doing something wrong
Screenshot from 2023-04-12 00-48-29.png

PS: It doesn't seem to be going to the selection menu at all - just goes to the Ubuntu login screen
 
Poke around in /etc/default/grub, maybe the delay time in the menu is set to zero.

I also think that root=... should be set to your Linux boot partition (not root).
 
I once replied to somebody about grub here, you may find it useful.

Two hints from my side:
- if you're chainloading just do +1 and let bootloader "do its thing"
- make sure device.map on Linux points to the disks properly

And additionally why does Ubuntu install interfere with the primary hard drive ?
You may have accidentally do it yourself. I don't recall how does Ubuntu deal with multiboot but some installers (e.g. SuSE) let you decide how to deal with the bootloader. You may have missed that.
 
Use the FreeBSD loader.efi (instead of loader_4th.efi) from the ESP (/dev/sda2 efiboot0) rather than from the root system (/boot/loader.efi).
Code:
menuentry "FreeBSD" {
    insmod fat
    root=(hd0,gpt2)
    chainloader /efi/freebsd/loader.efi
}
 
Use the FreeBSD loader.efi (instead of loader_4th.efi) from the ESP (/dev/sda2 efiboot0) rather than from the root system (/boot/loader.efi).
Code:
menuentry "FreeBSD" {
    insmod fat
    root=(hd0,gpt2)
    chainloader /efi/freebsd/loader.efi
}
This nailed it!

Thank you so much - don't know what i'd do without you wonderful people!
You may have accidentally do it yourself. I don't recall how does Ubuntu deal with multiboot but some installers (e.g. SuSE) let you decide how to deal with the bootloader. You may have missed that.
I doubt that - I tried to manually install and format this other drive and specially was looking that I don't interfere with my primary drive.
Poke around in /etc/default/grub, maybe the delay time in the menu is set to zero.
Yes, was able to get the boot selection from this. the other part was proving to be difficult to get right.
 
Back
Top