Previously I’ve covered how to increase disk space in Windows server, now we’ll be outlining how to do the opposite by shrinking the disk space for a virtual machine running Windows Server 2012 R2. Firstly we will be shrinking the file system within the operating system, and then shrinking the actual virtual disk afterwards to reclaim space.
As of Windows Server 2012 R2, Hyper-V allows us to dynamically shrink and expand the size of our virtual hard disk while the virtual machine is still running, meaning that there is no down time. Prior to 2012 R2 you would have to shut down the virtual machine to complete the process, I’ll cover where that’s done later on in case you’re using a version prior to 2012 R2.
Shrinking the available disk space on a server may allow us to use the space elsewhere, perhaps on another virtual machine. Typically most provisioning nowadays is thinly provisioned where the virtual disks will only be the size of the data stored on them rather than wastefully statically assigning the total space of the disk, so this may not be very beneficial for you. With that in mind there are still times where you may want to shrink the available disk space on the server to prevent a user using it. For example a service provider may have a customer looking to downgrade their disk space and we would want to shrink their disk back so they do not use space they are no longer paying for.
Read more »