-
Written By Rohan Wiese
-
Updated on December 14th, 2023
Whenever corruption takes place in the virtual machine, you can face fatal data loss. The VHD (Virtual Hard Disk) file plays a very important role in a virtual machine. Any sort of error or corruption occurs in the VHD file, it’ll definitely cause great damage. So whenever you face corruption in VHD file, you must repair it. You can use the VHD tool, a freeware utility provided by Microsoft, to repair VHD file. Also, you can try a couple of manual tricks to fix corrupt VHD file. We’ll discuss everything in detail later in this post.
What is virtualization? Do you use it? Do you like it? These are few common questions which computer users generally ask to each other. Over past few decades, virtualization has become very popular among organizations as well as computer users. Why? It’s just because it makes more efficient use of physical resources. Virtualization has vast benefits, and different organizations use it differently. But the primary objective of using virtualization is to reduce unused resources and increase efficiency and uptime. But sometimes, mishappenings can also take place. A virtual machine is prone to errors which can cause great trouble. Sometimes error messages may result in corruption.
Have you ever encountered an error message while attempting to start the virtual machine? Did it say, “The file or directory is corrupted an unreadable?” Did you try to find out the reason that caused this error? Confronting error messages is easy, but sometimes it’s very challenging to find out to their root cause. Confronting error messages is easy, but sometimes finding their root cause becomes a challenging task. Below is the most common error message you can receive:
The most probable reason for this error message is corruption. So the only way to fix this error message is to repair VHD file. Before you can try anything to repair VHD file, you can restore VHD file from the backup. But this is only possible if you have the backup file. And make sure the backup file is in a valid state. If the backup file is invalid, you just can’t restore anything from it.
If you have no backup file, you’re left with only solution, repair VHD file. There are few things you can try here to repair VHD file manually. A couple of easy manual tricks and the VHD tool, you can use any of these with ease.
The very first thing you should try here is checking the integrity of the VHD file. Though it looks very simple trick, sometimes it works like magic. You need to run a script in the PowerShell to mount the VHD file in the ROOT folder. This will enable you to run a CHKDSK on it.
Run the PowerShell commands given below (change your details as per requirement):
#First we choose what VHD we want mounted $VHDName = "V:\serverx.vhd"
#Get the MSVM_ImageManagementService
$VHDService = get-wmiobject -class "Msvm_ImageManagementService" -namespace "root\virtualization" -computername "."
#Now we mount the VHD
$Result = $VHDService.Mount($VHDName)
Now you can run a CHKDSK on this VHD file.
Another thing you can try here is to create a new Virtual Machine and add the corrupt VHD file. After that, you need to compact the VHD file. See below how you’ll do that:
After this successful compaction, copy the VHD back to the original server and try to mount it.
If the above manual tricks don’t fix corrupt VHD file, you must try the VHD tool provided by Microsoft. First, download the VHD tool. And then, run the following command:
VhdTool.exe /repair <BaseVhdFileName> <FirstSnapshotAVhdFileName> [/quiet]
Make sure you take the backup of your VHD file before you can use the VHD tool or any other manual tricks.
In a case when no manual trick works for you, you should look forward to a professional recovery solution. VHD Recovery software is one such advanced solution to handle corrupt VHD file. You should download its free demo version for free evaluation purpose. By using demo version, you can scan corrupt VHD file and check what you can actually recover from it before purchasing the software. And if you’re satisfied with the results, then only you should place your order for the licensed version.
About The Author:
Rohan Wiese is a Technical Writer at Aryson Technologies. He is an expert Email Forensic, Cloud Computing, and a passionate nerd with over 10 years of experience in technical content writing. He writes about Cloud Migration, Database Recovery, Email Backup, Windows, Mac, and Tech.
Related Post
Useful Links
© Copyrights 2014-2024 by Aryson Technologies Private Limited - All Rights Reserved