Incus admin init: btrfs but neither in /var nor as loop device

Hi, I’m a bit puzzled by incus admin init: I have multiple btrfs filesystems and want to create a new subvolume in one of them (just not in /var which is on my rather small root partition). But the init command won’t let me:

$ sudo incus admin init
Would you like to use 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 (dir, btrfs) [default=btrfs]:
Would you like to create a new btrfs subvolume under /var/lib/incus? (yes/no) [default=yes]: no
Create a new BTRFS pool? (yes/no) [default=yes]:
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]:
Size in GiB of the new loop device (1GiB minimum) [default=19GiB]:

I’ve set up LXD/incus multiple times in the past, often with non-default storage, so I’m wondering if there has been a change in the init command or if I’m simply misremembering things.

Anyway I’d like to suggest that the init command should also ask if I want to use a new subvolume of an existing btrfs filesystem. Neither /var nor a loop device seem appropriate on my host. (I’ll probably proceed with the default /var and add a second pool, but it seems a bit inelegant to leave the /var pool to be orphaned.)

It should be possible by doing it outside of incus admin init with:

incus storage create default btrfs source=/path/to/your/new/subvolume
incus profile device add default root disk pool=default path=/

Would that be before or after admin init? Thanks for the quick reply!

It doesn’t matter if you do it before or after, just say no to creating a storage pool when running incus admin init since you’re doing the storage part separately.

Worth noting that there’s nothing special about incus admin init, it’s basically just asking you a few questions to save you having to use incus storage create, incus network create, incus profile set, …

An equivalent of an incus admin init --auto is basically:

incus storage create default dir
incus network create incusbr0
incus profile device add default root disk pool=default path=/
incus profile device add default eth0 nic network=incusbr0 name=eth0
2 Likes

Thanks for the explanation!