I try to install v3.0 from snap and migrate
=> Updating the storage backends
error: Failed to update the storage pools: Failed to run: zfs list -H -t all -o name,mountpoint -r : cannot open ‘’: invalid dataset name
I remove snap and reboot server after that service lxd failed with error Error creating database: failed to begin transaction: unable to open database file
I copy lxd.db.bak to lxd.db and try to start lxd service Failed to set new ZFS mountpoint: cannot open 'lxd/containers/container name': dataset does not exist
When i try to start lxd
lvl=warn msg=“Incorrectly applied “storage_api” patch. Skipping storage pool initialization as it might be corrupt.” t=2018-04-23T22:16:08+0200
lvl=warn msg=“Database already contains a valid entry for the storage pool: lxd.” t=2018-04-23T22:16:08+0200
lvl=warn msg=“Storage volumes database already contains an entry for the container.” t=2018-04-23T22:16:08+0200
lvl=warn msg=“Failed to set new ZFS mountpoint: cannot open ‘lxd/containers/communal-stud’: dataset does not exist\n.” t=2018-04-23T22:16:08+0200
Ran lxd.migrate, got an error after most of the migration ran
Removed the snap
If that’s the case, then you most likely lost all the LXD data when you removed the snap…
We could have pretty trivially made you recover from the lxd.migrate failure and gotten you onto the snap, but removing the snap made it wipe /var/snap/lxd/common/lxd where all your data was.
Can you paste find /var/lib/lxd/ to see what’s left there?
The zpool error most likely comes from the fact that you used a loop-based ZFS disk, which would have been stored in /var/lib/lxd/disks/ but is most likely gone now…
i try to import zfs.img (zpool import -d /var/lib/lxd/disks/ -a)
root@lxd1:~# zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
lxd 179G 59.3G 120G - 56% 33% 1.00x ONLINE -
and lxd service failed with errors
lvl=warn msg=“Incorrectly applied “storage_api” patch. Skipping storage pool initialization as it might be corrupt.” t=2018-04-24T00:20:58+0200
lvl=warn msg=“Database already contains a valid entry for the storage pool: lxd.” t=2018-04-24T00:20:58+0200
lvl=warn msg=“Storage volumes database already contains an entry for the container.” t=2018-04-24T00:20:58+0200
lvl=warn msg=“Failed to set new ZFS mountpoint: cannot open ‘lxd/containers/communal-stud’: dataset does not exist\n.” t=2018-04-24T00:20:58+0200
lvl=warn msg=“Storage volumes database already contains an entry for the container.” t=2018-04-24T00:20:58+0200
Maybe i need to change something in database?
root@lxd1:~# sqlite3 /var/lib/lxd/lxd.db 'SELECT * FROM storage_pools;'
1|lxd|zfs|
root@lxd1:~# sqlite3 /var/lib/lxd/lxd.db 'SELECT * FROM storage_pools_config;'
69|1|size|35GB
70|1|source|lxd
I cleaned the database of these containers, delete these from containers and storage-poos/lxd/containers dirrs and start lxd. after that i mount all lxd containers partitions and lxd import. And all works)