Some useful info here.
https://www.altaro.com/hyper-v/shrink-hyper-v-virtual-disk-vhd-vhdx/
--please don't forget to Accept as answer if the reply is helpful--
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I recently added 1TB to a 2TB vhdx disk not realizing the disk was MBR, so the extra 1TB was not accessible, I then shrunk it back down to 2TB and lost 200,000 files which makes no sense because there was no data in the 1TB of unallocated space. I simply shrank it back down to the original size of 2TB. I am now restoring the VM to before the shrink but I still want to release the 1TB of unallocated space but not have the same thing happen. Would using resize-vhd -tominimumsize make a difference over using the GUI, or is there something else I should be doing.
Some useful info here.
https://www.altaro.com/hyper-v/shrink-hyper-v-virtual-disk-vhd-vhdx/
--please don't forget to Accept as answer if the reply is helpful--
In order to shrink space, the low level data needs to read zero. Microsoft's sdelete can be used to achieve this with the -z switch