How to Repair Corrupt VHD File Using Simple Techniques

Summary: Data is prone to corruption and VHD files are not able to escape from this. The aftermath of corruption can make our valuable information lost and it creates a difficult situation for us. So, in this handout, I’ll try to elaborate that what a VHD file is, how corruption takes place and how to repair corrupt VHD file using some simple but effective ways. We will also share information about a professional tool named VHD Recovery tool in this post. Download Now   Purchase Now

Microsoft’s virtual machine supports two kinds of file formats: VHD and VHDX. These are the file formats of the virtual hard disk and they are used for backing up a system image. VHD is a prior version of VHDX which varies from the file size. Before Windows Server 2012, the storage capacity of VHD files was 2 TB but after VHDX arrived the file limit got up to 64 TB and it became popular to back up a system image. You can use it to save a big amount of money by installing multiple OS on a single machine without buying multiple computers for that. They are doing more than our imagination. If you are looking for ways to fix Error 0x00000002, then read the blog.

Why are they Get Corrupt and Inaccessible?

There are various reasons responsible for VM image file corruption. It could be a faulty hard drive, malicious entities, or antivirus itself and a faulty network can also be responsible for that. I’ve tried to list some common reasons for VHD corruption:

  • Malicious Entities or Viruses:

A malicious entity or virus can ruin our data files. They can cause corruption and can also make the file inaccessible.

  • A Corrupt Hard Disk:

There could be a failure in the hard disk or a manufacturing issue can lead to VHD corruption.

  • Anti-virus itself:

Sometimes antivirus programs and encryption methods also create interference in the VM operations, which leads to corruption and trouble.

  • A faulty network:

If the transfer media is not right and some issues are associated with the network then it could lead to data loss.

How to Repair a Corrupt VHD File?

If somehow your image file is inaccessible or corrupted due to any reason, there is a possibility to recover them. There are various methods to restore your lost files back. Let’s see them:

Method 1: VHD recovery via Windows Powershell

The first and foremost method of restoring the data is through the Windows Powershell method. For this, you need to type and run some relatable commands. With the help of the Windows PowerShell method, you can mount the respective folder to the root. Accordingly, run CHKDSK on the VHD file for the completion of the process.

Step 1. This command will help you select the corrupt file in order to get mounted.

$VHDName=”E:\xyzdrive.vhd”

Step 2. This command will help you in getting an Image Management Service.

$VHDService = get-wmiobject -class “Msvm_ImageManagementService” -namespace “root\virtualization” -computername “.”

$Result = $VHDService.Mount($VHDName)

Step 3. Now the VHD is been mounted so for checking purposes simply type the above command.

Method 2: Repair VHD Files Through the Microsoft VHD Repair Tool

With the help of this executable file provided by Microsoft, the user can easily recover the respective VHD files in a short duration of time.

Simply you need to follow some steps and then you are done with it.

Step 1. Download the .exe file of VHD recovery.

Step 2. Run the file as admin.

Step 3. Now, go for the provided command.

exe /repair <BaseVhdFileName> <FirstSnapshotAVhdFileName> [/quiet]

Method 3: Recovery by Using Virtual Machines

Another method for repairing the corrupt file is by creating a virtual machine in your system which will help you to solve the problem by repairing the corrupted VHD file.

Follow the below-mentioned steps to do so:

Step 1. In the first step, you have to create a new virtual server and attach a new hard disk to the new server.

Step 2. Now open the “settings” option and choose the newly added hard disk, after that select the corrupted file which you want to repair.

Step 3. Select the “compact” option by clicking on the virtual disk wizard button and go for the option “convert it to a fixed size virtual hard disk”.

Step 4. Save your repaired VHD file with a new file name.

The above method will compact the corrupted image file and you can now mount it over the original server with ease. To Stop the 0x00000003 error, read this informative blog.

Conclusion

By following these methods you can easily repair corrupt VHD File of the virtual hard drive. If there are some issues found during the data recovery process using the manual ways, you should go for a third-party tool. I’ll suggest you the VHD File Repair Tool. It’s a free repair software, which lets you recover all types of Virtual Machine file formats like VHD, VHDX, VMDK, and VDI. So, I hope it will solve all your issues related to VHD corruption and inaccessibility of Virtual Machines data.

5/5 - (1 vote)

About The Author:

I'm a Tech Geek who loves technology and like to resolve issues, related to Data Entities. I like to write blogs that related to Email Migrations, Database Recovery, Email Backup, Tech, Mac, and Windows,

Related Post