Why does .vhdx take up much more space than the actual files – NTFS

ntfs

We seem to have a number of NTFS drives like this where they consume much more space on the virtual disk than they do as files.

Noticed the problem when Windows Server Backup was taking-up much more space than the files themselves.

As am example, we have a small drive with mainly office documents:

  • Size of actual files: 2.78Gb
  • Disk properties used: 6.03Gb
  • Size of compressed .vhdx: 27Gb

It is not the recycle bin, I have deleted that. It is not shadow copied, I have deleted them.

There doesn't seem to be any way of defraging these virtual drives on Server 2012 so nothing we can do there either.

Any other suggestions what is taking up this much space?

Best Answer

Deleting data inside of the VM doesn't cause the size of the VHDX to decrease. Once the VHDX grows it will remain that size, or grow larger as the amount of data inside the VM increases.

If you want to recover some of the disk space on the host that is being consumed by the VHDX you can compact the VHDX.

Additionally, you could shrink the Windows volume inside the VM and then shrink the VHDX.