Let me try and explain what is happening in more detail here.
I have two servers which both have the same lxd version installed.
Server3 uses btrfs pools
Server2 uses zfs pools
If I try to do a “lxc copy” or a “lxc move” of a container from server3 to server2, I then get the error messages in the first post and the operation fails. Let me fill in the commands here from server3:
It looks like it might be docker related. If I spin up a container on a btrfs pool, I can install docker without problems but doing the same on a zfs pool then docker installation fails. The container I was trying to move in the first post had docker running on it. Will try and research some more.
On the first machine, I created a btrfs pool as default and launched a container in it with docker installed and running a simple docker container.
On the second machine, I created a zfs pool as default
On the first machine, I shutdown the container containing a working docker environment and then I did a “lxc copy” over to the second machine - as expected, the container containing docker stopped working but, I did not see the “rsync_xal_set” errors that I saw in the first post.
So yes, docker cannot be moved from one filesystem type to another, but this was not the cause of the “rsync_xal_set” errors seen in the first post.
Btw, docker does run on both filesystem types as long as “security.nesting” is set to “true” for the container.
I think docker’s overlay system uses whatever is detected underneath during install. If it detects btrfs, is uses it’s btrfs driver for all docker containers.
After extensive testing, it is a docker related issue - mainly to do with docker’s storage drivers.
When installed for the first time, it automatically checks which storage driver to use together with the underlying file system. If your pool is btrfs, it will either use it’s btrfs driver together with subvolumes or the overlay2 driver - both work fine if the host file system is btrfs. If it is zfs, it will use the “vfs” storage driver.
But, if you have already run docker once in the container, then the storage driver will not change after a move. Also rsync cannot copy/move these directories used with either docker’s btrfs driver or the overlay2 driver. If you want to copy/move a lxd container that has docker running with a storage driver other than “vfs”, then you need to do the following first before the lxc copy/move operation:
lxc shell into the container
stop the docker system (snap: snap stop docker)
delete the contents of /var/lib/docker/* (snap: /var/snap/docker/common/var-lib-docker/*)
stop the lxc container
Then the lxc copy/move operation will succeed.
In order to force docker to always use the “vfs” driver, do this:
stop the docker service
make sure /var/lib/docker/* is empty
add the following to the daemon.json config file:
{
“storage-driver”: “vfs”
]
Now docker will always use vfs as the driver no matter which file system is used underneath and you can now copy/move the container without doing any changes to docker beforehand.
BIG NOTE: If you use snapshots, then all the snapshots will also need to be changed unless you use “–instance-only” option during the copy/move operation.