Re: gptzfsboot cannot boot from ZFS (mirror) with "can't read MOS of pool znewroot" (FreeBSD 13.5-STABLE)
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 03 Apr 2025 16:28:56 UTC
April 3, 2025 at 6:02 PM, "Volodymyr Kostyrko" <arcade@b1t.name mailto:arcade@b1t.name?to=%22Volodymyr%20Kostyrko%22%20%3Carcade%40b1t.name%3E > wrote:
> > 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").
> >
> How your partitions look like when you are trying loader.efi? Also, do you wipe your parition begin/end before switching so that loader.efi wouldn't see old ZFS magic numbers on partitions located where previous pool versions were?
I've tried it like this on first disk (ZFS partitions was intact):
% gpart delete -i 1 ada0
% gpart delete -i 2 ada0
% gpart add -t efi -i 1 -l efi0 ada0
% newfs_msdos -F 32 -c 1 /dev/gpt/efi0
% mnt -t msdos /dev/gpt/efi0 /mnt
% mkdir -p /mnt/EFI/BOOT && cp /boot/loader.efi /mnt/EFI/BOOT/BOOTX64.efi
% umount /mnt
After that partiton table on ada0 looks like this (it is not copy-n-paste, more manual recreation, as I've returned all back):
=> 40 3907029088 ada1 GPT (1.8T)
40 984 - free - (492K)
1024 1024 1 freebsd-boot (512K)
2048 2097152 2 freebsd-ufs (1.0G)
2099200 65177600 3 freebsd-swap (31G)
67276800 3839750144 4 freebsd-zfs (1.8T)
3907026944 2184 - free - (1.1M)
=> 40 3907029088 ada0 GPT (1.8T)
40 984 - free - (492K)
1024 2098176 1 efi (1.0G)
2099200 65177600 3 freebsd-swap (31G)
67276800 3839750144 4 freebsd-zfs (1.8T)
3907026944 2184 - free - (1.1M)
I've re-booted and disable "Legacy boot" in BIOS. BIOS shows that I have "UEFI OS" on SATA:0. When I try to boot it, it shows banner from `loader.efi` and then "Failed to find bootable partition" from loader.efi. After that it fall through to EFI Shell.
It is hard to do many experiments, as it is remote system and I need to request iKVM access which is provided only for short time.
I've revivded system by booting in legacy way from second drive.
As my ZFS mirror is only ZFS pool, I don't think there is any ZFS signatures on partitons 1 and 2, nothing to wipe.
> I mean I had very similar booting issue when I moved my boot to other drives, and table changed from efi + zpool to efi + swap + zpool
I could try to wipe swaps, but as far as I remember, these paritions always were swap space.
It worked with gtpzfsboot for long time (like, from FreeBSD 9, I'm updating this system live, without re-installing, for long-long time) but it stopped to work after HDD failure & replacement. After ZFS mirror was rebuild gptzfsboot stops to work and I fixed this by creating freebsd-ufs partitons (As you can see, it cut 1G ftom swap! Of course, my swap partitons were created as 32G and now they are only 31G).
--
// Lev Serebryakov