How to move a storage to other places?

Hello,
May you explain a bit further, please.

I am in the same case scenario, trying to recover containers from an existing btrfs partition.
Following the documentation, it should be feasable to reuse an existing btrfs filesystem like this

mount /dev/sdb3 /media/pvincent/pool1/
lxc storage create pool1 btrfs source=/media/pvincent/pool1/

It replies => Error: Requested btrfs subvolume exists but is not empty

When I type

lxc storage create pool1 btrfs source=/dev/sdb3

It replies => Error: Failed to format block device: Failed to run: mkfs.btrfs /dev/sdb3 -L pool1: /dev/sdb3 appears to contain an existing filesystem (btrfs). Use the -f option to force overwrite.

I understand after mounting this existing storage, the command lxd import will help recovering the existing containers. However, I’m stuck on creating a storage onto an existing btrfs partition.
What did I do wrong ?


btw, I tried something else

  • create a brand new btrfs partition
  • copy from the old container rootfs to the new partition, and then
  • lxd import each container separately => SUCCESS !
    but it’s such a long and painful process. reusing an existing partition would be so helpful !