DEV Community

Cover image for How to Repair Corrupt VHD/VHDX Files that are Unreadable?
jamesrobert1511
jamesrobert1511

Posted on

How to Repair Corrupt VHD/VHDX Files that are Unreadable?

Summary: We sometimes have to repair a corrupt VHD. This is a common problem. This blog will help you find the best solution to this problem. You can resolve your problem by reading this blog to the end. After reading this blog, I'm sure you will find the answer to your issue. There are two ways to repair unreadable VHDs. We will go over both methods so you are not confused. Let's begin with the blog.

Introduction
Microsoft's virtualization tools, Hyper-V and Virtual PC, use VHDX and VHD as file formats. VHD is short for virtual hard drive. This is a file format for disk images that contains the contents of your computer's hard disk, such as disk partitions and file systems. It also includes files and folders. The user can store these files on a USB flash drive and then move them anywhere.

VHDX, however, is a more advanced version of VHD. It offers more storage, reliability, and performance flexibility than VHD. It also stores custom metadata and offers larger file blocks on dynamic and differential disks. VHDX protects files from errors in the event of a sudden power outage.

What causes VHD or VHDX to become corrupted and unreadable?
VHD/VHDX corrupted files can be caused by a variety of reasons. Below are the reasons:

Improper shutdowns, Accidental deletion etc, can corrupt VHDX files.
VHDX files can be damaged by unidentified software.
VHDX corruption can be caused by bugs, glitches, and other factors.
VHDX files can be corrupted by defective hardware components, such as disk failures or controller failures.
How To Repair Corrupt VHD Files?
You may be in a difficult situation if you have a VHD file that is corrupted, but don't panic. You can fix the corrupt VHD files manually using these methods.

Virtual Disk VHD File Repair by Hand
Manual methods are free. You can perform them yourself, but you must have some technical knowledge. Let's start with the method.

#1. Create a new virtual hard disk:
Click on "My Computer" in the right-click menu and choose "Manage".
Select "Disk Management" in the Computer Management System.
Click on the "Create VHD File" button after expanding "More Actions."
Select "OK" to build the properties of your new VHD file.
Delete the corrupted file and move all your data into this new one.
You can use this procedure to fix corrupt VHD files. You can try another method if you are not able to solve your problem.

#2. Repair Using Windows PowerShell:
Click on the Windows Start button and select "Window PowerShell (Administrator)"

Put this command: Dism/Online/Cleanup-Image/ScanHealth, and press Enter to scan and repair the VHD file.

#3. Repair With the CHKDSK Command
Unmount the Virtual Hard Disk. Use CHKDSK before.

Search for "command prompt" in the Windows search and run asan administrator.

Enter "CHKDSK", then type the code to scan for damaged files.

#4. Run Disk Utility to check your disk:
Start by turning off the machine and then placing the VHDX on the host server.

Use the following command to run a disk check on the operating system: chkdsk /f/r/x

This software can be used to scan for errors, corrupted files, and bad sectors.

#5. Install the Operating System Partition.
Another solution is to reinstall the operating system partition.

Windows will be reinstalled after deleting the partition. Maintain the same IP address and computer name.

Use the following command to reinstall Exchange Server and retrieve configurations from Active Directory:

setup /mode:recoverserver /IAcceptExchangeServerLicenseTerms

This will fix the issue with the Operating System not booting and ensure that the Exchange Server is activated.

#6. Use ESEUtil to perform database recovery
ESEUtil restores databases when data cannot be restored despite the services being restored

Use the Eseutil command /r to repair small corruptions in the transaction logs or database.

If the command above doesn't work, you can also choose a hard-recovery option, but this should only be your last resort:

Hard recovery can recreate EDB files and delete corrupted information. It is risky and not guaranteed to mount the database successfully.

Note: Hard recovery is against Microsoft's guidelines for support, and Microsoft may not provide assistance if you use this method.

You can now repair VHD files that are corrupted by using the manual methods. I hope your problem will be solved. These manual methods do have their disadvantages. To perform these methods, you need the right technical skills. It is also very complex and time-consuming.

Let me show you a professional tool that is both secure and reliable to overcome all of its shortcomings.

#2. Professional Method to Recover Unreadable VHD File
DRS Softech VHD Recovery Tool & VHDX Recovery Tool can repair unreadable VHD/VHDX files. The users can save the Disk Images to any location they choose on the system. You can also view the data that has been recovered and fixed before saving. It also supports the MBR as well as the GPT hard disk formats. This tool is enhanced by the Custom Settings Option. This tool is compatible across all major Windows versions. Let's now see how the professional tool can repair corrupt VHD files.

How to recover an unreadable VHD file using the tool:

  1. Open the DRS Softect VHD recovery tool on your PC
  2. Select the type of disk (fixed or dynamic).
  3. Select the VHD file by pressing the Browse button and then the Open button.
  4. You can now view the file information and select the Next button.
  5. Select the scanning mode, Standard or Advanced, and then press the Next button.
  6. Select the volume list from which you wish to recover data.
  7. Choose the recovery mode you want: Standard, Advanced, or Deep.
  8. Once the scan is complete, click the OK button.
  9. The software displays a Tree Structure where you can view the VHD data.

Finally, select the folder you want to save. Then click the Save button.

Last Words
The process of fixing a corrupted VHDX is a step-by-step one. This blog concludes with the hope that you have been able to resolve your issue with a corrupt VHD. You have been shown some manual ways to repair it. This method has some disadvantages. To repair a virtual disk VHD, you can use a professional solution. You can choose the method that is best for you.

Top comments (0)