Shrinking VHDX unallocated space

G_ary 1 Reputation point
2020-11-27T20:53:19.477+00:00

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.

Windows for business | Windows Client for IT Pros | Storage high availability | Virtualization and Hyper-V
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2020-11-27T21:03:07.897+00:00

    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--


  2. The Network Company 116 Reputation points
    2021-04-22T04:25:16.667+00:00

    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

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.