Hyper-V Program Manager
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.
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
How do I run data recovery tools inside the virtual machine when I can't start up xp mode/
just wanted to if a virtual disk that reports zero bytes means that header or footer is currupted
If you compare the header of a good and a problem vhdx, with a hex editor, you can sometime see if it is 'minor' header corruption or something more massive
Note the header is quite large, and largely full of 00's, so need to look quite far into it to find non zeros bits in the good version