lxc export ipa1 ipa1.tar.gz
Error: Create backup: Backup create: Error adding "/var/snap/lxd/common/lxd/storage-pools/system/containers/ipa1/rootfs/var/log/krb5kdc.log" as "backup/container/rootfs/var/log/krb5kdc.log" to tarball: Failed to copy file content "/var/snap/lxd/common/lxd/storage-pools/system/containers/ipa1/rootfs/var/log/krb5kdc.log": archive/tar: write too long
This container’s storage backend is zfs:
zfs list syspool/lxd/containers/ipa1
NAME USED AVAIL REFER MOUNTPOINT
syspool/lxd/containers/ipa1 5.67G 17.2G 5.75G /var/snap/lxd/common/lxd/storage-pools/system/containers/ipa1
I have plenty of space available in /var/snap/lxd:
df -h /var/snap/lxd/
Filesystem Size Used Avail Use% Mounted on
/dev/md127 96G 11G 81G 12% /
We have recently switched to using Go’s internal tar writer rather than the external tar command for creating the export tarballs.
It appears that Go is stricter about detecting a file growing during the write to the tarball whereas the tar command just silently cuts the end of the file off by the looks of it. Not great for a backup.
This has had the end result of failing an export if the tar file would be inconsistent.
Even before this switch, stopping the container before running an export is the best way to get a consistent export file.
However as @stgraber says above we are going to use snapshots where practical to get a consistent export and where not we will emulate tar’s behaviour of silently chopping the end off any files that grow whilst being exported.