I rebooted my LXD host, and right before that I upgraded releases from 20.04.x to 22.04.2. After that, my two containers that run on an encrypted ZFS dataset won’t start.
The error I get is:
# lxc start mycontainer
Error: Failed to mount "zpool0/enc/lxd-storage/containers/mycontainer" on "/var/snap/lxd/common/lxd/storage-pools/enc/containers/mycontainer" using "zfs": input/output error
Try `lxc info --show-log mycontainer` for more info
The log command doesn’t show anything useful:
# lxc info --show-log mycontainer
Name: mycontainer
Status: STOPPED
Type: container
Architecture: x86_64
Created: 2021/12/06 00:31 AEDT
Last Used: 2023/02/18 15:39 AEDT
Log:
Note that after a reboot, I have to manually mount the encrypted ZFS dataset with zfs mount -l -a
and entering the password. I know I did this right because I can see data in this dataset. I do note though that when I did this, I did get errors related to some backup datasets I had made in the past:
# zfs mount -l -a
cannot mount 'zpool0/containerbackups/mycontainer': Input/output error
cannot mount 'zpool0/containerbackups/myothercontainer': Input/output error
I don’t know if that’s related, or a cause.
LXD version:
# snap list lxd
Name Version Rev Tracking Publisher Notes
lxd 5.11-ad0b61e 24483 latest/stable canonical✓ -
The dataset is there:
# zfs list | grep mycontainer
zpool0/containerbackups/mycontainer 494M 484G 4.02T /zpool0/containerbackups/mycontainer
zpool0/enc/lxd-storage/containers/mycontainer 5.80T 484G 5.24T legacy
zpool0/enc/tmp/mycontainer-pristine 27.9M 484G 633M none
The mount namespace has mounts for my other (non-encrypted) running containers but none for my encrypted ones (makes sense, seeing as they’re not running):
# nsenter --mount=/run/snapd/ns/lxd.mnt -- cat /proc/mounts | grep lx
... (snip) ...
zpool0/main/lxd-storage/containers/othercontainer /var/snap/lxd/common/lxd/storage-pools/default/containers/othercontainer zfs rw,relatime,xattr,posixacl 0 0
... (snip) ...
I tried restarting LXD once the encrypted dataset was mounted, but it didn’t help:
systemctl restart snap.lxd.daemon
This restarted all the running (non-encrypted) containers, but didn’t help in allowing me to start my encrypted one.
What can I do to get this working, please?