VMware Communities
biswamitRS
Contributor
Contributor

vmdk has one or more internal errors that cannot be fixed. No backup copy. Need help in restoring

vmdk has one or more internal errors that cannot be fixed. No backup copy kept.

biswamitRS_0-1637307246903.png

 

Need help in restoring

Tried vmware-vdiskmanager.exe -R "D:\Biswamit\VM\ePODevWin10\ePODevWin10.vmdk" and it gives the following error

VixDiskLib: Failed to initialize PhoneHome library.
The virtual disk, 'D:\Biswamit\VM\ePODevWin10\ePODevWin10.vmdk', is corrupted and cannot be repaired.

PLEASE HELP

Using VMWare Workstation 

biswamitRS_0-1637307329243.png

O/P of dir *.* > filelist.txt 

Volume in drive D is Data
Volume Serial Number is 16C3-DBBB

Directory of D:\Biswamit\VM\ePODevWin10

19-Nov-21 01:35 PM <DIR> .
19-Nov-21 01:35 PM <DIR> ..
09-May-18 03:48 PM <DIR> caches
17-Nov-21 11:46 AM 8,684 ePODevWin10.nvram
19-Nov-21 12:03 AM 297,834,512,384 ePODevWin10.vmdk
15-Sep-17 10:49 AM 0 ePODevWin10.vmsd
19-Nov-21 12:03 AM 4,905 ePODevWin10.vmx
19-Nov-21 12:01 PM <DIR> ePODevWin10.vmx.lck
23-Oct-20 01:33 AM 3,854 ePODevWin10.vmxf
19-Nov-21 01:35 PM 0 filelist.txt
19-Nov-21 12:38 PM 791,988 vmware-0.log
19-Nov-21 12:01 PM 792,706 vmware-1.log
19-Nov-21 11:53 AM 791,987 vmware-2.log
19-Nov-21 01:18 PM 791,984 vmware.log
10 File(s) 297,837,698,492 bytes
4 Dir(s) 213,927,682,048 bytes free

Reply
0 Kudos
12 Replies
a_p_
Leadership
Leadership

This doesn't look good at all, and restoring the VM from the latest backup may be something to consider.

If you don't have any recent backups, extract the attached .zip archive into an empty folder, and drag&drop the VM's .vmdk file onto the .cmd file. Then compress/zip the newly created "Metadata" files, and attach the .zip archive to your next reply.
I can't promise you anything, but I will take a closer look at the metadata if you want.

What would be interesting to know, is whether something happened that may have caused the corruption, like a power loss, system crash, a failed attempt to compact/shrink the VM, ...

André

Reply
0 Kudos
biswamitRS
Contributor
Contributor

Attaching the Metadata files

Reply
0 Kudos
biswamitRS
Contributor
Contributor

I saw few of your( a_p_) replies VMware-Workstation-Pro/The-disk-has-one-or-more-internal-errors-that-cannot-be-fixed and VMware-Workstation-Pro/The-disk-D-win10ProVM-Windows-10-vmdk-has-one-or-more-internal  earlier and from that taken a backup copy of the VM. Plus tried the following:-

fsutil file seteof ePODevWin10.vmdk 297834512384
dsfi.exe "ePODevWin10.vmdk" 0 13172736 "Metadata-ePODevWin10-297834512384.bin"

Unfortunately it didn't work. Not really sure if the same commands will work here in this case.  a_p_ please do let me know

 

Reply
0 Kudos
a_p_
Leadership
Leadership

It's not the commands which fix the issue, it's the metadata itself (what you've exported) that needs to be fixed.

However, in this case it looks like a cleanup/shrink process was killed in the middle of nowhere, so that the metadata contains thousands of errors now. It may be possible to manually modify the metadata (which would likely take a few hours already), so that  the virtual disk will be recognized as such, but it's close to impossible to really fix the metadata to recover all data.

André

biswamitRS
Contributor
Contributor

a_p_ yeah I was trying all means and so gave a shot with the commands. Yeah I do see lot of GT Errors in vmware.log. There was 1-2 instances of the host(where the VM was residing) shutting down due its own issue. But as far as I know it did not shutdown in the middle of any clean/shrink process.  Anyways Is there a way we can recover the metadata or vmdk by which the VM can start or is there any way the data that's inside can be recovered. What's your recommendation ? 

Reply
0 Kudos
a_p_
Leadership
Leadership

Ok, I modified the metadata, so that the virtual disk should be recognized.
That said, I just made required modifications to fix the holes, duplicated, grain table inconsistencies, ..., so expect some file system corruption.

To fix the metadata, use e.g. dsfi.exe to inject/overwrite the .vmdk file's metadata with the modified version in the attachment.

dsfi.exe "ePODevWin10.vmdk" 0 55967744 "Metadata-ePODevWin10-297834512384-modified.bin"

I assume that in the meantime you've backed up the .vmdk file. Anyway, to avoid modification to the file due to the corruption, I'd suggest that you either mount the virtual disk to the host in read-only mode, or at least take a snapshot if you want to try and power on the VM.

André

biswamitRS
Contributor
Contributor

a_p_ So its just the dsfi on the modified metadata or do I have to set the EOF by "fsutil file seteof" with the size 297834512384

For a try as of now based on your suggestion, let me try the dsfi commands with the modified metadata. Will keep you updated.

Advance thanks for the help/guidance till now

 

Reply
0 Kudos
a_p_
Leadership
Leadership

There's no need to modify the file size in this case. I modified the metadata so that it matches the current file size.
Just inject the modified metadata.

André

biswamitRS
Contributor
Contributor

Tried the dsfi command as mentioned

1st time: It made the VM boot Bingo!!!!! from an external hard drive. So happy to see it. I checked the data and it looks that most of the data(apart from few bits and pieces) are intact. It gave me a relief and post which I tried shutting it down and this is where it just hanged. Not sure what's went wrong. VM never shutdown and it complained in shutdown process saying "Disk not defragged appropriately" . I had to literally force kill it. No other means of killing it actually worked and I had to forcefully shutdown the host machine

2nd time : But then as another try, this time, I took another copy of it and then tried the command on the actual vmdk in the main host machine(not in any copied version of it I mean). Now as its running fine and data intact. So as safety and the 1st step I am gonna copy the important data before I choose to shut it down.

Post copying of data and I will choose to shutdown and let see how it goes

I will keep you updated. 

a_p_ you really came as a savior. BTW is there any tool which is available and which can be used to rectify the metadata based on log entries  and GT error etc. If that's there please let me know. I will keep that handy for immediate remediation of it. 

Reply
0 Kudos
a_p_
Leadership
Leadership

The vmware-vdiskmanager utility that comes with VMware Workstation is able to fix some issues.
Some commercial tools claim that they are able to recover data from corrupted .vmdk files (even VMware Workstation .vmdk formats). However, I created my own tools/scripts that will show me the issues, but do not fix things automatically.

André

 

biswamitRS
Contributor
Contributor

vmware-vdiskmanager utility is of no use. Probably your scripts in a way does a quite a good job and at least started the VM and now I am in the mindset of get data from it. Thanks a lot

Reply
0 Kudos
HerkDriver
Contributor
Contributor

Andre

I am having the exact same issue on a VM.  Mine lost power during a compact and corrupted.  hoping to be able to boot the VM again and salvage what i can.  any help appreciated.

Reply
0 Kudos