I use the vmbuilder tool to create KVM virtual machines on my ubuntu host system. For each vm I set up a vmbuilder.partitions textfile in which the partition sizes for the vm are defined.
As simple as:
root 100000 swap 4000
Now I would create a new logical volume for the vm which has exactly the size of all defined partitions. (In the example, I would run
lvcreate -L 104G ...)
The result is a LV of exactly 104 GiB in size. But my 100 G(i?)B root-partition fills just 93.13 GiB of it. And swap just about 3.72 GiB. There are about 7 GiB unallocated space in the LV.
This is very strange, because even if you calculate vmbuilder.partitions' numbers by 1024byte/megabyte, the root partition should still be 97.65 GiB and not about 93. And swap should be about 3.9 GiB instead of 3.72. (Unfortunately these numbers scale up, a 1TB-definition will only have about 930 GiB instead of 976.)
This CAN be fixed by manually removing a rule-of-thumb estimated amount of bytes from the LV. But I want to have sane values from the start on. And having 10% of space unallocated in every VM is clearly unnacceptable.
Does anyone know the logic behind this? Thanks a lot.