FreeBSD 14.1 does not load after installing Linux on the second SSD

Hello,

I have the following setup: FreeBSD 14.1 installed on the first SSD. Though the machine has UEFI support, it was turned off during the installation process, so I ended up with a legacy boot. But it worked fine.

A few days ago, I installed Linux on the second drive. I turned on UEFI in BIOS, so Linux was installed on the second drive. My idea was to play with Linux and then continue to use FreeBSD by simply switching back to legacy boot in BIOS.

After I returned to the legacy boot, FreeBSD does not load anymore. I have checked that the FreeBSD partitions weren't altered by the Linux installation. I also mounted the ZFS pool and verified that the FreeBSD data is still there.

Here is the output of gpart:

IMG_0115.png


I found this thread and tried to apply the solution by running
Code:
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
, but it didn't help. Now I'm wondering what has happened and how to boot the system again.

P.S. I also remember that the FreeBSD installer gave me a warning during the installation:

IMG_0105.png


Could this be related to the issue?
 
The gpart(8) man page has information about the Lenovo workaround that the installer is talking about. It's in section ATTRIBUTES.

You can choose to use UEFI to boot FreeBSD. Just create a partition of type "efi" with gpart(8), create a FAT32 filesystem on it with newfs_msdos(8) and put the file /boot/loader.efi there. If the EFI filesystem is mounted at /boot/efi (its typical mount point), then loader.efi should be copied to /boot/efi/efi/boot/bootx64.efi. The man page uefi(8) might be useful. Given your current partitioning scheme, you may need to reduce the size of the swap partition (delete and recreate) in order to free up space for the EFI system partition.
 
Hi JordanG,

Running the gpart set -a lenovofix /dev/ada0 command actually solved my problem.

Thank you for pointing me to the gpart attributes section!
 
Back
Top