Had a server lose power over the weekend and the VHDX file of a client’s FreePBX Virtual Machine was corrupted. Trying to mount the disk image resulted in “Couldn’t mount file” – “The disk image file is corrupted.” Surely this is an easy fix but I was really surprised that Microsoft didn’t have some simple tool to fix. It can’t be THAT broken, right? After an hour or so of Googling, I found many other programs that also couldn’t help.
Then I stumbled on this old reddit post where someone mentioned having luck with UFS Explorer to mount the VHD / VHDX files. The free demo version of UFS Standard Recovery saved the day.
How to fix your corrupt VHD / VHDX file by copying to a new VHD / VHDX file
- Create a new empty VHDX file and mount / initialize it in Windows – this is where we’ll be recovering the data so make sure it is the same size as the corrupt VHD / VHDX
- Install UFS Standard Recovery – you can use the demo version to do the recovery
- Open -> Image File or Virtual Disk and load your corrupted VHDX file in the UFS Program.
- Click on the disk image in the tree to select it and then the “Backup data” button to copy the contents of the bad disk image to the good disk image and let it go to work!
That’s it! Re-mount your new copied image in Hyper-V and boot right up! Even though this can be done with the free demo version, the UFS software is well worth the $70 to have in the toolbox and then you can do individual file recovery off just about anything.