Jump to content











Photo

How to Fix/Mount Corrupted WIN10.vhdx file and recover files for free ?

vhdx vhdxtool.exe vhdtool.exe

  • Please log in to reply
7 replies to this topic

#1 devdevadev

devdevadev

    Frequent Member

  • Advanced user
  • 477 posts
  •  
    India

Posted 22 January 2019 - 06:11 PM

I use 40GB Dynamic Expanding "WIN10.vhdx" as regular Windows 10 to Go in my 128GB Sandisk Extreme Pro E2B USB Drive. Few days back I was running WTG10 from my USB, Suddenly it hang and freezes. When I try to boot again from WIN10.vhdx, It was not booting while 4-5 GB free space was still left. When I checked in Gparted then I found that File System of USB Drive was showing corrupted

 

Attached File  1.jpeg   72.81KB   0 downloadsAttached File  2.jpeg   93.91KB   0 downloads

 

and Windows was also unable to detect USB and Windows/WinPE environment hang every time when i connect USB Drive. Finally I recovered all my files using Gparted + Testdisk combination. 

 

But when I tried to mount WIN10.vhdx in Windows 10, then getting "Disk image file is corrupted" error. When I tried demo version of SysInfoTools VHDX Recovery ,then I can see all my files but unable to recover.   

 

 
It's looking there was a free Microsoft vhdtool.exe (may be also vhdxtool.exe ?) that includes a "repair" function which is designed to undo an expand operation on a base VHD when differencing VHDs are present.
 
Does anybody know where I can get access vhdxtool.exe with "repair" function ? Please help.....
 
Will be nice if all free ways will be suggested. I have also tried powershell commands in above links but does'nt seems to work in Windows 10 ? Should I try powershell command in Windows 7 in order to fix and mount vhdx file ?
 
Had anyone created free tool to fix corrupted VHDX for free ? 
 
Regards.... 


#2 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 22 January 2019 - 07:11 PM

Hi,

 

Have you considered that it may not be the "container" which is corrupted but the actual filesystem itself within that "container" ?

 

Regards,

Erwan



#3 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15108 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 January 2019 - 07:59 PM

One (among a few other ones) reasons why Wonko the Sane tends to use (and suggest) the use of .VHD (and not .VHDX) and the use of the "static" type only (and NEVER "dynamic") is to be able to say "see, I had told you" when this kind of corruption - unfortunately - happens.

 

It is possible (not necessarily true, but possible) that the "dynamic" nature of the .vhdx file (more than the use of the .vhdx format as opposed to the use of the .vhd one is part of the issue).

 

Anyway, there was NO corruption of the filesystem :w00t: in the sense that TESTDISK can fix partitioning problems and marginally and as a side effect some (a very small number of) problems related to the filesystem whilst GPARTED can fix NO filesystem problems at all, so whatever you did with TESTDISK and GPARTED was related to the partitioning or - at the most - to the bootsector ($Boot and/or $BootMirr).

 

More or less the ONLY tool able to actually fix errors in the filesystem (a NTFS filesystem) is CHKDSK.

 

So, if the issue is on the "outer" filesystem (i.e. the NTFS in the Volume on the USB stick) you can run CHKDSK on it just fine, but if the issue is on the "inner" filesystem (the NTFS in the vhdx) you will need *something* capable of mounting the .vhdx to a volume and then run the CHKDSK on that "virtual" volume.

No idea if the built-in Windows "native" drivers would allow this, I guess it depends on the kind of corruption the .vhdx has. :ph34r:

 

:duff:

Wonko



#4 devdevadev

devdevadev

    Frequent Member

  • Advanced user
  • 477 posts
  •  
    India

Posted 22 January 2019 - 08:54 PM

So, if the issue is on the "outer" filesystem (i.e. the NTFS in the Volume on the USB stick) you can run CHKDSK on it just fine, 

40GB WIN10.vhdx is within corrupted 128GB USB Drive. USB Drive was not showing even in Disk mgmt then how I would use CHKDSK on USB Drive without Drive Letter ? Testdisk in Windows was also not detecting USB Drive. So I have to used linux version of Testdisk.

 

BTW, I have recovered all files within from 128GB USB Drive using Gparted -> Testdisk . Can anybody guess what is exact problem in USB Drive due to which it is mounting/detecting neither in Windows nor in Linux. But Linux Testdisk allow to list all files within USB Drive and successfully recovered all files in another USB-HDD.

 

attachicon.gif 1.jpegattachicon.gif 2.jpeg

Does above screenshot give any info about what exactly corrupted in USB Drive ? Will it be possible be fix USB without formatting and data loss ?     

 

I had successfully recovered WIN10.vhdx file within from corrupted USB Drive using Linux Testdisk. But can't open/mount neither using Disk mgmt nor using 7-zip. But I can see all my files using SysInfoTools VHD Recovery Software Demo version . It mean files are still safe and exist within corrupted WIN10.vhdx file. But how can I recovered all my files within from it ? or can fix WIN10.vhdx itself so that can mount it and access all files once again as usual ? 

 

but if the issue is on the "inner" filesystem (the NTFS in the vhdx) you will need *something* capable of mounting the .vhdx to a volume and then run the CHKDSK on that "virtual" volume.

Yes, mounting corrupted WIN10.vhdx is the main problem now. Does vhdxtool.exe exist as archives anywhere so that I can try "repair" function ? Any other free tool will be also useful if exist.....  

 

Why following script does not seems to work within from Windows 10 ? Should I have to use Win 7 or Server to use it ?

 

VBScript:

Option Explicit

Dim WMIService

Dim VHDService

Dim VHD 

 

'Specify the VHD to be mounted

VHD = "E:\WIN10.vhdx"

 

'Get instance of 'virtualization' WMI service on the local computer

Set WMIService = GetObject("winmgmts:\\.\root\virtualization")  

 

'Get the MSVM_ImageManagementService

Set VHDService = WMIService.ExecQuery("SELECT * FROM Msvm_ImageManagementService").ItemIndex(0) 

 

'Mount the VHD

VHDService.Mount(VHD)

 

PowerShell:

#Specify the VHD to be mounted

$VHDName = "E:\WIN10.vhdx"

 

#Get the MSVM_ImageManagementService

$VHDService = get-wmiobject -class "Msvm_ImageManagementService" -namespace "root\virtualization" -computername "."

 

#Mount the VHD

$Result = $VHDService.Mount($VHDName)

 

Have you considered that it may not be the "container" which is corrupted but the actual filesystem itself within that "container" ?

Are you talking about Corrupted USB or corrupted VHDX within corrupted USB ? Please tell me detailed info about how you fix/repair corrupted VHDX file to recover it's files ?  



#5 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15108 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 23 January 2019 - 08:27 AM

I will repeat this (just in case):

BOTH TESTDISK and GPARTED work/operate/know/can in some cases fix volumes or partitions on a disk NOT filesystems.

So, if you recovered anyrthing the issue was primarily related to the volume or partition.

 

And AGAIN, the filesystem can be checked (and repaired in some cases) by CHKDSK (and pretty much nothing else).

 

Try this (no idea if it works, no guarantee of it doing anything):

https://sourceforge....ts/vhdx-viewer/

 

:duff:

Wonko



#6 devdevadev

devdevadev

    Frequent Member

  • Advanced user
  • 477 posts
  •  
    India

Posted 24 January 2019 - 02:43 AM

Try this (no idea if it works, no guarantee of it doing anything):

https://sourceforge....ts/vhdx-viewer/

Attached File  Preview.png   68.46KB   0 downloads

 

It show all files within VHDX file but no option for copy/recovery. May be paid version needed for recovery ?

Will be nice if I can fix VHDX itself so that can mount in File Explorer and then can retrieve my personal files....



#7 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15108 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 24 January 2019 - 09:07 AM

I have no experience with .vhdx, let alone dynamic ones, from what I read here and there) they are not (much) different from any other virtual disk format, see here:

https://www.altaro.c...ing-vhdx-files/

 

IF (and only IF) the above is - even remotely - accurate, there is - bar the headers (and possibly a footer) - a rather plain disk image inside it.

 

Again IF this is the case, a "plainer" data recovery tool such as DMDE may be able to find the volume inside it and allow to recover the files from inside it.

 

DMDE (Commercial but with a Free Edition that is almost fully functional) is NOT a tool intended for the "casual user", however, trying it to see if it can find the volume costs nothing, so it is IMHO worth a try: 

https://dmde.com/

 

The other software I would try would be Isobuster (Commercial, but way cheaper than the other tools):

https://www.isobuster.com/

but again it is an exceptionally good tool that is not a simple "click here and go" type.

(this latter also seemingly sports support for VHD and VHDX).

 

Personally I use the same stick I use to NOT touch Vista to NOT touch any software made by Nucleus, Systools or Kernel, besides the dubious (in my experience) quality of their software, their marketing/SEO (including posting demos on Sourceforge with false statements like you have just experienced) makes me avoid them.

 

Another thing you may try is to convert a copy of the .vhdx to RAW via qemu-img:

https://cloudbase.it/qemu-img-windows/

https://qemu.weilnetz.de/

and see if it "goes through".

 

:duff:

Wonko



#8 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 24 January 2019 - 10:14 PM

7-zip should be able to open vhdx files (works over here).

 

Although I'd vote for qemu-img too.

 

On a hyper-v server with powershell, you can also convert the vhdx back to a vhd : Convert-VHD -Path "e:\folder\disk.vhdx" -DestinationPath "e:\folder\disk.vhd" or Convert-VHD -Path "e:\folder\disk.vhdx" -DestinationPath "e:\folder\disk.vhd" -VHDType fixed

 

Starwind converter could help as well (free if not mistaken).







Also tagged with one or more of these keywords: vhdx, vhdxtool.exe, vhdtool.exe

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users