Answered by:
VHD/VHDX recovery method

Question
-
Hi,
What is the best way to repair a corrupt VHD/VHDX file? Is there a correct process to go through and if the tools by Microsoft don't work, what other 3rd party tools do you guys recommend?
Thanks
Friday, January 16, 2015 9:33 AM
Answers
-
Hi Sir,
As far as I know , there's no such a tool provided by Microsoft to repair corrupted virtual hard disk.
My suggestion is to backup virtual machine regularly .
Also please refer to the similar thread which has been discussed :
Best Regards,
Elton Ji
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com .
Monday, January 19, 2015 11:22 PM
All replies
-
Can you simply mount the VHD(x) file and run standard tools like chkdsk? What kind of issue/corruption do you have? Is it a boot disk? Can you mount it on any system?
Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________ Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
- Edited by Sam Boutros Friday, January 16, 2015 2:45 PM
Friday, January 16, 2015 2:32 PM -
Agree with SAM.
Can you also run a chkdsk on the volume it lives on if you cannot mount the vhd/vhdx? Because why did it corrupt? Was it possibly an underlying storage issue?
Ultimately if you cannot do anything with it I've seen undeleat utilities, like getback NTFS or similar be able to pull the raw data of a failed vhd/vhdx/vmdk/vdi file. The file just has to be on the disk you run the utility against.
Friday, January 16, 2015 4:17 PM -
Thanks guys.
I have several situations I am looking to cover:
1: I have a VHD/VHDX that was a P2V of a physical box. When the image boots it wants to run chkdsk. If you let it run chkdsk it runs away with itself finding 1000's of cross linked files and on next reboot the server gives a BSOD. If you cancel the chkdsk on boot, the server boots and runs fine. I need to find a way to resolve this issue.
2: In general, I am also looking for the best process to recover from a VHD/VHDX that is corrupted and won't mount/boot in Hyper-V. I want to be able to repair the faulty VHD/VHDX so as to not have to reinstall the o/s. If that is not possible how do you get the data out of a corrupt VHD/VHDX.
Cheers
:)Sunday, January 18, 2015 5:38 PM -
Thanks guys.
I have several situations I am looking to cover:
1: I have a VHD/VHDX that was a P2V of a physical box. When the image boots it wants to run chkdsk. If you let it run chkdsk it runs away with itself finding 1000's of cross linked files and on next reboot the server gives a BSOD. If you cancel the chkdsk on boot, the server boots and runs fine. I need to find a way to resolve this issue.
2: In general, I am also looking for the best process to recover from a VHD/VHDX that is corrupted and won't mount/boot in Hyper-V. I want to be able to repair the faulty VHD/VHDX so as to not have to reinstall the o/s. If that is not possible how do you get the data out of a corrupt VHD/VHDX.
Cheers
:)1. General methodology fix the root cause not the resulting symptom. P2V produced a corrupt VHDX => solution: fix the P2V process not the resulting VHDX. Identify why P2V produced a bad VHDX. Use a different P2V configuration, process, or software.
2. You don't mount the VHDX in Hyper-V. You can mount it in any Windows 2012 R2 computer. Physical or Virtual. With or without Hyper-V Role. You right-click on the VHDX file and select Mount:
and you can see the mounted VHDX in Computer Management/Disk Management:
You can then run chkdsk and other tools
Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________ Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
Sunday, January 18, 2015 6:09 PM -
Thanks Sam,
What you say is correct, but there are situations where there is no option to re P2V a Server or mount the VHD in disk manager. What I a looking for is a process that goes beyond these basic options. For example are there 3rd party tools that anyone recommends for repairing/maintaining VHD'S?I believe there are and also what options are available in powershell. I guess i'm looking for tried and tested solutions.Chkdsk and disk manger are go to tools, but there are times when you have to move to the next level in order to return a VHD to a functioning level and it's these stages I am looking for pointers on.
Cheers
Monday, January 19, 2015 9:05 AM -
Hi Sir,
As far as I know , there's no such a tool provided by Microsoft to repair corrupted virtual hard disk.
My suggestion is to backup virtual machine regularly .
Also please refer to the similar thread which has been discussed :
Best Regards,
Elton Ji
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com .
Monday, January 19, 2015 11:22 PM -
Interesting tool, but does not support VHDX.
Most of the tools I have seen allow you to extract data from a VHD/X, but I have yet to find any that attempt to repair the VHD/X itself. If the VHD/X hosts a DC for example, I would rather try and recover the VM intact if possible.Tuesday, January 27, 2015 1:02 PM -
If you look at this dated article from Ben Armstrong it has some good information that still applies IMO.
Based on your error where it will not mount or boot I'm going to assume you are getting a corrupt error. Based on that Ben's article states.
- 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.
- 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).
- The dynamic virtual hard disk header:
- The dynamic virtual hard disk header uses a CRC checksum similar to the hard drive footer. As there is no mirror - corruption of this section of the virtual hard disk will also result in an error message from Virtual PC / Virtual Server / Hyper-V that states that the virtual hard disk is corrupted. There is no way to recover from this sort of corruption (apart from restoring a backup) - but like the hard drive footer, the chances of corruption here are low due to the fact that it is only 1KB in size.
So, I think just like a dead drive you will need to use a tool to look at the raw data blocks and recover data that way.
Tuesday, January 27, 2015 9:30 PM - The hard drive footer:
-
I also would like to suggest advance and professional VHD data recovery which is able to images, documents ,attachments, zipped etc from corrupt VHD. It is effective and easy to use application.
For more information:- http://www.filesrecoverytools.com/vhd-data-recovery.html
Wednesday, January 28, 2015 10:28 AM -
This thread is attracting spammers / advertising. I will be locking it.
This posting is provided AS IS with no warranties, and confers no rights. You assume all risk for your use.
Friday, May 20, 2016 11:27 PM