Repair Corrupt Vhd < UHD – HD >
Mount-VHD -Path E:\VHDs\prod_db_backup_2024.vhd -ReadOnly The error was cryptic: The VHD is corrupted. The block allocation table is inconsistent.
The tool had detected that the dynamic VHD header had a checksum mismatch—likely from an unclean Hyper-V host shutdown. VHDTool recalculated the checksum and zeroed out the corrupted BAT entry that pointed to a non-existent sector. repair corrupt vhd
The Ghost in the Machine: A VHD Repair
Next, he tried -> Edit Disk . The wizard froze at 12% while attempting to compact the drive. No dice. Mount-VHD -Path E:\VHDs\prod_db_backup_2024
The sector size was misaligned. The VHD's internal "footer" (the last 512 bytes of the file) was intact—he confirmed that with a hex dump—but the BAT (Block Allocation Table) had a phantom block pointing to a sector that didn't exist. VHDTool recalculated the checksum and zeroed out the
vhdtool.exe /repair "E:\VHDs\prod_db_backup_2024.vhd" The output was promising: [INFO] Footer found at offset 4294967296. [INFO] Header checksum invalid. Recalculating... [INFO] Rebuilding BAT. 1 invalid block entry removed. [SUCCESS] VHD repaired.