Two ZFS on root pools of the same name

I ran into a strange situation. I have a system that had an old FreeBSD 13.1-RELEASE installation on one drive (ada1). This is a ZFS on root with the pool named "FreeBSD". It's a BIOS type boot setup on a GPT disk. I'm not on the system now, but it's layout is something like:

Code:
=>       40  125829040  ada1  GPT  (240G)
         40       1024    1  freebsd-boot  (512K)
       1064        984       - free -  (492K)
       2048    4194304    2  freebsd-swap  (2.0G)
    4196352  121630720    3  freebsd-zfs  (230G)
I have since upgraded the motherboard on the system and added some NVME's, with one reserved for a new installation (14.0-RELEASE) using UEFI (nvd2) . The original 13.1 system ceased to boot properly after the MB upgrade (even in single user). The bootloader would load the kernel, and I would see it doing the hardware probe, then the screen would simply turn gray. The system was still functional since I was able to hit CTR+ALT+DEL to reboot it correctly. I figured I might as well just install a new copy of FreeBSD on the new NVME and perhaps mount the system and toubleshoot later.

I used the same ZFS pool name "FreeBSD". After install, I have this type of layout in addition to the existing drive:
(I'm not on the system currently, layout is accurante, sizes are not so much.)

Code:
=>      40  41942960  nvd2  GPT  (232G)
        40    409600    1  efi  (260M)
    409640      1024    2  freebsd-boot  (512K)
    410664       984       - free -  (492K)
    411648   4194304    3  freebsd-swap  (4.0G)
   4605952  37335040    4  freebsd-zfs  (228G)
  41940992      2008       - free -  (1.0M)

Much to my surprise, when I booted using this new install, it loaded my old install. I assume it's becuase ada1 is seen before nvd2.

I do not hate this, not at all. It's convenient. I wonder how this works? It seems like I could have a super tiny drive just for booting and I could point it to any ZFS pool with a FreeBSD installation. What exactly tells the UEFI boot code to load a specific ZFS pool? I do plan on renaming one of the pools.
 
It is basically a bad idea to create ZFS pools in same names on single computer.

For UEFI boot, possibly using boot1.efi built with any of latest 2 patches provided at PR 207940 could help. DO NOT TRY TO APPLY BOTH.

With the patch you chose, pool (for ZFS) or partition (for UFS) can be chosen on boot.

The differences between 2 patches are how partitions/pools are displayed for selection. Naomichi Nonaka (the original author)'s one displays using UUID of partitions/pools and mine displays using interface and number.
Note that NVMe drives are shown as disk, while SATA drives are correctly displayed as SATA. This is because UEFI header which FreeBSD has is still old and NVMe is not recognized as is, but fallback (disk).

But unfortunately, I've never tried such a situation as yours (same pool name exists), so cannot assure it works.

Another note is that sometimes boot1.efi does not accept key input (maybe because of problematic UEFI firmware, as I've never encountered on ThinkPad T420 but often [not always] encounter on ThinkPad P52).
This happenes on default loader.efi, too (encountered when I've trying it as BOOTx64.efi) and typing "2" to enter single user mode was not accepted.
 
Back
Top