Cleanup after storage pool is lost


I had two storage pools (zfs and btrs) and by accident lost one (btrfs) of them.
“lxc list” still lists all containers including ones from lost pool.

I can not delete gone containers

# lxc delete f1
Error: no such file or directory

or storage pool and volumes

# lxc storage volume delete btrfs f1
Error: No such object

# lxc storage delete btrfs
Error: storage pool "btrfs" has volumes attached to it

Is there a way to cleanup information/data about lost containers and storage pool and volumes?

Thank you.

Easiest is to temporarily re-create the pool, even if empty, then you can remove everything.

Can you show lxc storage show btrfs?


lxc storage show btrfs


  btrfs.mount_options: compress=zstd
  source: /btrfs/lxd
  volatile.initial_source: /btrfs/lxd
description: ""
name: btrfs
driver: btrfs
- /1.0/containers/alpine-edge
- /1.0/containers/docker1
- /1.0/containers/f1
- /1.0/containers/f2
- /1.0/images/af646b495f250dad72a2b5dd6f604264936b9d932a52878e7686891f285173c6
- /1.0/profiles/btrfs
status: Created
- none

So I just need to create /btrfs/lxd ?

Thank you.

Yep, creating /btrfs/lxd should do the trick

I created /btrfs/lxd directory. And then I was able to delete all containers, images, profiles and storage pool. My problem has been solved :slight_smile: