I have a Hyper-V VM on my local machine. The VM disk has expanded so that I no longer have any disk space on my local machine. Due to the lack of disk space the latest merge is failing. This means that I cannot edit the VM drive to compact it because checkpoints exist for this drive. How can I regain disk space on my local machine? The only thing I can think of is to copy the VM to an external drive, work on it there and then copy it back.
Surprisingly (to me at least) I was able to use {{DISKPART}} to compact the disk image without completing the merge.
- Run
diskpart
- Select the disk via its path:
select vdisk file="<path>"
- Attach it as read-only:
attach vdisk readonly
- Compact it:
compact vdisk
- Upon completion of the compact, detach it again:
detach vdisk