After doing a copy of a remote container to local: lxc copy hostname:container-name/snapshot local:container-name and i do lxc list i do see that the container was created.
And now I’m trying to delete the container but this is the output error:
Error: Error deleting storage volume: Failed setting subvolume writable “/var/snap/lxd/common/lxd/storage-pools/Pool-1/containers/container-name”: Failed to run: btrfs property set -ts /var/snap/lxd/common/lxd/storage-pools/Pool-1/containers/container-name ro false: ERROR: failed to get flags for /var/snap/lxd/common/lxd/storage-pools/Pool-1/containers/container-name: Invalid argument.
I also do ls -lh /var/snap/lxd/common/lxd/containers/ all my other containers (copy-containers) are there but not the container that i’m trying to delete.
To mentioned that this happened when i interrupted the copying process from the remote host since the btrfs processes were demanding 100% io and causing some issues. And it indeed created something that i can see when i list the containers.
When i try to run again: lxc copy hostname:container-name/snapshot local:container-name the output says:
Error: Failed instance creation: Add instance info to the database: This instance already exists
Does /var/snap/lxd/common/lxd/storage-pools/Pool-1/containers/container-name exist?
If not, does /var/snap/lxd/common/mntns/var/snap/lxd/common/lxd/storage-pools/Pool-1/containers/container-name exist?
If either exist, try to delete it and then try lxc delete -f ContainerName again.
I also encounted Error: Error deleting storage volume: Failed deleting subvolume. lxc delete container failed. The force flag failed too. Deletion succeeded after I removed /var/snap/lxd/common/lxd/storage-pools/my-pool as the superuser.
I suspect allocating the minimum pool size of 1GB is related. I have not confirmed this directly.
I am getting the same issue on one of the containers and on trying to delete the /var/snap/lxd/common/mntns/var/snap/lxd/common/lxd/storage-pools/Pool-1/containers/container-name using rm -rf command as a superuser, it gives the following error:
Read-only file system
Is there anything that I am missing here? I am unable to delete the container or its contents.
Its likely that /var/snap/lxd/common/mntns/var/snap/lxd/common/lxd/storage-pools/Pool-1/containers/container-name or a directory above it is marked as a BTRFS readonly subvolume.
Try doing:
sudi btrfs property set -ts /var/snap/lxd/common/mntns/var/snap/lxd/common/lxd/storage-pools/Pool-1/containers/container-name ro false