Hi!
Seems that I had some kernel shenanigans happening with btrfs and created inconsistencies with what LXD is seeing on the database and what is happening on disk.
The issue happened with kernel 5.19.0-43-generic
and LXD 5.14-7072c7b
I am trying to delete a btrfs volume and I am getting the following error:
Error: Failed setting subvolume writable "/var/snap/lxd/common/lxd/storage-pools/docker/custom/default_docker": Failed to run: btrfs property set -f -ts /var/snap/lxd/common/lxd/storage-pools/docker/custom/default_docker ro false: exit status 1 (ERROR: Could not get subvolume flags: Invalid argument)
There is nothing inside /var/snap/lxd/common/lxd/storage-pools/docker/
:
$ sudo ls -al /var/snap/lxd/common/lxd/storage-pools/docker/ 2 ↵
total 18
drwx--x--x 2 root root 2 jun 20 08:40 .
drwx--x--x 4 root root 4 jun 20 08:40 ..
But the volume/storage volume does exist in the database:
$ lxc storage volume list docker
+--------+--------+-------------+--------------+---------+
| TYPE | NAME | DESCRIPTION | CONTENT-TYPE | USED BY |
+--------+--------+-------------+--------------+---------+
| custom | docker | | filesystem | 0 |
+--------+--------+-------------+--------------+---------+
$ lxc storage volume show docker docker 1 ↵
config:
volatile.idmap.last: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
description: ""
name: docker
type: custom
used_by: []
location: none
content_type: filesystem
project: default
created_at: 0001-01-01T00:00:00Z
$ lxc storage show docker
config:
size: 30GiB
source: /var/snap/lxd/common/lxd/disks/docker.img
description: ""
name: docker
driver: btrfs
used_by:
- /1.0/storage-pools/docker/volumes/custom/docker
status: Created
locations:
- none
And the above does exist:
$ sudo ls -al /var/snap/lxd/common/lxd/disks/docker.img 2 ↵
-rw------- 1 root root 32212254720 jun 20 09:59 /var/snap/lxd/common/lxd/disks/docker.img
Should I get on with doing database surgery, or any other suggestion?
Thanks in advance.