I feel strange about how incus assigns disk to vm

I just created a vm using incus.
incus launch images:debian/12 test --vm
After install webmin in the vm, I noticed the disk is just 4GiB. It’s fine, but when I use lsblk, it told me the disk is actually 10GiB. Why doesn’t incus assigns 9.9GiB to sda2?

Our published images on the image server are generally made to fit within 4GiB, that’s because unlike containers, VM disks can only ever be grown, so if our images were made for 10GiB, then you’d never be able to create a smaller VM from that.

Now some images will properly auto-resize their partition tables, that’s effectively guaranteed for any image using cloud-init (like images:debian/12/cloud), for those that don’t have something performing partition table resize on boot, then it’s something you need to handle yourself.

You’d normally do that by installing something like growpart and resize2fs and then run:

  • gropart /dev/sda 2
  • resize2fs /dev/sda2