How to recover containers from an imported zfs pool?

Hi
I’m trying to recover a number of containers from a zfs pool I’ve imported into a new 22.04 installation. I’ve read a few threads here but there is quite a bit of variance and none exactly match my case. Moreover, I can’t seem to apply any of the techniques mentioned here with any success. Even though many of my error messages are the same as reported in other postings. When using lxd recover I really don’t know what I am supposed to enter at some of the prompts and so am really guessing at what it is asking for. Not disimilar to other postings I’ve read. Consequently I would be grateful for any help or advise including pointers to useful doc’s. I’m finding it hard to find anything but titbits on this subject. And unfortunately these span several different versions of LXD, LXC, SNAP and Ubuntu generally.

History:
I installed Ubuntu 20.04 onto a usb stick and used it to boot an old server. I had two hard drives in the machine which I used to create a zfs mirrored pool. I created a number of containers on that pool for learning and testing purposes. Then my USB stick developed an error and I did not have a recent backup.

Recovery attempts.
I created a new 20.04 usb stick and booted the machine. I imported the zpool without any issues but couldn’t get lxd to import or recover my containers.
I read a number of posts and the subject of bugs and patches came up on situations similar to mine. Consequently I thought I might as well upgrade to 22.04 and fix the problem there.

I created a new 22.04 USB stick and tried again. But the same thing happened. I imported my zpool without any issues but experienced the same issues I read about when it came to importing/recovering containers eg;
LXD init not loading my pool as it had data on it.
LXD recover not finding my pool at all.
LXD recover giving me various errors when I try to ‘directed’ it to my pool.
I’ve tried mounting some of my containers in various places but get similar errors reported by others.

I am not supprised it’s not working as I very much feel like I am hacking away blindly in the dark. In the absense of substantive documentation It’s very much a case of ‘monkey read, monkey type’, with the addition of some ill informed guess work. If there are any “comprehensive” docs on the subject of lxd recovery I’d very much appreciate a link.

Technical Details:-

Versions:

cat /etc/lsb-release
-------------------- 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"


root@dmz-001:~# zfs --version
-------------------------------
zfs-2.1.4-0ubuntu0.1
zfs-kmod-2.1.4-0ubuntu0.1


root@dmz-001:~# lxd --version
-----------------------------
5.0.2

root@dmz-001:~# snap --version
--------------------------------------------------
snap    2.58+22.04
snapd   2.58+22.04
series  16
ubuntu  22.04
kernel  5.15.0-58-generic

Zpool Details

-------------------------
root@dmz-001:~# zpool list
-------------------------------------------------------------------------------------------------------
NAME           SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
dmz-pool-001   464G  37.0G   427G    39.6M         -     4%     7%  1.00x    ONLINE  -


------------------------------
root@dmz-001:~# zpool status
-------------------------------------------------------------------------------------------------------
  pool: dmz-pool-001
 state: ONLINE
status: Some supported and requested features are not enabled on the pool.
	The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
	the pool may no longer be accessible by software that does not support
	the features. See zpool-features(7) for details.
  scan: scrub repaired 0B in 00:11:16 with 0 errors on Sun Jan  8 04:18:51 2023
checkpoint: created Thu Feb  2 18:02:28 2023, consumes 39.6M
config:

	NAME                                            STATE     READ WRITE CKSUM
	dmz-pool-001                                    ONLINE       0     0     0
	  mirror-0                                      ONLINE       0     0     0
	    ata-Hitachi_HDS721050CLA362_JP1570HR1KEGRK  ONLINE       0     0     0
	    ata-Hitachi_HDS721050CLA362_JP1570HR1MJM4K  ONLINE       0     0     0

errors: No known data errors

ZFS Data Sets

--------------------------
root@dmz-001:~# zfs list
-------------------------------------------------------------------------------------------------------
NAME                                                                                                       USED  AVAIL     REFER  MOUNTPOINT
dmz-pool-001                                                                                              70.9G   379G       57K  /dmz-pool-001
dmz-pool-001/lxd-backups                                                                                  2.44G   379G     2.44G  /dmz-pool-001/lxd-backups
dmz-pool-001/lxd-default                                                                                  19.5G   379G       25K  /dmz-pool-001/lxd-default
dmz-pool-001/lxd-default/containers                                                                       9.85G   379G       24K  /dmz-pool-001/lxd-default/containers
dmz-pool-001/lxd-default/containers/Drupal-1		                                                  95.3M   379G      370M  none
dmz-pool-001/lxd-default/containers/FDNS                                                                   422M   379G      406M  none

dmz-pool-001/lxd-default/containers/NTP                                                                    171M   379G      286M  
 /var/snap/lxd/common/lxd/storage-pools/default/containers/A-NTP

dmz-pool-001/lxd-default/containers/RDNS                                                                 182M   379G      276M  none
dmz-pool-001/lxd-default/containers/ADNS                                                       		 247M   379G      448M  none
dmz-pool-001/lxd-default/containers/Drupal-2                                                     	 142M   379G      325M  none
dmz-pool-001/lxd-default/containers/Drupal-3                                                        	 265M   379G     2.44G  /mnt/Drupal-3
dmz-pool-001/lxd-default/containers/PGA                                                        		 487M   379G      802M  none
dmz-pool-001/lxd-default/containers/ISDB                                                       		 189M   379G      404M  /mnt/ISDB
dmz-pool-001/lxd-default/containers/Rsyslog                                                             2.59M   379G      262M  none
dmz-pool-001/lxd-default/containers/Postgres                                                            1.91G   379G     1.24G  none
dmz-pool-001/lxd-default/containers/Mail                                                       		 621M   379G      566M  none
dmz-pool-001/lxd-default/deleted                                                                        4.80G   379G       24K  none
dmz-pool-001/lxd-default/deleted/containers                                                             3.90G   379G       24K  none
dmz-pool-001/lxd-default/deleted/containers/8114a5d7-bcaf-4098-92ee-1761bba6b5ba                         393M   379G      263M  none
dmz-pool-001/lxd-default/deleted/containers/bf29f6fa-def8-4961-995c-7e45f587c253                        42.4M   379G      203M  none
dmz-pool-001/lxd-default/deleted/custom                                                                   24K   379G       24K  none
dmz-pool-001/lxd-default/deleted/images                                                                  927M   379G       24K  none
dmz-pool-001/lxd-default/deleted/virtual-machines                                                         24K   379G       24K  none

dmz-pool-001/lxd-default/deleted/containers/fa49f8ca-d01e-4e8d-b036-b6f1d152fda3                        3.47G   379G     4.00G  
 /var/snap/lxd/common/lxd/storage-pools/default/containers/ubuntu-testing

dmz-pool-001/lxd-default/deleted/images/144df099adfdd60d49939ef1cddbeb8029a09729ef5521224fc91b7f19625ef5   457M   379G      457M  
 /var/snap/lxd/common/lxd/storage-pools/default/images/144df099adfdd60d49939ef1cddbeb8029a09729ef5521224fc91b7f19625ef5

dmz-pool-001/lxd-default/deleted/images/475d2b7886dcd2b252e26c5f30674bb7212780da2a2d273ff285f4fff0c0ff41   163M   379G      163M  none

dmz-pool-001/lxd-default/deleted/images/c53a85d3e035eb0bc6f3e54c92fedcbe823b112026631d0c11df9211e43d3215   307M   379G      307M  
 /var/snap/lxd/common/lxd/storage-pools/default/images/c53a85d3e035eb0bc6f3e54c92fedcbe823b112026631d0c11df9211e43d3215

dmz-pool-001/lxd-default/images                                                                           4.88G   379G       24K  /dmz-pool-001/lxd-default/images

dmz-pool-001/lxd-default/images/4efbe3f8531565b1885086e70338cba8345fa8869fef8c5ea2eaea281fb2e331          2.44G   379G     2.44G  
 /var/snap/lxd/common/lxd/storage-pools/default/images/4efbe3f8531565b1885086e70338cba8345fa8869fef8c5ea2eaea281fb2e331

dmz-pool-001/lxd-default/images/9ddb41abb98d326a915ff6a061888f863c18a7817070189dbd997bb8f5644c54          2.44G   379G     2.44G  
 /var/snap/lxd/common/lxd/storage-pools/default/images/9ddb41abb98d326a915ff6a061888f863c18a7817070189dbd997bb8f5644c54

dmz-pool-001/lxd-default/virtual-machines                                                          24K   379G       24K  /dmz-pool-001/lxd-default/virtual-machines
dmz-pool-001/lxd-live-images                                                                       24K   379G       24K  /dmz-pool-001/lxd-live-images
dmz-pool-001/lxd-template-images                                                                   24K   379G       24K  /dmz-pool-001/lxd-template-images
dmz-pool-001/lxd-testarea                                                                        6.43G   379G     6.43G  /dmz-pool-001/lxd-testarea
dmz-pool-001/swap                                                                                34.0G   413G       12K  -
dmz-pool-001/usb-stick                                                                           8.49G   379G     8.49G  /dmz-pool-001/usb-stick-data

ZFS Mounted Datasets:

--------------------------------------
root@dmz-001:~# zfs mount
-------------------------------------------------------------------------------------------------------------
dmz-pool-001                    		/dmz-pool-001
dmz-pool-001/lxd-live-images    		/dmz-pool-001/lxd-live-images
dmz-pool-001/lxd-testarea       		/dmz-pool-001/lxd-testarea
dmz-pool-001/lxd-backups        		/dmz-pool-001/lxd-backups
dmz-pool-001/lxd-default        		/dmz-pool-001/lxd-default
dmz-pool-001/lxd-template-images  		/dmz-pool-001/lxd-template-images
dmz-pool-001/usb-stick-data     		/dmz-pool-001/usb-stick-data
dmz-pool-001/lxd-default/images  		/dmz-pool-001/lxd-default/images
dmz-pool-001/lxd-default/containers  		/dmz-pool-001/lxd-default/containers
dmz-pool-001/lxd-default/virtual-machines  	/dmz-pool-001/lxd-default/virtual-machines
dmz-pool-001/lxd-default/containers/ISDB  	/mnt/ISDB

Check for actual data at mount points:

--------------------------------------
root@dmz-001:~# ls /mnt/ISDB/
-------------------------------------------------------------------------------------------------------------

backup.yaml  metadata.yaml  rootfs  templates

Attempt at Importing from a mount point:

-------------------------------------------------------------------------------------------------------------
root@dmz-001:~# lxc import /mnt/ISDB/ 

Error: Post "http://unix.socket/1.0/instances": read /var/lib/snapd/hostfs/mnt/ISDB: is a directory

Attempt at Recovering the pool:

-------------------------------------------------------------------------------------------------------
root@dmz-001:~# 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: dmz-pool-001
Name of the storage backend (dir, lvm, zfs, btrfs, ceph, cephfs, cephobject): zfs
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: "dmz-pool-001" (backend="zfs", 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 "dmz-pool-001": Cannot mount pool as "zfs.pool_name" is not specified

Please note:
I have not yet upgraded ZFS as I don’t know how robust this process is or whether I will need to down grade Ubuntu or one of LXD’s components.

Any help Gratefully received.

Thanks in advance.

Hi @charlie101,
Just a humble guess, enter zfs.pool_name=dmz-pool-001 to the
Additional storage pool configuration property (KEY=VALUE, empty when done):
option.
Regards.

Hi Cemzafer
Thank you for your reply and suggestion.
Although I only gave one example of ‘lxc restore’ and one example of ‘lxd recover’ I did in fact try lots before I posted. I only posted when I was tired of banging my head against this particular wall. Hence I couldn’t realistically post the entire actual history.

I did try this particular recovery and it was one of the recoveries which appear to find nothing:-

root@dmz-001:~# 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: dmz-pool-001
Name of the storage backend (dir, lvm, zfs, btrfs, ceph, cephfs, cephobject): zfs
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): zfs.pool_name=dmz-pool-001
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: "dmz-pool-001" (backend="zfs", source="block device")
Would you like to continue with scanning for lost volumes? (yes/no) [default=yes]: 
Scanning for unknown volumes...
No unknown volumes found. Nothing to do.

Here is the same recovery but specifying ‘dataset’ rather than ‘block device’:-

root@dmz-001:~# 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: dmz-pool-001
Name of the storage backend (dir, lvm, zfs, btrfs, ceph, cephfs, cephobject): zfs
Source of the storage pool (block device, volume group, dataset, path, ... as applicable): dataset
Additional storage pool configuration property (KEY=VALUE, empty when done): zfs.pool_name=dmz-pool-001
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: "dmz-pool-001" (backend="zfs", source="dataset")
Would you like to continue with scanning for lost volumes? (yes/no) [default=yes]: 
Scanning for unknown volumes...
No unknown volumes found. Nothing to do.

Thanks again!

OK. Making some progress:
I was looking for something in the backup.yaml file of one of the container when I noticed a section labeled: ‘pool’. It has the following parameters:-

pool:
  config:
    source: dmz-pool-001/lxd-default
    volatile.initial_source: dmz-pool-001/lxd-default
    zfs.pool_name: dmz-pool-001/lxd-default
    name: default

I noted that one of them is: ‘zfs.pool_name’. which is exactly the parameter which came out of the earlier error message. So now we have the exact value for this. At least for one container.

I plugged it into the recovery command and got slightly different errors depending on the exact value used for the zfs pool name and the zfs.pool_name. Here is an example:-

root@dmz-001:~/WorkArea/zfs# 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: dmz-pool-001/lxd-default
Name of the storage backend (dir, lvm, zfs, btrfs, ceph, cephfs, cephobject): zfs
Source of the storage pool (block device, volume group, dataset, path, ... as applicable): dataset
Additional storage pool configuration property (KEY=VALUE, empty when done): zfs.pool_name=dmz-pool-001/lxd-default
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: "dmz-pool-001/lxd-default" (backend="zfs", source="dataset")
Would you like to continue with scanning for lost volumes? (yes/no) [default=yes]: 
Scanning for unknown volumes...
Error: Failed validation request: Failed checking volumes on pool "dmz-pool-001/lxd-default": Instance "I-Rsyslog" in project "default" has pool name mismatch in its backup file ("default" doesn't match's pool's "dmz-pool-001/lxd-default")

It failed but at least now it’s finding my containers!

So now I’m trying to work out what the relationship is between all of these parameter in the container yaml file, the lxd recover command and zfs? Also how many of them I have to enter into the lxd recover command?

From the error messages it also looks like the differing contents of the yaml files in different containers might also be causing issues.

Just to add a little spice it looks as if when lxd uses the term zfs pool it’s actaully refering to a zfs dataset. Worse still, I think it might be using ‘pool’ to refer to both zfs zpools and zfs datasets without specifying which.

Hi,
it seems that you are on the right track, so just a guess. What about if you enter default to Name of the storage pool: section and the rest is same.
Regards.

Hi Cemzafer
I’m interpreting your suggestion as denoting the first parameter:-

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 (dir, lvm, zfs, btrfs, ceph, cephfs, cephobject): zfs
Source of the storage pool (block device, volume group, dataset, path, ... as applicable): dataset
Additional storage pool configuration property (KEY=VALUE, empty when done): zfs.pool_name=dmz-pool-001
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="zfs", source="dataset")
Would you like to continue with scanning for lost volumes? (yes/no) [default=yes]: 
Scanning for unknown volumes...
No unknown volumes found. Nothing to do.

So it gives another ‘not found’ result. But I also swapped the parameter around and used the ‘default’ value in the ‘additional storage pool propeterties’ section and it gave an interesting result:-

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: dmz-pool-001
Name of the storage backend (dir, lvm, zfs, btrfs, ceph, cephfs, cephobject): zfs
Source of the storage pool (block device, volume group, dataset, path, ... as applicable): dataset
Additional storage pool configuration property (KEY=VALUE, empty when done): zfs.pool_name=default
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: "dmz-pool-001" (backend="zfs", source="dataset")
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 "dmz-pool-001": Failed to run: zpool import default: exit status 1 (cannot import 'default': no such pool available)

The error contains ‘zpool import default’ which is obviously a call to the zfs zpool program to import a zpool from the O/S called default.
So now we know exactly what the components of ‘zfs.pool_name’ denote and how they are used by the recover command. I’m going to drop this parameter going forward as I’ve already imported the zpool.

Thanks for your suggestion.

Hi @charlie101, by the way you can examine that link may help you.
Regards.
https://discuss.linuxcontainers.org/t/getting-lxd-recover-to-work/12143/4

Thank you. I’ll take a look now.

BTW I couldn’t omit the nfs.pool_name parameter. It complains if it’s missing. I’m tempted to grab the code and see if I can find a case statement parsing these parameters and see if I can make any sense out of that. Not my first thought but we seem to be trying to reverse enginer the parsing code via the error codes.

Also I tried putting in various dataset paths as the name of the pool and it just comes back with ‘nothing found …’ even when the path points to a containers directory which is a ‘sub-directory’ of the ‘lxd-default’ path. So it seems to recognize/test for a lxd related storage pool path. Not just any path with a container in it. I Don’t know how its doing this; zfs data, the backup yaml file or default lxd paths???

I’m beginning to think we might have had it correct earlier when it found the container but through an error. I’m thinking the error may be related to a problem with one/some of my containers.
I guess if I try an infinite number of permutations I’ll get there in the end.

Thanks for your help.

Try this:

Also please show output of sudo zfs list

Hi tomp
Thanks for replying to my post.
Sorry for the delay in getting back to you but I was called away on urgent business and only just got back.

Here is the result of your suggestion:

root@dmz-001:~# 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 (cephfs, cephobject, dir, lvm, zfs, btrfs, ceph): zfs
Source of the storage pool (block device, volume group, dataset, path, ... as applicable): dataset
Additional storage pool configuration property (KEY=VALUE, empty when done): zfs.pool_name=dmz-pool-001/lxd-default
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="zfs", source="dataset")
Would you like to continue with scanning for lost volumes? (yes/no) [default=yes]: 
Scanning for unknown volumes...
Error: Failed validation request: Failed checking volumes on pool "default": Failed to mount "dmz-pool-001/lxd-default/containers/A-NTP@snapshot-deleted" on "/var/snap/lxd/common/lxd/storage-pools/default/containers-snapshots/A-NTP/deleted" using "zfs": no such file or directory

Since the my last reply to cemzafer I’ve tried a few different values for the recovery and I get a lot of failures where it trips over a ‘snapshot’ dataset or a dataset for a deleted container.

I was thinking the parsring might be having trouble with the ‘complexity’ of my datasets, as they contain a number of snapshot and deleted containers??

Thank again.

Hi tomp

As requested:

root@dmz-001:~# zfs list
NAME                                                                                                       USED  AVAIL     REFER  MOUNTPOINT
dmz-pool-001                                                                                              76.1G   373G     66.5K  /dmz-pool-001
dmz-pool-001/buckets                                                                                        24K   373G       24K  legacy
dmz-pool-001/containers                                                                                     24K   373G       24K  legacy
dmz-pool-001/custom                                                                                         24K   373G       24K  legacy
dmz-pool-001/deleted                                                                                       144K   373G       24K  legacy
dmz-pool-001/deleted/buckets                                                                                24K   373G       24K  legacy
dmz-pool-001/deleted/containers                                                                             24K   373G       24K  legacy
dmz-pool-001/deleted/custom                                                                                 24K   373G       24K  legacy
dmz-pool-001/deleted/images                                                                                 24K   373G       24K  legacy
dmz-pool-001/deleted/virtual-machines                                                                       24K   373G       24K  legacy
dmz-pool-001/images                                                                                         24K   373G       24K  legacy
dmz-pool-001/lxd-502                                                                                        48K   373G       24K  /dmz-pool-001/lxd-502
dmz-pool-001/lxd-502/default                                                                                24K   373G       24K  /dmz-pool-001/lxd-502/default
dmz-pool-001/lxd-backups                                                                                  7.82G   373G     7.82G  /dmz-pool-001/lxd-backups
dmz-pool-001/lxd-default                                                                                  19.4G   373G       25K  legacy
dmz-pool-001/lxd-default/buckets                                                                            24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers                                                                       9.69G   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-72ee-b687-CHORGUK                                                   95.3M   373G      370M  none
dmz-pool-001/lxd-default/containers/A-FDNS                                                                 422M   373G      406M  /mnt/FDNS
dmz-pool-001/lxd-default/containers/A-NTP                                                                  171M   373G      286M  legacy
dmz-pool-001/lxd-default/containers/A-NTP/buckets                                                           24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-NTP/containers                                                        24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-NTP/custom                                                            24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-NTP/deleted                                                          144K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-NTP/deleted/buckets                                                   24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-NTP/deleted/containers                                                24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-NTP/deleted/custom                                                    24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-NTP/deleted/images                                                    24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-NTP/deleted/virtual-machines                                          24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-NTP/images                                                            24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-NTP/virtual-machines                                                  24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/A-RDNS                                                                 182M   373G      276M  /mnt/RDNS
dmz-pool-001/lxd-default/containers/A-d8d8-0f83-ADNS                                                       247M   373G      448M  /mnt/ADNS
dmz-pool-001/lxd-default/containers/A-fa4f-ae3a-CHCOUK                                                     142M   373G      325M  legacy
dmz-pool-001/lxd-default/containers/C-8317-83ee-HLA                                                        265M   373G     2.44G  /mnt/HLA
dmz-pool-001/lxd-default/containers/D-f6de-055c-PGA                                                        487M   373G      802M  none
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB                                                       189M   373G      404M  /mnt/ISDB
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB/buckets                                                24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB/containers                                             24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB/custom                                                 24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB/deleted                                               144K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB/deleted/buckets                                        24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB/deleted/containers                                     24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB/deleted/custom                                         24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB/deleted/images                                         24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB/deleted/virtual-machines                               24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB/images                                                 24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-38ae-0154-ISDB/virtual-machines                                       24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog                                                             2.85M   373G      262M  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog/buckets                                                       24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog/containers                                                    24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog/custom                                                        24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog/deleted                                                      144K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog/deleted/buckets                                               24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog/deleted/containers                                            24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog/deleted/custom                                                24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog/deleted/images                                                24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog/deleted/virtual-machines                                      24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog/images                                                        24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-Rsyslog/virtual-machines                                              24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/I-baa8-120f-CHDB                                                      1.91G   373G     1.24G  /mnt/CHDB
dmz-pool-001/lxd-default/containers/S-3730-2b6d-Mail                                                       621M   373G      566M  /mnt/Postfix_Mail
dmz-pool-001/lxd-default/containers/buckets                                                                 24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/containers                                                              24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/custom                                                                  24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/debian-level-1-v1                                                      506K   373G      457M  /mnt/tmp
dmz-pool-001/lxd-default/containers/debian-level-1-v2                                                      174M   373G      370M  none
dmz-pool-001/lxd-default/containers/debian-testing                                                         203M   373G      433M  none
dmz-pool-001/lxd-default/containers/deleted                                                                144K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/deleted/buckets                                                         24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/deleted/containers                                                      24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/deleted/custom                                                          24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/deleted/images                                                          24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/deleted/virtual-machines                                                24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/images                                                                  24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/new-S-3730-2b6d-Mail                                                  1001K   373G      262M  none
dmz-pool-001/lxd-default/containers/template-Debian11                                                      136M   373G      262M  /mnt/template_Debian11
dmz-pool-001/lxd-default/containers/ubuntu-level-1-test                                                    234M   373G      530M  none
dmz-pool-001/lxd-default/containers/ubuntu-level-1-v1                                                     3.98G   373G     4.27G  none
dmz-pool-001/lxd-default/containers/ubuntu-plain                                                           301M   373G      730M  legacy
dmz-pool-001/lxd-default/containers/virtual-machines                                                        24K   373G       24K  legacy
dmz-pool-001/lxd-default/containers/x-hla-Nov-21-V1                                                       22.8M   373G     2.44G  none
dmz-pool-001/lxd-default/custom                                                                             24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted                                                                          4.81G   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/buckets                                                                    24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers                                                               3.90G   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers/8114a5d7-bcaf-4098-92ee-1761bba6b5ba                           393M   373G      263M  none
dmz-pool-001/lxd-default/deleted/containers/bf29f6fa-def8-4961-995c-7e45f587c253                          42.4M   373G      203M  none
dmz-pool-001/lxd-default/deleted/containers/buckets                                                         24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers/containers                                                      24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers/custom                                                          24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers/deleted                                                        144K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers/deleted/buckets                                                 24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers/deleted/containers                                              24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers/deleted/custom                                                  24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers/deleted/images                                                  24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers/deleted/virtual-machines                                        24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers/fa49f8ca-d01e-4e8d-b036-b6f1d152fda3                          3.47G   373G     4.00G  none
dmz-pool-001/lxd-default/deleted/containers/images                                                          24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/containers/virtual-machines                                                24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/custom                                                                     24K   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/images                                                                    927M   373G       24K  legacy
dmz-pool-001/lxd-default/deleted/images/144df099adfdd60d49939ef1cddbeb8029a09729ef5521224fc91b7f19625ef5   457M   373G      457M  none
dmz-pool-001/lxd-default/deleted/images/475d2b7886dcd2b252e26c5f30674bb7212780da2a2d273ff285f4fff0c0ff41   163M   373G      163M  none
dmz-pool-001/lxd-default/deleted/images/c53a85d3e035eb0bc6f3e54c92fedcbe823b112026631d0c11df9211e43d3215   307M   373G      307M  none
dmz-pool-001/lxd-default/deleted/virtual-machines                                                           24K   373G       24K  legacy
dmz-pool-001/lxd-default/images                                                                           4.88G   373G       24K  legacy
dmz-pool-001/lxd-default/images/4efbe3f8531565b1885086e70338cba8345fa8869fef8c5ea2eaea281fb2e331          2.44G   373G     2.44G  none
dmz-pool-001/lxd-default/images/9ddb41abb98d326a915ff6a061888f863c18a7817070189dbd997bb8f5644c54          2.44G   373G     2.44G  none
dmz-pool-001/lxd-default/virtual-machines                                                                   24K   373G       24K  legacy
dmz-pool-001/lxd-live-images                                                                                24K   373G       24K  /dmz-pool-001/lxd-live-images
dmz-pool-001/lxd-template-images                                                                            24K   373G       24K  /dmz-pool-001/lxd-template-images
dmz-pool-001/lxd-testarea                                                                                 6.43G   373G     6.43G  /dmz-pool-001/lxd-testarea
dmz-pool-001/swap                                                                                         34.0G   407G       12K  -
dmz-pool-001/usb-stick-data                                                                               8.49G   373G     8.49G  /dmz-pool-001/usb-stick-data
dmz-pool-001/virtual-machines                                                                               24K   373G       24K  legacy

Thanks for taking the trouble.

Hi Cemzafer
Sorry for the delay but I was called away on urgent business.

You are right that is just like my issues. I mentioned to tomp that it keeps tripping over deleted containers and snapshots. If I zfs destroy it, the recovery moves on to another one. So I was thinking of just deleting everything it objects to.
But I’m also thinking of giving up on the recovery command and just exporting and importing the individual containers into a new pool.

I initially thought it was because I’m only a novice with ZFS and LXD. But now I’m thinking that the recover code assumes a certain standard configuration and if you wonder too far from that configuration it starts to fail.

Thanks again.

You are welcome, thanks for the info.
Regards.

That would be the supported approach. lxd recover is only for disaster recovery for recovering from DB deletion/corruption, not for migrating instances into a new system.

1 Like

OK I’ll do that.

Thanks for your help.

I know this is slightly old but I’ve noticed a common mistake here. When asked for the source of the storage pool, it is asking for the name and not the type, so you would enter “dmz-pool-001” instead of “dataset”. That’s how I’ve always used lxd recover command to restore from a saved ZFS dataset in the past.

1 Like