Perfectly Sized Windows Disks
One thing that has always bugged me, is that a Windows VM with a 50Gb disk actually appears as 49.9GB. While it’s entirely cosmetic, wouldn’t it be nice to have pefectly sized disks. Disks the actual size we specify, not that slightly smaller size you actually get.
Disks vs Volumes
Let’s be clear, what we want are perfectly sized volumes in Windows. However, we are presumably working in a virtual environment where the actual size of the disks we present to our VM is fungible, rather than fixed by literal disk size.
There’s an assumption here that a disk setup for a VM is fully allocated in one complete Windows volume. On a system disk you have a system partition but it’s small enough not to matter. Recovery partitions on VMs are basically useless and should be deleted.
If for some reason you do have multiple volumes per VM disk then sizing is still valid. Add all your expected volumes and make disk the correct size to have space for all of them.
What causes irregular sized volume?
The filesystem itself steals space to store it’s own metadata. It’s not a huge amount but it is what causes the slight offset of dises from nice round numbers.
The Basic calculation is:
(Disk Size (in MB) / 10000) * 8 = Volume Overhead (round down to multiple of 10)
Which for 100Gb is
100Gb / 1024 = 102,400MB
102400 / 100000 * 8 = 80Mb
So instead of disk size of 102,400MB we actually need 102,480MB
In Windows our volume is actually 102,383MB
Set it to 102480MB and we now get a perfectly sized volume.
In my testing NTFS and ReFS are identical. Disk options such as GPT/MBR and Basic/Dynamic makes zero difference.
VMWare disk size
Awesome, but to actually extend the disk to the slight extra space, so take filesystem overhead and add it to VMWare disk size.
We can probably calculate it, but seeing as VMWare sizes disks in GB and up, it’s easiest just to work at that level. In which case for smaller disks, adding 1GB will be enough for disks up to almost 1Gb. Higher than that add an extra 2Gb.
At small sizes 1Gb of overhead is going to give you some wasted disk space, and if you choose you can specify disk size to the MB size rather than round GB size numbers. As this entire exercise is about creating nice round disk sizes for no reasons except aesthetics, I wont judge, but you will need to work it out yourself.
Having a little extra overhead on system drives at small sizes is useful for containing system partitions and recovery partitions (although in virtual environments recovery partitions are probably useless and can be removed). Something to consider, but an extra 1Gb on a 40 or 50Gb system drive just ensures you don’t have to do too much worrying about system volumes and things.
When setting up larger drives you might be tempted to do 1.1Tb but working in GB ensures that extra unused space is minimized.
Perfect Disk Size Table
While you have the general formula, here’s a nice reference table for various sizes
Pefect Size (GB) | Windows Size (in MB) | Disk Size in VMWare GB |
---|---|---|
10 | 10248 | 11 |
20 | 20496 | 21 |
40 | 40992 | 41 |
50 | 51240 | 51 |
60 | 61488 | 61 |
75 | 76856 | 76 |
100 | 102480 | 101 |
200 | 204960 | 201 |
500 | 512408 | 501 |
750 | 768608 | 751 |
1024 | 1049408 | 1026 |
2048 | 2098824 | 2050 |