Re: gptzfsboot cannot boot from ZFS (mirror) with "can't read MOS of pool znewroot" (FreeBSD 13.5-STABLE)

From: Daniel Kalchev <daniel_at_digsys.bg>
Date: Mon, 14 Apr 2025 13:44:15 UTC
I had exactly the same problem with a Supermicro system recently. It was 
running 13.2-STABLE, updated to 14.2-RELEASE via src. It has two 
mirrored 256GB SSD drives for boot (and 30+ drives for data, on an LSI 
controller with BIOS disabled).

The system can boot either legacy (GPT) or UEFI. Tried all possible 
combinations, none worked. Ended up sending the ZFS pool to a network 
volume,  then reinstalling the system from the installation media (USB 
memstick), and receiving the pool back. No idea what was wrong with this 
pool and why it would not boot from it.

The pool was originally created by:

FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr 9 
04:24:09 UTC 2021

Tried various loader.efi and gptzfsboot, from 13.3 and 14.2... same result.

Daniel

On 4/3/25 19:35, Miroslav Lachman wrote:
> On 03/04/2025 17:21, Lev Serebryakov wrote:
>> Hello!
>>
>>    I have ZFS mirror built from two GPT partitions on two SATA 
>> drives. It is only ZFS pool on the system, and it looks completely 
>> healthy:
>
> [...]
>
>> ZFS: i/o error - all block copies unavailable
>> ZFS: can't read MOS of pool znewroot
>>
>>    As a hack I'm using `gtpboot` & small `freebsd-ufs` partiton with 
>> only `/boot` directory.
>>
>>    But I hate this hack, as system update becomes cumbersome, and I 
>> cannot convert this system to UEFI boot (because `loader.efi` "Failed 
>> to find bootable partition").
>>
>>    What is wrong with my ZFS pool and how could I fix it?
>
> Is it possible that you have disk drives larger than 2TB and the boot 
> data is written somewhere after that 2TB barrier?
>
> The strangest thing is that it can work for a while when data is 
> written in the beginning of the drives, then you make some system 
> update / upgrade and then it cannot boot anymore when boot data is 
> written too far away.
>
> I experienced this problem on my old HP MicroServer Gen8 with 4TB 
> drives. 2TB drives worked fine, also those 4TB drives booted fine in 
> another machine (X9 Supermicro) so this was coincidence with "bad" BIOS.
> I solved it by creating small partitions on the beginning of the 
> drives - about 20GB to contain boot and all the FreeBSD system data. 
> ZFS mirrored and booting without an issues. The rest of the drives are 
> ZFS mirrored in another pool for storage (the machine serves as NAS)
>
> Kind regards
> Miroslav Lachman
>
>