Just keep one more installation in another dataset + one more ext4 boot partition. Label the boot partitions accordingly and refind will ask you which of them to boot. Be sure to have same /etc/hostid. Boot (or chroot) regularily into “rescue”-installation to do updates.
I have mountpoint=legacy for root datasets.
Relevant parts:
# /etc/fstab
z2/os/cachy / zfs rw,relatime,xattr,posixacl,casesensitive 0 1
LABEL=cachy_boot /boot ext4 defaults 0 0
LABEL=EFI /boot/efi vfat umask=0077 0 0
# /boot/refind.conf
"Boot standard" "rootfstype=zfs zfs_import_dir=/dev/disk/by-id zfs=z2/os/cachy rw"
And for “rescue”:
# /etc/fstab
z2/os/rescue / zfs rw,relatime,xattr,posixacl,casesensitive 0 1
LABEL=rescue_boot /boot ext4 defaults 0 0
LABEL=EFI /boot/efi vfat umask=0077 0 0
# /boot/refind.conf
"Boot standard" "rootfstype=zfs zfs_import_dir=/dev/disk/by-id zfs=z2/os/rescue rw"
You can setup everything from the original system.
snap/send/recv root partition. Mount (for instance to /mnt) and edit fstab.
Make a new boot partition, mount to /mnt/boot. Copy everything except efi contents (that’s already on the single EFI partition for both systems) from /boot/ to /mnt/boot/. Edit refind.conf.
chroot and do a mkinitcpio (or just reinstall linux-..., that’ll do the initrd too), so that the new (rescue) fstab is written to the initrd (otherwise it’ll boot into the original system, even if you chose “rescue” in refind).
— Warning —
People will tell you not to dual (multi) boot in the same zpool. I think, as long as it’s the same os and, more importantly, the same zfs version, it’s ok. (Having “some rescue disk” made “somehow” by “someone” is worse; if you do it yourself, you know exactly what it is).
Be very careful on every step.
This is not a step by step “how-to”, more like a “general idea”. You have to understand what’s happening, otherwise stuff will break.