Manually moving ZFS storage pool results in error

Moving a ZFS pool manually results in the following error:

Error: Failed to handle idmapped storage: Failed expanding symlinks of "": lstat /var/lib/incus/storage-pools/t1-pool: no such file or directory

I did the following:

incus stop t1
zfs create tank/containers/t1
zfs rename tank/containers/t1-pool tank/containers/t1/lxc

# Update incus db
incus admin sql global "UPDATE storage_pools_config SET value='tank/containers/t1/lxc' WHERE value='tank/containers/t1-pool'"
incus admin sql global "UPDATE instances_devices_config SET value='t1' WHERE value='t1-pool'"
incus admin sql global "UPDATE storage_pools SET name='t1' WHERE name='t1-pool'"

mv /var/lib/incus/storage-pools/t1-pool /var/lib/incus/storage-pools/t1

# Manually mount
mount -t zfs tank/containers/t1/lxc/containers/t1 /var/lib/incus/storage-pools/t1/containers/t1
mount -t zfs tank/containers/t1/lxc/custom/default_t1-mysql-vol /var/lib/incus/storage-pools/t1/custom/default_t1-mysql-vol

What am I missing?

Look for the symlinks within /var/lib/incus/containers/

1 Like

Thank you very much @stgraber !

That was the spot I didn’t know about.

So the steps manually mounting the ZFS datasets are not necessary and one just needs to update the symlink:

ln -sf /var/lib/incus/storage-pools/t1/containers/t1 /var/lib/incus/containers/t1