mgutt Posted December 23, 2021 Share Posted December 23, 2021 When you create a VM it's vdisk is a sparse file. A sparse file saves a huge amount of space on your disk, because data which contains nothing (zeros) is "compressed". But after a while it will become bigger as deleted files are not really deleted. To understand this, we use an example. I created a 32G vdisk for my Windows 10 machine: After installation its size is 15G (as it's a sparse file): file="/mnt/cache/domains/Windows 10/vdisk1.img" du -h "$file" 15G /mnt/cache/domains/Windows 10/vdisk1.img After installing the network driver and some updates it grow to 18G: du -h "$file" 15G /mnt/cache/domains/Windows 10/vdisk1.img After installing this tool inside the Windows VM: https://docs.microsoft.com/de-de/sysinternals/downloads/sdelete and executing this command: sdelete64 -z c: it grow to 30G: du -h "$file" 30G /mnt/cache/domains/Windows 10/vdisk1.img And finally after this command: fallocate -d "$file" It shrunk to 15G again: du -h "$file" 15G /mnt/cache/domains/Windows 10/vdisk1.img The same can be reached with a Linux VM and the command "zerofree". This could be executed once every month. Quote Link to comment
JonathanM Posted December 23, 2021 Share Posted December 23, 2021 https://forums.unraid.net/topic/51703-vm-faq/?tab=comments#comment-557606 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.