Skip to content

How to Repair a VHDX File That Will Not Mount

By Srinivasan Krishnappa · Ransomware & database recovery engineer · 656+ ransomware recoveries
6 min read
Need this solved now? We have already solved 656+ ransomware and data recovery cases. Call +91 74187 05822, WhatsApp us or email info [at] asittech.com. Free assessment; no data, no charge.

A VHDX file is a container: a header, a log, a table that says where each block of the virtual disk lies in the file, and the blocks themselves. When Hyper-V reports that the file is corrupted or unreadable, the damage is usually in the header, the log or the table, a few megabytes out of many gigabytes. VHDX recovery is mostly about getting past those structures to the disk contents.

Copy the file first

Copy the VHDX, and every AVHDX file that belongs to it, to another volume before you try anything. Mounting a VHDX read-write replays its log and changes the file; a merge rewrites the parent. If the storage itself is failing, copy once and work only on the copy.

Find out what is wrong

On a Hyper-V host, Test-VHD checks whether the file and its parent chain are usable, and Get-VHD shows the type of the disk, its parent path and its size. Mount-VHD with the ReadOnly switch tries to attach the disk without changing it. The error you get tells you which case you have.

The common cases are a host crash or power loss while the file was being written, a volume that ran full, a checkpoint chain whose parent was moved or renamed, and ransomware that encrypted the beginning of the file.

A broken checkpoint chain

If the virtual machine had checkpoints, its current state lives in one or more AVHDX files that point to a parent. When the parent path is wrong, the chain breaks and the disk will not mount. Set-VHD with the ParentPath parameter reconnects a child to its parent; it must be the parent the child was created from, in the state it was in then. Do not merge until the chain tests clean, and never merge on the only copy.

The disk mounts but Windows shows no files

Then the container is fine and the damage is inside the virtual disk: a lost partition table or a damaged file system. Work on it read-only. Running CHKDSK on a damaged volume fixes the file system by removing what it cannot understand, so run it only on a copy, and only after the files have been copied out.

When the file cannot be mounted at all

If the header or the block table is damaged, Hyper-V has no way to open the file, but the blocks of the virtual disk are still in it. A recovery program reads the VHDX structures itself, follows the checkpoint chain, and shows the partitions and files inside. Partition tables and boot sectors can be restored from their backup copies, and the disk can be saved as one raw image with its checkpoints merged.

After a ransomware attack the same applies: large VHDX files are often encrypted only at the beginning or in stripes, and the file system inside can frequently be rebuilt from what was left alone.

VMware and Hyper-V disk recovery software →

Facing this problem? Contact us now.

We have already solved 656+ ransomware and data recovery cases: encrypted and corrupted SQL Server, Oracle and MySQL databases, Tally, Busy and Marg ERP data, Veeam backups, VMware and Hyper-V virtual machines, RAID and NAS. Send us the details and we tell you what we can recover.

  • ✓ Free assessment before you pay anything
  • ✓ No data, no charge
  • ✓ NDA on request

Email: info [at] asittech.com · Mon–Fri, 9:00–18:00 IST

Request assessmentEmergency