Deleted ZFS, need to remove old ZFS and reinitiliza

Sorry for the troubles but I was working on reorganizing my partitions and I deleted my Zfs pool, I tried recreating the pool but since incus is still seeing the old pool I cannot run incus admin init, I also tried incus storage rm but incus says the pool is still being used. Not sure how to proceed, also did incus admin recover but that did not help. at this point I am guessing I just need to reinitilize using incus admin init but when I do incus says MyZpool already exists. Any ideas?

incus storage list will show the storage pools. Here, the storage pool is called default. If you have more storage pools, run incus profile show default to see the default profile and verify which one is your storage pool.

$ incus storage list
+---------+--------+-------------+---------+---------+
|  NAME   | DRIVER | DESCRIPTION | USED BY |  STATE  |
+---------+--------+-------------+---------+---------+
| default | zfs    |             | 99      | CREATED |
+---------+--------+-------------+---------+---------+
$ 

Then, with incus storage show you can see the details of the storage pool. In this example the partition /dev/sda8 is the block device for the ZFS storage pool.

$ incus storage show default
config:
  source: default
  volatile.initial_source: /dev/sda8
  zfs.pool_name: default
description: ""
name: default
driver: zfs
used_by:
...

The big question is how to best move on from this. If the storage pool is irreversibly gone, perhaps it makes sense to clear up everything and start over? Is there something that can be recovered, such as container names or configuration?
Perhaps someone else has a better suggestion for this.

If you really want to incus admin init, you need to remove your storage pool from the default Incus profile and subsequently incus storage remove mystoragepool.
If you cannot remove the storage pool from the default profile, create a dummy empty storage pool, add that to the default profile, then remove the default storage pool. Finally, you should be able to incus admin init.

I did do a backup of MyZpools/containers to a file which I think I can bring right back once admin init. I am avoiding loosing my network config. I will try your suggestions thank you!

Did you backup the list of the containers or the actual filesystems? If you backed up the filesystems in some way or another, there’s a slim chance they can get restored.

You can avoid incus admin init if you replace the storage pool with something else. You can add a new storage pool (incus storage create), and by doing so, Incus will initialize it as needed.

I did a fresh install, now trying to reimport my zpool.
In this case called MyPool

Do I need to create a dummy pool and then import?

squeige@Ragnarok:~$ incus storage create MyPool zfs source=MyPool
Error: Provided ZFS pool (or dataset) isn’t empty, run “sudo zfs list -r MyPool” to see existing entries
squeige@Ragnarok:~$ sudo zfs list -r MyPool
NAME USED AVAIL REFER MOUNTPOINT
MyPool 6.44G 116G 24K legacy
MyPool/buckets 24K 116G 24K legacy
MyPool/containers 4.26G 116G 24K legacy
MyPool/containers/Recorder 4.26G 116G 4.65G legacy
MyPool/custom 24K 116G 24K legacy
MyPool/deleted 551M 116G 24K legacy
MyPool/deleted/buckets 24K 116G 24K legacy
MyPool/deleted/containers 24K 116G 24K legacy
MyPool/deleted/custom 24K 116G 24K legacy
MyPool/deleted/images 551M 116G 24K legacy
MyPool/deleted/images/c19ac4df81d2f2f17eabee8189b9c11e35159d81670cad6379cc7c14632839e0 551M 116G 551M legacy
MyPool/deleted/virtual-machines 24K 116G 24K legacy
MyPool/images 1.64G 116G 24K legacy
MyPool/images/4d7b59b48f51a20cf96490ca77b8eebaa87223efde216220ec3f7da47ff46c1a 635M 116G 635M legacy
MyPool/images/97c733e753ea672f9eed9d7067e4d20b4e153b010f13905d762de3337d42fbbd 490M 116G 490M legacy
MyPool/images/9baf08a77e4e899773902a3dd444748bb6c0d0482ddbaf9c02159a35d147f91e 551M 116G 551M legacy
MyPool/virtual-machines 24K 116G 24K legacy
squeige@Ragnarok:~$

I found How to recover instances in case of disaster - Incus documentation but I could not determine the type of device I need to import. I tried all options, block, volume,dataset…
I also found this Reconnecting your LXD installation to the ZFS storage pool – Mi blog lah! but I dont think its the same situation.

Can close this thread, found the answer here Wipe everything and restore - #2 by simos and was able to reimport my containers.

1 Like