Corrupted VHD files

Corrupted VHD files

2013-05-14
/ / /

Corrupt VHD files…  We utilize PVS and when we were attempting to update the target device software utilizing Hyper-V we got several error messages saying the VHD is corrupted.  The actual root of the issue is that PVS makes 16MB block size VHD files (thanks SAMAN!) and Windows 2008 only reads VHD files that are 512KB or 2MB block sized files.

Attempting to mount the VHD file via disk management fails as well.  The only utility that would mount the VHD file that was generating the error messages at the end of this post is the Citrix CVHDMount utility available via PVS (C:\Program Files\Citrix\Provisioning Services\CVHDMount.exe)

Since our Hyper-V server was separate from the PVS server, we needed to install the drivers to allow CVHDMount.exe to work.  In order to do this you need to install the drivers in this folder:
C:\Program Files\Citrix\Provisioning Services\drivers

You can right-click “Install” on the cfsdep2.inf file.

For the other driver you need to open Device Manager, go through “Add new hardware…”, “Add legacy hardware” and then browse to the drivers folder and add the cvhdbusp6.inf.

Now we would mount the disk as a drive letter using this command line:

At this point you need to set the disk to “Offline” in Disk Management.

From here we can now add the disk as a physical disk to Hyper-V.

And we can now do the Target Device Update.  Error messages seen during this troubleshooting:

 

3 Comments

  1. |Atum| 2013-07-01 4:09 pm

    For what its worth, I've experienced this and it just came back to me today when I tried to mount a vhd. My VHD was created with the PVS imaging wizard originally which may have been the cause (not sure). At any rate, the workaround I used was to use "VhdResizer" to copy the VHD block by block. Hope this helps.

    Reply
  2. Trentent 2013-07-08 12:58 pm

    VHD Resizer fails when the block size is 16MB. When I used it to "clone" the VHD to another the "clone" was throughly corrupt.

    Reply
  3. Anonymous 2014-08-26 2:36 pm

    Thank you so much! I thought there was something wrong with my vDisk until it happened to a 2nd one. Then I was confident it had to be some sort of settings that Hyper-V can't read.

    Reply

Post a Comment

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.