I am trying to create a multiboot setup using zfsbootmenu. My current system is booting from zfsbootmenu with an encrypted root. The zfs setup is:
NAME MOUNTPOINT
mypool none
mypool/ROOT none
mypool/ROOT/arch /
mypool/home /home
I am using a fat32 partition mounted at /efi
via fstab for EFI boot. All is working as expected.
I want to clone my current system to another drive and be able to select which system to boot using zfsbootmenu.
So I:
- Created a new pool (
mypool2
) using the same command as was used to createmypool
- Used
syncoid -r
to sendmypool/ROOT
andmypool/home
tomypool2
- Copied zfs properties (
canmout, mountpoint, bootfs
&org.zfsbootmenu:commandline
) frommypool
tomypool2
for the datasets where they were set
Now the pools look identical except for their name:
NAME MOUNTPOINT
mypool none
mypool/ROOT none
mypool/ROOT/arch / (bootfs set, canmount=noauto)
mypool/home /home
mypool2 none
mypool2/ROOT none
mypool2/ROOT/arch / (bootfs set, canmount=noauto)
mypool2/home /home
If I run zfs get all
on each dataset in both pools and then run a diff on the outputs, the ZFS properties are also identical except for metadata that ZFS manages, specifically: creation, available, referenced, logicalreferenced, createtxg, guid, objsetid, written, snapshots_changed
.
Both pools have keylocation=file:///etc/zfs/zroot.key
in the parent dataset, and use the same passphrase which is in the file.
I can manually mount mypool2
using zfs load-key -L prompt mypool2
, and then mount to a tmp directory.
I was expecting at this point to be able to boot into mypool2
using zfsbootmenu, however it is not working.
On boot, it asks me for the passphrase for both mypool
and mypool2
and shows both pools as options in the menu. If I do CTRL-P in zfsbootmenu it shows both pools. So far so good.
When I select mypool2
to boot, it fails with:
:: running hook [zfs]
ZFS: Importing pool mypool2.
cannot import 'mypool2': no such pool available
cachefile import failed, retrying
cannot import 'mypool2': no such pool available
ERROR: ZFS: unable to import pool mypool2
I am not sure if it is related to the hostids being the same, keylocation, cachefile or something else.
I noticed that on each boot in zpool history
, there is a pair of zpool import
and zpool load-key
commands for mypool
when it succesfully boots.
However in the zpool history
for mypool2
there is no load-key command
when the boot fails.
So I have tried each of the following, and tested booting mypool2
after each change without success:
- Re-run
generate-zbm
andmkinitcpio -R
- Set
keylocation=prompt
onmypool2
(reverted when it didn’t work) - Removed
spl.spl_hostid
fromorg.zfsbootmenu:commandline
onmypool2/ROOT
(reverted when it didn’t work) - Set
cachefile=none
onmypool2
(reverted when it didn’t work)
I have been racking my brain and can’t really think of what else could be the problem. I don’t really understand the hostid stuff either.
Can anyone shed some light on what the issue could be?
Thanks!!!