How do I delete a second storage pool or install a new fresh LXD?

I had tried to setup a second btrfs storage pool but it seems that I did it the wrong way. Now I can’t start lxd nor delete it so I’m stuck. I was searching over forums and web pages and tried some suggestions but no one seems to work.

The host is Ubuntu 20.04 with an LXD snap installation. Here is what I did:

sudo systemctl restart snap.lxd.daemon && sudo lxc list
Error: Get “http://unix.socket/1.0”: EOF

sudo lxd --debug --group lxd
DBUG[09-16|21:00:33] Connecting to a local LXD over a Unix socket
DBUG[09-16|21:00:33] Sending request to LXD method=GET url=http://unix.socket/1.0 etag=
INFO[09-16|21:00:40] LXD is starting version=4.18 mode=normal path=/var/snap/lxd/common/lxd
INFO[09-16|21:00:40] Kernel uid/gid map:
INFO[09-16|21:00:40] - u 0 0 4294967295
INFO[09-16|21:00:40] - g 0 0 4294967295
INFO[09-16|21:00:40] Configured LXD uid/gid map:
INFO[09-16|21:00:40] - u 0 1000000 1000000000
INFO[09-16|21:00:40] - g 0 1000000 1000000000
INFO[09-16|21:00:40] Kernel features:
INFO[09-16|21:00:40] - closing multiple file descriptors efficiently: yes
INFO[09-16|21:00:40] - netnsid-based network retrieval: yes
INFO[09-16|21:00:40] - pidfds: yes
INFO[09-16|21:00:40] - uevent injection: yes
INFO[09-16|21:00:40] - seccomp listener: yes
INFO[09-16|21:00:40] - seccomp listener continue syscalls: yes
INFO[09-16|21:00:40] - seccomp listener add file descriptors: yes
INFO[09-16|21:00:40] - attach to namespaces via pidfds: yes
INFO[09-16|21:00:40] - safe native terminal allocation : yes
INFO[09-16|21:00:40] - unprivileged file capabilities: yes
INFO[09-16|21:00:40] - cgroup layout: hybrid
WARN[09-16|21:00:40] - Couldn’t find the CGroup blkio.weight, disk priority will be ignored
INFO[09-16|21:00:40] - shiftfs support: yes
INFO[09-16|21:00:40] Initializing local database
DBUG[09-16|21:00:40] Refreshing local trusted certificate cache
INFO[09-16|21:00:40] Set client certificate to server certificate fingerprint=9d142f445db5974d5319a61f97d30724c0629936b925b0a930f0cf31ce698146
DBUG[09-16|21:00:40] Initializing database gateway
INFO[09-16|21:00:40] Starting database node id=1 address=1 role=voter
DBUG[09-16|21:00:40] Connecting to a local LXD over a Unix socket
DBUG[09-16|21:00:40] Sending request to LXD method=GET url=http://unix.socket/1.0 etag=
DBUG[09-16|21:00:51] Detected stale unix socket, deleting
INFO[09-16|21:00:51] Starting /dev/lxd handler:
INFO[09-16|21:00:51] - binding devlxd socket socket=/var/snap/lxd/common/lxd/devlxd/sock
INFO[09-16|21:00:51] REST API daemon:
INFO[09-16|21:00:51] - binding Unix socket socket=/var/snap/lxd/common/lxd/unix.socket
INFO[09-16|21:00:51] Initializing global database
DBUG[09-16|21:00:51] Dqlite: attempt 1: server 1: connected
DBUG[09-16|21:00:51] Firewall detected “xtables” incompatibility: Backend command “ebtables” is an nftables shim
INFO[09-16|21:00:51] Firewall loaded driver driver=nftables
INFO[09-16|21:00:51] Initializing storage pools
DBUG[09-16|21:00:51] Initializing and checking storage pool pool=default
DBUG[09-16|21:00:51] Mount started driver=btrfs pool=default
DBUG[09-16|21:00:51] Mount finished driver=btrfs pool=default
DBUG[09-16|21:00:51] Initializing and checking storage pool pool=new_pool
DBUG[09-16|21:00:51] Mount started driver=dir pool=new_pool
DBUG[09-16|21:01:02] Mount finished driver=dir pool=new_pool
EROR[09-16|21:01:02] Failed to start the daemon: Failed initializing storage pool “new_pool”: Failed to mount “/var/lib/snapd/hostfs/media/usuario/datos” on “/var/snap/lxd/common/lxd/storage-pools/new_pool” using “none”: no such file or directory
INFO[09-16|21:01:02] Starting shutdown sequence

sudo snap remove lxd
Save data of snap “lxd” in automatic snapshot set #3
error: cannot perform the following tasks:

  • Save data of snap “lxd” in automatic snapshot set #3 (tar failed: context canceled)
    It stucks so I’ve to stop it with CTRL + C

So how do I delete the second storage pool or install a new fresh LXD? Thank you.

If you’re OK losing your existing pools (and instances), try:

sudo snap remove lxd --purge

Otherwise, does /var/lib/snapd/hostfs/media/usuario/datos exist?
How did you setup your BTRFS pool, as it using a loop file?

Thank you for your help,
Ok. I’d like to mantain my default pool if possible because I’ve a couple of instances that are important to me.

/var/lib/snapd/hostfs/media/usuario/datos doesn’t exist. /var/lib/snapd/hostfs/ is empty

To create a new pool I did:
lxc storage create new_pool dir source=/media/usuario/datos
Storage pool new_pool created

Then I had tried to create a vm but give me this error:
lxc launch ubuntu:20.04 test -s new_pool
Creating test
Error: Failed instance creation: Failed creating instance from image: Unpack failed, Failed to run: unsquashfs -f -d /var/snap/lxd/common/lxd/storage-pools/new_pool/containers/test/rootfs -n /var/snap/lxd/common/lxd/images/66fdf6ebb370435090e7d09735ba88c7cbbf608e6634080a3ce32edfe6805260.rootfs: FATAL ERROR:write_file: failed to create file /var/snap/lxd/common/lxd/storage-pools/new_pool/containers/test/rootfs/usr/lib/systemd/system/system-systemd\x2dcryptsetup.slice, because Invalid argument.