Initialise Incus on ZFS (all of it, including /var/lib/incus)

If I want to put all of Incus on ZFS, what’s the right way to do that ?

On a new install, if I preseed with a zfs dataset, it uses that but also has files on /var/lib/incus which is just a directory on the rootfs.

What’s the right way to give Incus a dataset and have it use it for /var/lib/incus and everything else ?

To contrast, my old lxd is set up like this (dataset is mounted at /var/lib/lxd and everything is beneath that. But I can’t remember how I did that). Looking at it, I think I must have manually created and mounted dataset on /var/lib/lxd and then initialised it with a storage pool dataset beneath.

Indeed, if I do that on Incus, that’s what I get… a dataset for /var/lib/incus and another dataset beneath it for the storage pool defined in my preseed file (plus a number of other datasets beneath that).

It looks to me that you have to create a dataset mounted on /var/lib/incus BEFORE initialising with a storage pool on a new child dataset of that.

I’d like to do this the right way, if I can confirm what that is ?

You can manually create your zpool, create a dataset that you place at /var/lib/incus, then install the incus package. And when initializing Incus, give it another dataset within that same zpool for its storage pool.

1 Like