Find the answer to your Linux question:
Results 1 to 5 of 5
Hello, I had Gentoo installed on a Microsoft Windows Hyper-V virtual machine. The system shutdown properly but the RAID array on the drive it was on failed. We had a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    8

    Retrieving Data from VHD File (Virtual Machine Harddrive)

    Hello,

    I had Gentoo installed on a Microsoft Windows Hyper-V virtual machine. The system shutdown properly but the RAID array on the drive it was on failed. We had a backup that was poorly configured and as such we didn’t back up all of the data we needed.

    Therefore, after getting the RAID array back to a degraded state I was able to get the VHD files (virtual machine harddrives) off of the RAID array but the tools I would use to mount them do not work as they say the file could be corrupted. I cannot use the Windows-based utilities as they only recognize NTFS formatted partitions and as such I cannot recover any files with those tools.

    Does anyone know or have experience with recovering or accessing VHD files in Linux?

    The ideal scenario would be if I can somehow mount these drives in a Gentoo or other Linux-based OS which I could then try and recover files with. Even if the files don’t mount is there a tool that can scan drives mounted in Linux for recoverable files?

    Thank you for your time.

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,008
    Hmm, if Hyper-V says that the file it wrote is corrupt then there is a chance that this is indeed so.
    Independent on what filesystem is inside.

    But what you can try is to use a copy of that vhd with e.g. VirtualBox or Vmware.
    Both are able to read vhds.

    For more finegrained control, you could also use one of the virtualbox tools directly:
    Ubuntu Manpage: vdfuse - x86 virtualization solution
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Jul 2009
    Posts
    8
    Quote Originally Posted by Irithori View Post
    Hmm, if Hyper-V says that the file it wrote is corrupt then there is a chance that this is indeed so.
    Independent on what filesystem is inside.

    But what you can try is to use a copy of that vhd with e.g. VirtualBox or Vmware.
    Both are able to read vhds.

    For more finegrained control, you could also use one of the virtualbox tools directly:
    Ubuntu Manpage: vdfuse - x86 virtualization solution
    Thanks so much. Let's say that the vdfuse app mounts the drive or partition but then says that files are unreadable. On Windows there is a tool called Recuva that can do a deep scan and find files for you.

    Is there such a thing on Linux?

    Thanks.

  4. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,008
    I am just guessing, as the results depend on the state of that vhd.
    (Again: I would only work with a copy of that vhd.)

    But if vdfuse can read the vhd, then it will expose the disk and its partitions as files.
    These files can be loopmounted.
    This mount will already tell if the filesystem needs checks or not. (If the mount succeeds at all)

    Say, the mount was sucessful:
    I would first try to copy everything important out of the mountpoint(s).
    If there are errors, then you can unmount and use fsck on the disk/partition files.
    You must always face the curtain with a bow.

  5. #5
    Just Joined!
    Join Date
    Jul 2009
    Posts
    8
    OK, thanks. Fingers crossed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •