How to reuse dedicated disk/partition

I installed lxd with the storage pool as dedicated partition btrfs.

All my containers are in there

but the images are in /var/snap …

Now I want to reinstall OS and then reinstall LXD using previous storage pool without having to empty that partition (still keep the containers and images). HOW TO?

Make a tarball of /var/snap/lxd/common/lxd and restore it on the reinstalled system.
You need that to keep the LXD database anyway.

1 Like

Thanks for reply,

But after restored on the reinstalled system, I still can’t see the containers and images with “lxc ls”. I also cannot create the default storage pool with dedicated partition /mnt/btrfs

Can you show output of lxc storage ls and output of sudo ls -la /var/snap/lxd/common/lxd/storage-pools

1 Like

Thanks for your reply. I have solved the problem already. The reason is I haven’t stopped the lxd service before restoring