Recovering containers from crashed HD

Ok, then you don’t actually want to import them as that would require the drive always be present.

Instead you can do:

  • lxc storage create default dir
  • rsync -aHASX --devices --numeric-ids /mnt/@/var/lib/lxd/storage-pools/default/ /var/snap/lxd/common/lxd/storage-pools/default/

Which will create an empty storage pool using the dir backend and then move all data from your old drive over.

Once that’s done, you should be able to run lxd recover and have it just scan that default pool, it should then detect the old instances.