It worked! Thank you! There are a couple of paper cuts in the UX.
- unclear what to type in response to
Source of the storage pool
- I had no storage pools configured on purpose, so I needed to make the dir that lxd wanted to mount my drive to
But it worked.
As an aside, this seems like a pretty normal use case: taking a block device and moving it to a new server. The help text for lxd recover
makes it sound more scary.
My attempts, for your reference.
This LXD server currently has the following storage pools:
Would you like to recover another storage pool? (yes/no) [default=no]: yes
Name of the storage pool: default
Name of the storage backend (lvm, zfs, ceph, btrfs, cephfs, dir): btrfs
Source of the storage pool (block device, volume group, dataset, path, ... as applicable): block device
Additional storage pool configuration property (KEY=VALUE, empty when done):
Would you like to recover another storage pool? (yes/no) [default=no]:
The recovery process will be scanning the following storage pools:
- NEW: "default" (backend="btrfs", source="block device")
Would you like to continue with scanning for lost volumes? (yes/no) [default=yes]:
Scanning for unknown volumes...
Error: Failed validation request: Failed mounting pool "default": Failed to mount "/dev/disk/by-uuid/block device" on "/var/snap/lxd/common/lxd/storage-pools/default" using "btrfs": no such file or directory
second try
1 % lxd recover
This LXD server currently has the following storage pools:
Would you like to recover another storage pool? (yes/no) [default=no]: yes
Name of the storage pool: default
Name of the storage backend (lvm, zfs, ceph, btrfs, cephfs, dir): btrfs
Source of the storage pool (block device, volume group, dataset, path, ... as applicable): /dev/nvme1n1
Additional storage pool configuration property (KEY=VALUE, empty when done):
Would you like to recover another storage pool? (yes/no) [default=no]:
The recovery process will be scanning the following storage pools:
- NEW: "default" (backend="btrfs", source="/dev/nvme1n1")
Would you like to continue with scanning for lost volumes? (yes/no) [default=yes]:
Scanning for unknown volumes...
Error: Failed validation request: Failed mounting pool "default": Failed to mount "/dev/nvme1n1" on "/var/snap/lxd/common/lxd/storage-pools/default" using "btrfs": no such file or directory
after doing sudo mkdir /var/snap/lxd/common/storage-pools/default`
0 % lxd recover
This LXD server currently has the following storage pools:
Would you like to recover another storage pool? (yes/no) [default=no]: yes
Name of the storage pool: default
Name of the storage backend (lvm, zfs, ceph, btrfs, cephfs, dir): btrfs
Source of the storage pool (block device, volume group, dataset, path, ... as applicable): /dev/nvme1n1
Additional storage pool configuration property (KEY=VALUE, empty when done):
Would you like to recover another storage pool? (yes/no) [default=no]:
The recovery process will be scanning the following storage pools:
- NEW: "default" (backend="btrfs", source="/dev/nvme1n1")
Would you like to continue with scanning for lost volumes? (yes/no) [default=yes]:
Scanning for unknown volumes...
The following unknown volumes have been found:
- Container "crons" on pool "default" in project "default" (includes 0 snapshots)
- Container "ubuntu-2004-ci" on pool "default" in project "default" (includes 0 snapshots)
Would you like those to be recovered? (yes/no) [default=no]: yes
Starting recovery...