LXD: Cannot find and remove snapshot to remove storage pool?

@tomp incoming as PM because i can’t have all my data in the open :stuck_out_tongue:

Thanks

So I’m not sure what has happened here, but you have a ‘normal’ volume in the database that is clearly a snapshot.

INSERT INTO "storage_volumes" VALUES(282,'local-dns/snap0',1,1,0,'',1);

You can delete that row though using:

lxd sql global 'delete from storage_volumes where name = "local-dns/snap0"'

HEY that worked!

That cleaned it out and then I was able to delete the ‘default’ storage volume.

Thanks all for the assist! This was a pain to figure out, heh.

Hey, I know this talk is quite old but I have a similar issue :
Here is a brief recap of it :

  • I tried to load a backup of a container that weighted about 30 Gigs with about 70 gigs remaining in my HD
  • this fully saturated my drive for some reason, I found that the 30 gig folder was placed more than once in the /var/snap directory
  • In the end, some of it went away without the container being usable (but the fact there was now room on the HD meant the computer would be usable which is great)
  • but the default storage pool at /var/snap/lxd/common/lxd/storage-pools/default/ is now unlisted with lxc. the problem is : I want to remove LXC but I can’t. And this default pool weighs more than 50 Gigs which I’d like to reclaim.

Things I’ve tried :

  • uninstall lxd with snap → it only disables even with --purge
  • sudo rm of the directory → impossible : rm: cannot remove '...': Read-only file system
  • rerun lxd init to force it to use default as a storage pool → error : cannot access
  • tried the @tomp hack by running lxd sql global "INSERT INTO 'storage_pools' VALUES(2,'default','btrfs','',0);" → does not work either (see output below)
    outputs :
lxc storage delete default
Error: Failed removing mount path "/var/snap/lxd/common/lxd/storage-pools/default": Failed removing "/var/snap/lxd/common/lxd/storage-pools/default/backup.3262666047": unlinkat /var/snap/lxd/common/lxd/storage-pools/default/backup.3262666047/kali1/metadata.yaml: read-only file system
# lxc storage list
+---------+--------+---------------------------------------------+-------------+---------+---------+
|  NAME   | DRIVER |                   SOURCE                    | DESCRIPTION | USED BY |  STATE  |
+---------+--------+---------------------------------------------+-------------+---------+---------+
| default | btrfs  |                                             |             | 0       | UNKNOWN |
+---------+--------+---------------------------------------------+-------------+---------+---------+
| test    | btrfs  | /var/snap/lxd/common/lxd/storage-pools/test |             | 2       | CREATED |
+---------+--------+---------------------------------------------+-------------+---------+---------+

If anyone has an idea, I am much interested :grin:

Hi!

You mention that you are using the snap package, while Incus is not available as a snap package.

In this support forum, we provide support for Incus (a fork by the maintainers of LXD). See how to migrate to Incus.