Unable to remove LXD - Read-only file system

Hi,

I am just trying to clear out any unused snaps. When I try to uninstall LXD I am presented with the following error.

➜ ~ sudo snap remove --purge lxd
error: cannot perform the following tasks: - Remove data for snap “lxd” (7412) (unlinkat /var/snap/lxd/common/lxd/storage-pools/default/images/9743fc7ecac0ba3fdc04a037b77a62af3472e58755cf2db1feeadad9809e90c5/metadata.yaml: read-only file system)
➜ ~

When listing the file system I noticed it is squashfs based. How can I got about removing this snap?

Thanks in advance for the help.

I finally managed to fix this issue and remove LXD.

The issue was caused by using Brtfs, this automatically created a subvolume for the lxd snap and various other places. Brtfs doesn’t let you delete a subvolume, to remove it and snap completely, I had to boot into a LiveCD and mount the internal HDD, remove the subvolume and then reboot.

Thanks to those on IRC that helped.

1 Like

I was able to delete the btrfs subvolumes without booting from a live image.

sudo btrfs subvolume list /
sudo btrfs subvolume delete /var/snap/lxd/common/lxd/storage-pools/default/images/a8402324842148ccfc...
sudo btrfs subvolume delete /var/snap/lxd/common/lxd/storage-pools/default
sudo snap remove lxd # worked!