LXD VM [on zfs storage] - how to set storage size

The normal config commands don’t seem to be working. I need it larger than 10GB - how to I make the root disk bigger?

To get a list of containers / volumes:

lvscan

To increase size of an old container:

lvextend /dev/vg0/containers_example --size 20G

Thanks, Steven.

Perhaps that would work for some setups. I’m using ZFS storage for LXD, so the containers don’t show up with lvscan.

I tried this:
zfs set volsize=20g [virtual machine zfs block]

And that seems to have worked. Thanks.

1 Like

The normal commands should work, to an extent.

Please can you list what you are running to increase the size?

Also keep in mind that VMs are different to containers, and the VM disks are raw disks with their own partition table that can vary from distro to distro, so LXD cannot resize the partition and the filesystems inside the VM, only the raw disk.

You should be able to see that taking effect by checking the output of the lvs command.

I would not encourage the manual resize of LVMs using commands like lvextend as LXD will lose track of what size the volume is supposed to be.

1 Like

Thanks @tomp. lvs doesn’t provide any output related to the VM. I believe because it is on zfs.

the zfs command I included above does seem to have worked. Within the VM, it is reporting 20gb now.

Ah I see, it was the previous poster’s mention of the lv commands that made me think you were on LVM.

But the same rules apply, LXD should resize the ZFS volume itself, then inside the VM you will need to enlarge the partition and the filesystem.