Lxc copy seems to not understand hardlinks with dir driver


I have a container on one host node using the dir driver, inside this container rsnapshot is being used to create backups.

I am now migrating this container to another host node, same settings.

However, I’ve verified in the new rootfs that the incremental backup gets copied over and over again (no hardlinks are copied).

Is this the expected behavior?

How about other system files, can the CT become corrupted if a hard link is expected but instead a plain old file copy is written?

Thank you

I’m sorry but given the recent actions from Canonical regarding LXD:

We really can’t be providing support to LXD users on this forum anymore.

You may want to consider switching to Incus instead, or if you’d like to stay on LXD, you should reach out on the Canonical forum instead.

Sorry about that!


thank you for your response. I managed to ask on Canonical forums and use lxc export and lxc import instead of lxc copy to preserve hardlinks.

I’ve also checked Incus and it seems very interesting, I in particular like the lxd-to-incus tool. Going to try it in a VM, and maybe also check if the incus copy behavior (not preserving hardlinks) is consistent with lxd.


Yeah, I’d expect incus copy to have the same issue.

The behavior will vary based on your storage pools. I suspect the issue will hit when rsync is used, which happens when the storage pool driver isn’t the same on the source and destination or when either is using the dir storage backend.

rsync does have an option to preserve hard-links so we’d have to check why we’re not passing it or if we’re passing why it’s not working. It could also be that we weren’t able to pass it due to either security concerns or performance issues, but we’d need to look into it.

So reproducing this on Incus and then filing an issue would be appreciated.