VMware Cloud Community
pe7er
Contributor
Contributor

repair corrupt flat.vmdk files?

is there a way to repair corrupt flat.vmdk files ?

the files cannot be opened i always get the  the error message "invalid arguments"

10 Replies
vNEX
Expert
Expert

Hi,

If you want to open VMDK (virtual machine disk) format to access the data you have to open descriptor file <vnname>.vmdk which defines the structure/geometry of the <vnname>-flat.vmdk (which stores just a raw data).

It can happen that the descriptor gets corrupted ... for the recovery follow these steps:

VMware KB: Recreating a missing virtual machine disk descriptor file

Another issue could be caused by missing descriptor files for delta disks (snapshots) i.e. when snapshot chain is broken/corrupted, for more info see:

VMware KB: Recreating a missing virtual disk (VMDK) descriptor file for delta disks

VMware KB: Resolving the CID mismatch error: The parent virtual disk has been modified since the chi...

Also have a look at these sources:

VMware KB: Cannot power on a virtual machine because the virtual disk cannot be opened

VMware KB: Verifying ESX/ESXi virtual machine file integrity  

_________________________________________________________________________________________ If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons) Regards, P.
vlho
Hot Shot
Hot Shot

Hi,

If you have corrupt "main" vmdk file you can try (after backup) command vmkfstool with parametr -fix.

More information can be found here:

http://www.virtuallyghetto.com/2010/07/vsphere-41-is-gift-that-keeps-on-giving.html

Reply
0 Kudos
continuum
Immortal
Immortal

Sounds like you either really have a vmdk descriptor which uses invalid arguments - or that there is heartbeat corruption in the VMFS headers.
Another reason maybe that the file is locked and you cant open it because of the lock.

It maybe possible to read the vmdk by using a ESXi LiveCD or a newly installed ESXi to USB-stick.
The important part is to use a ESXi that sees the datastore for the very first time.

If you cant try that - try to read the datastore with Linux using vmfs-fuse (only helps when the flat.vmdk is not larger than 256 Gb.

If that does not work either - try to read the vmdk without the help of the VMFS headers using dd like
dd if=/dev/disks/naa.*:1 of=/vmfs/volumes/otherdatastore/unreadable-flat.vmdk bs=1M count=<size of flat.vmdk in MB> skip=<offset of vmdk relative to vmfs-partition start>

flat.vmdks actually are nothing but a very large number of 1mb files - so they usually do not get corrupt.
Only thing that can get corrupt are the pointers in the VMFS headers


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
pe7er
Contributor
Contributor

how can i get the value of "skip=<offset of vmdk relative to vmfs-partition start>" ??

Reply
0 Kudos
continuum
Immortal
Immortal

easiest way: vmkfstools -t0 <vmdk descriptor>


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
vNEX
Expert
Expert

pe7er if your issue applies to more than one file on the datastore you are probably facing VMFS header/metadata corruption...

To proof this I would recommend you to perform system metadata check using VMware VOMA tool:

VMware KB: Using vSphere On-disk Metadata Analyzer (VOMA) to check VMFS metadata consistency  

If your VMFS datastore is in good condition the final output should look similar to this one:

image_png.png

If you will see any errors I would strongly recommend you to contact VMware Support and file SR ... especially if its production environment.

They will need to collect some metadata dumps from your VMFS volume.

To be prepared for this you can read this KB article:

VMware KB: Collecting and applying raw metadata dumps on VMFS volumes using DD (Data Description)

Good Luck!

_________________________________________________________________________________________ If you found this or any other answer helpful, please consider to award points. (use Correct or Helpful buttons) Regards, P.
Reply
0 Kudos
akha666
Contributor
Contributor

I have the issue and didn't found any help

Reply
0 Kudos
continuum
Immortal
Immortal

If you still need help - call me via skype "sanbarrow"
I have  had good results with these types of errors ...


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
continuum
Immortal
Immortal

> brilliant virtual machine data recovery tool which can istantly recover your vmdk data without any hassle.
I assume you made this post because you are somehow involved with the company you mentioned.
Actually one of the biggest mistakes done by users with corrupted vmdks on the ESXi platform is using tools that cant do the job.
This will waste lots of time and often makes matters worse.
The tool you advertise here may indeed be able to work with virtual disks from VirtualBox, VMware Workstation or Virtual PC.
But that is NOT what is needed here !!!
To be useful for the ESXi platform a recovery tool needs the following features:
- read VMFS 3, 5 and 6
- offer a way to remotely mount / connect to a ESXi host
- be smart enough to handle errors in the VMDK - to VMFS mapping table that is stored in the VMFS-volume
After a quick check of the website you mentioned "your" tool appears to be unable to handle any of those needs.
Your boss should ask you to handle all the support requests by angry users who bought/tiried an inappropriate because of your advertising.
For anybody reading this who actually needs a tool that CAN do the job:
at the moment I am only aware of 2 commercial tools that are worth mentioning for ESXi-support:
UFSexplorer and Diskinternals.
The demands for  a the vSphere platform are significantly different from the demands for the Windows-platform.
Just being able to read VMDKs on the hosted platforms is by far not good enough to make it into the list of useful tools.
Ulli


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
BingyBam
Contributor
Contributor

There is actually a seriously good solution to your problem. I used this program a while back when I had a corrupt VMDK file. To repair a VMDK corrupt file you can add a disk to VM and specify to use existing .vmdk file. https://www.diskinternals.com/vmfs-recovery/repair-vmdk-files/ You will know what I mean, the guide will be better for explaining than me.

Reply
0 Kudos