Repair Corrupt Vhd <Desktop>

Marcus re-ran the PowerShell mount command, this time writable:

Z:\ opened instantly.

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. repair corrupt vhd

Mount-VHD -Path E:\VHDs\prod_db_backup_2024.vhd -NoDriveLetter Get-Disk | Where-Object OperationalStatus -eq "OK" A new disk appeared: Disk 4 (Offline) . He brought it online, assigned a drive letter Z: , and held his breath. Marcus re-ran the PowerShell mount command, this time

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. Mount-VHD -Path E:\VHDs\prod_db_backup_2024

Marcus knew a trick: mount the VHD as a raw disk using a loopback driver. He used OSFMount from PassMark. He mounted the VHD as a read-only raw drive letter Y: .

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.