How to remove migration directories that uses up space in disk

Hi, I used to perform lxc copy to a backup server and there are few scenarios where the backup failed. When this happen i notice a lot of migration directory created on my /var/snap/lxd/common/mntns/var/snap/lxd/common/lxd/storage-pools/storpool1/containers. I suspect this is using up some space on my disks. I cannot remove it as it always say its Read-only. Is there anyway to properly cleanup disks used by lxd? Or any command to run to clean up unused space? Thanks in advance.

Sounds like you may be on btrfs?

Did you try removing them with btrfs subvolume delete?

Hi @stgraber , thanks for your response. I am using btrfs with block device as storage pool. I have not explored much on running btrfs commands natively. Was thinking if there is possibility to do it on lxd side of things to clean up unused orphaned directories from failed migration or containers or any of the files that lxd no longer use. Thanks in advance.

LXD normally cleans up on failure, leftovers like yours usually happen when LXD completely crashed or ran out of memory and so couldn’t clean up after itself.

Thanks @stgraber. Do you mind giving me some commands (at least just these migration directories) as I don’t want to remove unecessary files? Appreciate your help.