What happened
When purging and reinstalling lxd today through:
snap remove --purge lxd
snap install lxd
lxd init
# (accept all defaults from init)
I encountered the error message:
Error: Failed to create storage pool "default": Provided ZFS pool (or dataset) isn't empty
Looking through zfs list
, I see:
rpool/lxd 1.03G 495G 240K legacy
rpool/lxd/buckets 240K 495G 240K legacy
rpool/lxd/containers 240K 495G 240K legacy
rpool/lxd/custom 240K 495G 240K legacy
rpool/lxd/deleted 1.41M 495G 240K legacy
rpool/lxd/deleted/buckets 240K 495G 240K legacy
rpool/lxd/deleted/containers 240K 495G 240K legacy
rpool/lxd/deleted/custom 240K 495G 240K legacy
rpool/lxd/deleted/images 240K 495G 240K legacy
rpool/lxd/deleted/virtual-machines 240K 495G 240K legacy
rpool/lxd/images 1.03G 495G 240K legacy
rpool/lxd/images/672583a05778fdd42770408068c5f932d8383539b4cdf20f11b92a0bf3b24d45 1.03G 495G 1.03G legacy
rpool/lxd/virtual-machines 240K 495G 240K legacy
Left over from the previous lxd install. If I do zfs destroy rpool/lxd -r
and then try to lxd init
again, everything works
What did you expect
Not being well versed in zfs
, it took a while to go Failed to create storage pool "default"
to zfs destroy rpool/lxd
. Some hints would be helpful - maybe something in the error messaging saying the name of the ZFS pool that isn’t empty or linking some troubleshooting info for zfs? Or if there are any simple guides on “how do I purge and reinstall lxd” that might cover this. I mistakenly dug looking for something called default
to remove, before realising I needed to purge the entire rpool/lxd
. After another iteration I realised my mistake when again reading the Would you like to create a new zfs dataset under rpool/lxd?
question from init.
Maybe error checking closer to the question Would you like to create a new zfs dataset under rpool/lxd?
might help here. I’d guess once I’ve said yes
to this question, it is detectable that init
will fail due to a conflicting pool.