Repair Corrupt Vhd May 2026
His hands went cold. That 4TB fixed-size VHD wasn't just any file. It was the last known good snapshot of a legacy SQL server for a municipal transit authority. The physical server had died three hours ago. The differential backups had been silently failing for six months. This VHD was the only lifeline.
He navigated to Z:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\ . The .mdf and .ldf files were there. He ran DBCC CHECKDB against a test restore—no allocation errors. repair corrupt vhd
chkdsk Y: /f /r /x CHKDSK ran for 90 minutes. It reported fixing three orphaned files and two bad clusters in the MFT (Master File Table). But when he unmounted and tried to attach the VHD again in Hyper-V? Same corruption error. CHKDSK fixed the filesystem inside the VHD, but not the container itself. His hands went cold
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. The physical server had died three hours ago
He ran:
The Ghost in the Machine: A VHD Repair
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: .