I was trying to run lxd-to-incus tool (running lxd snap on debian 11) and it failed while moving instances
root@winterfell:/etc/ssh# lxd-to-incus
=> Looking for source server
==> Detected: snap package
=> Looking for target server
==> Detected: systemd
=> Connecting to source server
=> Connecting to the target server
=> Checking server versions
==> Source version: 5.19
==> Target version: 0.4
=> Validating version compatibility
=> Checking that the source server isn't empty
=> Checking that the target server is empty
=> Validating source server configuration
The migration is now ready to proceed.
At this point, the source server and all its instances will be stopped.
Instances will come back online once the migration is complete.
Proceed with the migration? [default=no]: yes
=> Stopping the source server
=> Stopping the target server
=> Wiping the target server
=> Migrating the data
Error: Failed to move "/var/snap/lxd/common/lxd/" to "/var/lib/incus/": Failed to run: mv /var/snap/lxd/common/lxd/ /var/lib/incus/: exit status 1 (mv: cannot remove '/var/snap/lxd/common/lxd/storage-pools/default/images/d79756b3f0262191c5296b068d260c9d6375797777ba3bda06a00846e42fadbd': Device or resource busy
mv: cannot remove '/var/snap/lxd/common/lxd/storage-pools/default/images/4b6fa882f40cd22541d37617f21e6f2a196b1bfdd6bec5b723ac00cbe0f87c81': Device or resource busy
mv: cannot remove '/var/snap/lxd/common/lxd/storage-pools/default/images/bbd00b4cf7784f7081ec704269c4da5908f80ce4e9cbc3deac32f9cae5ff0bb0': Device or resource busy)
I never experienced this error, it seems like zfs error connected to images dataset or snapshots…
after that I inspected /var/lib/incus and most of the content seemed copied.
thanks for anwer, changed the symlinks and instances are working!
i tried to check that “Device or resource busy” seems to be connected to some ZFS issue,
while checking zfs pool (cnt/lxd dataset is configured as default storage pool) images that refused to move were mounted to other mountpoints than legacy
and then finally I was able to purge lxd snap and finally uninstall snapd.
So maybe that mountpoint situation is something that prevented lxd-to-incus work correctly.
Also a sidenote, /var/snap was mounted zfs dataset rpool/var/snap (but no child datasets or snapshots exited at the time of migration) if it makes any difference for lxd-to-incus tool…
After I purged snap and lxd I cannot start instance the reason is missing shmounts maybe?
root@winterfell:/var/lib/incus# incus start calibre-web
Error: Daemon failed to setup shared mounts base. Does security.nesting need to be turned on?
root@winterfell:/var/lib/incus# ls -lah shmounts -R
shmounts:
total 34K
drwxr-xr-x 2 root root 2 Jan 4 12:01 .
drwx--x--x 17 root root 21 Jan 4 12:01 ..
root@winterfell:/var/lib/incus#
there was a symlink to /var/snap/lxd/common/lxd instead of shmounts directory so I rm that and created shmounts directory but no idea how to recreate those…
Yeah, that’s a pretty weird one as the images should normally never be mounted by LXD.
They get unpacked after download, then a @readonly snapshot is made and after that, the content of the image should never be accessed and the image therefore never be mounted (just used as a clone source).