Accidentally removed lxd (zfs storage backend)

5 views
Skip to first unread message

Norberto Bensa

unread,
Apr 26, 2022, 3:30:08 AMApr 26
to lxc-users
Hello list!

I ran apt autoremove snapd, which -I thought- was an "empty" package, but the command removed snapd and every snap package, lxd included :-)

My storage backend is ZFS, and I can see my containers are still there:

zpool/lxd/containers/container-name


I can mount and backup them (I already did), but I would like to see if I can rerun lxd init and recover the installation.

If I run lxd init, I get the following error: Error: Failed to create storage pool "default": Provided ZFS pool (or dataset) isn't empty

$ lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:  
Do you want to configure a new storage pool? (yes/no) [default=yes]:  
Name of the new storage pool [default=default]:  
Name of the storage backend to use (btrfs, dir, lvm, zfs, ceph) [default=zfs]:  
Create a new ZFS pool? (yes/no) [default=yes]: no
Name of the existing ZFS pool or dataset: zpool/lxd
Would you like to connect to a MAAS server? (yes/no) [default=no]:  
Would you like to create a new local network bridge? (yes/no) [default=yes]:  
What should the new bridge be called? [default=lxdbr0]:  
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: 10.228.8.1/24
Would you like LXD to NAT IPv4 traffic on your bridge? [default=yes]:  
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:  
Would you like the LXD server to be available over the network? (yes/no) [default=no]:  
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]:  
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: no
Error: Failed to create storage pool "default": Provided ZFS pool (or dataset) isn't empty


I also tried `zfs rename zpool/lxd zpool/lxd-backup`, then `lxd init`, `snap stop lxd`, rename the new zpool/lxd to somehing else, rename lxd-backup to lxd, `snap start lxd`, but lxd doesn't see the containers.


Any help would be appreciated!

Thank you!
Norberto

Norberto Bensa

unread,
Apr 26, 2022, 3:51:38 AMApr 26
to lxc-users
answering to myself as always

lxd recover :-)

now I just need to recreate some profiles



--
You received this message because you are subscribed to the Google Groups "lxc-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lxc-users+...@lists.linuxcontainers.org.
To view this discussion on the web visit https://groups.google.com/a/lists.linuxcontainers.org/d/msgid/lxc-users/1ffa534a-cdeb-45d6-bf23-d6acecc1a9e7n%40lists.linuxcontainers.org.
Reply all
Reply to author
Forward
0 new messages