How to Fix Corrupted Hyper-V VHD Files

How to Fix Corrupted Hyper-V VHD Files

This article was first published as a blog post. It is offered here for community extension. Do you know of another symptom, cause, fix or tool that is relevant? Please add what you have; it is the wiki way.

Symptoms and error messages for corrupted Hyper-V VHD files are numerous, from the VM refusing to start, to failures to attach the VHD with messages like

"Failed to open attachment 'C:\ directory \MyVHD.vhd'. Error: 'The file or directory is corrupted and unreadable.'”

There are many possible causes why your VHD may become corrupted. It is not necessary to figure out the exact cause if you need it back fast: just restore the VHD from your latest backup, or as Ben Armstrong puts it in his blogpost “Run data recovery tools inside the virtual machine."” As with all things in IT “fast” is a relative term – restoring a 500 GB disk from backup can take hours. Plan accordingly.

If you are going to take the time to investigate the cause, or do not have a backup, then you must “get forensic”.

No mater what the VHD type, most common causes of data corruption in the VHD (whether fixed or dynamic) are from:

  • Data corruption due to faulty / failing physical storage
  • Data corruption due to transferring files over faulty / failing networks

If you can trace back the chain of events leading to the corruption, you will usually find a failure either by disconnecting storage while the virtual drive was being created or moved over the network Note that switching the disk-type from one to the other or expanding the disk may cause the problem, and, for some people, it has solved the problem. Sometimes this failure is not hardware, but caused by 3rd party encryption and anti-virus programs that have been installed on the host.

This Core Team blog post shows one way to begin your analysis.

 

Fixes to try:

 

 

 

Leave a Comment
  • Please add 5 and 2 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Ed Price - MSFT edited Revision 11. Comment: Title, tags

  • Ed Price - MSFT edited Revision 5. Comment: Fixed some punctuation and a link where only part of a word was linked.

  • Ed Price - MSFT edited Revision 4. Comment: Minor grammar

  • TejasJ edited Revision 2. Comment: tag edit.

  • tonysoper_MSFT edited Revision 1. Comment: mssing graphic fixup

Page 1 of 1 (5 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Great article

  • tonysoper_MSFT edited Revision 1. Comment: mssing graphic fixup

  • TejasJ edited Revision 2. Comment: tag edit.

  • Ed Price - MSFT edited Revision 4. Comment: Minor grammar

  • Ed Price - MSFT edited Revision 5. Comment: Fixed some punctuation and a link where only part of a word was linked.

  • Ed Price - MSFT edited Revision 11. Comment: Title, tags

  • There's a duplicate version of this page that needs to be removed: social.technet.microsoft.com/.../5976.aspx

Page 1 of 1 (7 items)