-- Ben Armstrong, Virtualization Program Manager
Talking about core virtualization at Microsoft (Hyper-V, Virtual PC and Virtual Server).
People occasionally contact me and ask me how to fix a virtual hard disk that they have which is reporting corruption.
The short answer is: "Run data recovery tools inside the virtual machine."
For the long answer we need to look at how the virtual hard disk is structured. Reading from the Virtual Hard Disk specification (available here) you can see that virtual hard disks have the following structure:
Breaking down the components of the virtual hard disk - there is:
Now let us look at the implications of data corruption in each of these areas - and the possible actions you can take:
With all of this information I can provide the "medium length answer" as to what to do with corrupted virtual hard disks, as follows:
One final point I would like to make here is this - if you ever suffer data corruption in a virtual hard disk it is important that you figure out how it happened. The two most common causes I have encountered are:
In either case you want to identify as fix the root cause as soon as possible - otherwise you are going to suffer further corruption and data loss in the future. I strongly recommend starting by looking at the event log in the host / parent environments - as 90% of the time this will provide you with the information that you need.
Cheers, Ben
Just wondered if running any of the tools available in Hyper-v on the VHD might help? eg. Compact, Convert etc.
Have some VHD files that run fine in Hyper-V but the actual files themselves won't copy due to CRC errors.
there's only 1 tool on the market that can recover corrupted VHD files (besides restoring from a backup): MediaHeal
google "mediaheal" - it's $150, but winimage, vmware tools, and everything else we've tried will not work if any portion of the header/footer is bad.
It would be nice if VMWare & MS would include recovery blocks in their virtual disks (like PAR) - or just include that option (at the expense of a little more space).
Restoring a 500+GB virtual hard disk from a backup takes hours.
I have an dynamic VHD - after an reboot I lost 3 days of work. It look like the Headers have an error and not point to the correct Data Block.
Is there a way to correct the header??
Thanks a lot