Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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:
The hard drive footer:
The dynamic virtual hard disk header:
The block allocation table:
Data blocks:
Now let us look at the implications of data corruption in each of these areas - and the possible actions you can take:
The hard drive footer:
Stored in the hard drive footer is a CRC checksum. If this footer is corrupted we will detect it immediately. In the case of a dynamic or differencing virtual hard disk we will attempt to restore the footer using the mirror copy at the top of the file. In the case of a fixed size virtual hard disk (or for a dynamic or differencing virtual hard disk where both the footer and mirror have been corrupted) you will be presented with an error saying that the virtual hard disk is corrupted when you try to start the virtual machine (or edit the virtual hard disk).
There are no tools or methods available for fixing this sort of corruption - and your only option is to restore a copy of the virtual hard disk from your most recent backup (you are backing up - right?). Keep in mind that the footer is only 511 bytes in size - so the chances of if getting corrupted are relatively low.
The dynamic virtual hard disk header:
The block allocation table:
Data blocks:
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
Anonymous
September 23, 2011
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
Anonymous
November 12, 2012
How do I run data recovery tools inside the virtual machine when I can't start up xp mode/
Anonymous
July 26, 2014
just wanted to if a virtual disk that reports zero bytes means that header or footer is currupted
Anonymous
October 08, 2014
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
Anonymous
May 11, 2015
Don't Worry, now you can recover corrupt and delete VHD file in few mouse clicks with Kernel for VHD Recovery Software. It can recover image, audio, video, database, documents, archive etc. Software can perform data work from corrupted, deleted and formatted Virtual Hard Disk.
Anonymous
January 01, 2016
To repair and Fix corrupted or damaged VHD files data without any data loss. This tool scans the FAT and NTFS file systems of the virtual hard disk and fix all types errors and issues, then recover corrupt, damaged or lost VHD files. It supports VHD files created using Windows Server 2008 R2 and 2012 R2, Windows 8.1, Windows 8, Windows 7 and Hyper- V server. See more information at: www.recover.mozesoft.com/.../vhd-recovery
Anonymous
January 28, 2016
Great, i would like to share Virtual Machine Data Recovery software to repair & Recover Virtual Hard Drive Accurately and Completely. It can easily be controlled and relocated between different machines. It also makes its simple to recover data with virtual machines. Read more :- www.recover.mozesoft.com/.../vhd-recovery
Anonymous
April 08, 2016
Hi,Very intersting arcticle. I had 3 times a bad VHDX, VM oS was reporting errors on the disk and My host was timing out on the CSV my VM is on trying to access it.Because of that my cluster became extremely unstable, the VM unmanageable.I fixed it by isolating the VM on the the host.rebooting the host.Locate the VM as soon it fail-over another Host and shut it down.Clone the VM (new VHDX File)power up the new VMDelete the old one therefore deleting the bad VHDX.Hope it help anyone having the same problem i had.
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in