r/HyperV • u/Powerful-Bunch-3782 • Jul 17 '24
Help please!
I cant shrink this VHDX. This VM was created by this VHDX but cant shink the size of this disk. Already try to convert, shrink the disk in VM layer but nothing ived seen in internet works, only these 3 options appears. Please help đđ»
1
u/Initial_Pay_980 Jul 17 '24
You need to shrink the partition inside the vhdx. Once you have free space then you can compact
-1
1
u/Initial_Pay_980 Jul 17 '24
You have an unformatted raw partition Inside the VM. Not just free space at the end.of the drive.
1
u/Powerful-Bunch-3782 Jul 17 '24
I shrink the partition of HDD in this VM, so 100GB was unlocated, but after format as another partition and already expand the HDD size, still not work
1
u/Lusankya Jul 17 '24
Please show a screenshot of diskmgmt.msc running inside the guest, or on the host with the VHDX mounted.
1
u/Powerful-Bunch-3782 Jul 18 '24
1
u/Lusankya Jul 18 '24
You need to move the 519 MB partition. The unallocated space needs to be at the end of the drive with no partitions after it.
Diskmgmt can't do this for you. I recommend mounting the disk in a Linux guest and using
gparted. There are commercial tools for Windows that can do this too, like Macrium Reflect.
1
u/OpacusVenatori Jul 17 '24
What do you mean âonly these three optionsâ?
Compact will reduce the size of the VHDx file on the host; but the VM will maintain the original, allocated size within the guest OS. Just reduce the size of the partition within the guest OS.
1
u/Powerful-Bunch-3782 Jul 17 '24
I want the "Shrink" option, to minimize the VHDX size to export to an ESXI environment
4
u/kabanossi Jul 19 '24
Can suggest using Starwind V2V converter to make a growable virtual disk while moving the VM from Hyper-V to the ESXi host. It shrinks the disk during migration. https://www.starwindsoftware.com/starwind-v2v-converter
1
u/Powerful-Bunch-3782 Jul 19 '24
i am using Starwind to migrate the VM, but the software doesnt shrink the disk, have no this option
1
u/Powerful-Bunch-3782 Jul 19 '24
maybe i have found this feature, im doing the migration, but its by internet, so maybe monday will be finish
1
u/OpacusVenatori Jul 17 '24
There is no such option
8
u/OpacusVenatori Jul 17 '24
Itâs irrelevant anyways. When you convert the guest, select a Thin-Provisioned VMDK target disk and itâll create the appropriately sized disk.
1
1
1
u/Lots_of_schooners Jul 18 '24
Just export as dynamic vhdx. This process will create the smallest possible vhdx.
1
u/Powerful-Bunch-3782 Jul 18 '24
I thought this would solve it, it would be the kind of solution that's like, "Wow, this has to be it." But it didn't work either :(
1
u/fedesoundsystem Jul 17 '24
You first inside the guest vm reduce the partition and leave free space tp the left of the disk, towards the end. Then on the host you use the compact option and you can retrieve the free space, and the vhdx size decreases
1
1
u/pc_load_letter_in_SD Jul 17 '24
Are your guest OS disks dynamic? You cannot shrink a dynamic disk.
https://www.altaro.com/hyper-v/shrink-hyper-v-virtual-disk-vhd-vhdx/
1
1
1
5
u/Goethe101010 Jul 17 '24
Like others have said, make sure you have room on the disk to shrink. Log into the running VM, make space. Open disk management and shrink there. Then shut down the VM and try again through Hyper-v manager.