locked
VHDX Fails To Mount after copying RRS feed

  • Question

  • I have a Windows 2012 Hyper-v cluster with two nodes. All my VMs and VHDs reside in the CSV on an Equalogic SAN. Recently, I had a data VHD become corrupted on my file server, so I moved all my data from the corrupted VHD to a new VHD. After that was complete and the server was back online, I copied my old corrupted VHD onto an external USB hard drive. Now I am trying to access this old VHD by mounting it directly on the 2012 node and I get an error:

    Couldnt mount file

    the disk image isnt initialized, contains partitions that arent recognizable, or contains volumes that havent been assigned driver letters. please use the disk management snap-9in to make sure that the disk, partitions, and volumes are in a usable state.

    When i go to disk management, I go ahead and set it to online and then it just shows up as a drive with no partition on it. Have i lost this data? what can i do to get this vhd to mount properly again so i can recover some data from it?

    Tuesday, August 27, 2013 4:47 PM

Answers

  • Okay, going back and closing this out now since I found the issue...

    It turned out that there was nothing really wrong with these VHDs that i copied. they just were not in a state that allows them to be mounted as a volume. instead, i needed to attach them to a virtual machine, and then they worked just fine. I created a virtual machine on one of my HyperV servers, attached the VHD file in the properties of the vm, and bingo, it booted fine and i could access the data on those virtual disks. the article which helped me with this was....

    http://www.daepunt.com/2009/04/02/hyper-v-guest-vhd-file-corrupt-after-resize-and-how-to-fix-it/

    • Marked as answer by tallcann Thursday, September 26, 2013 8:37 PM
    Thursday, September 26, 2013 8:37 PM

All replies

  • You should be able to mount the virtual disk on any Windows 7 / 2008 R2 system or newer (VHD) or Windows 8 or Server 2012 or newer (VHDX, VHD).

    So you should be able to check the source before copying it to the USB device.

    Now, you state that you 'moved' your data from the corrupted VHD to a new one.  Was this a 'move' or a 'copy'??

    Also, how did you go about doing that?


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    • Proposed as answer by VR38DETTMVP Tuesday, August 27, 2013 6:59 PM
    Tuesday, August 27, 2013 5:38 PM
  • So when you copy files on the corrupted VHD file "to a new VHD", it is still mountable.  

    As the files are copied before it totally corrupted, could you get the files from the copied VHD instead of working on the corrupted one?


    TechNet Subscriber Support in forum |If you have any feedback on our support, please contact tnmff@microsoft.com.

    Thursday, August 29, 2013 6:34 AM
  • Here are some more details about how exactly the copy was done...

    "SourceVHD" is a 2TB volume attached to a Windows 2008R2 virtual machine and assigned as the E: drive.
    We will call this virtual machine "OriginalServer"
    The virtual machine is running on my 2012 Hyper-V Node which we will call "Node1".

    SourceVHD became corrupted and some data was lost. Chkdsk was going to take almost 48hrs, so I decided to copy the data to a new VHD instead.

    On a separate virtual machine, "TempServer", I created a new VHD and called it "TargetVHD" and mounted it as the F: drive. I logged into TempServer and ran a robocopy from \\OriginalServer\e$ to F:\. The corrupted data showed up in the log as errors, but all other data was successfully copied. Then I shut down TempServer and OriginalServer, and I moved "TargetVHD" onto OriginalServer and voila! My shares are back online.

    Now, I want to keep "SourceVHD" to attempt to recover the data that was lost, maybe using a data recovery software. I detached it from OriginalServer. I logged into "Node1" and I mounted SourceVHD directly, all the data was there and accessible. I detached SourceVHD from Node1 and I used Windows Explorer to copy it from the CSV onto an external USB hard drive. This ran successfully, about 8 hour later it had finished without any errors.

    Now, here is where my problem starts. On my 2012 machine, Node1, I browse to the VHD on my external drive and mount it and I get the error you see below. I immediately go to Disk Management and the disk shows up as 'offline' so i set it online and then the entire disk is shown as "Unallocated Space", with no partitions on the disk.

    -------

    Couldnt mount file

    the disk image isnt initialized, contains partitions that arent recognizable, or contains volumes that havent been assigned driver letters. please use the disk management snap-9in to make sure that the disk, partitions, and volumes are in a usable state.

    ---------

    Friday, August 30, 2013 3:55 PM
  • Okay, going back and closing this out now since I found the issue...

    It turned out that there was nothing really wrong with these VHDs that i copied. they just were not in a state that allows them to be mounted as a volume. instead, i needed to attach them to a virtual machine, and then they worked just fine. I created a virtual machine on one of my HyperV servers, attached the VHD file in the properties of the vm, and bingo, it booted fine and i could access the data on those virtual disks. the article which helped me with this was....

    http://www.daepunt.com/2009/04/02/hyper-v-guest-vhd-file-corrupt-after-resize-and-how-to-fix-it/

    • Marked as answer by tallcann Thursday, September 26, 2013 8:37 PM
    Thursday, September 26, 2013 8:37 PM