VMware Cloud Community
reichhartkg
Contributor
Contributor

Recover deleted vmdk files?

I accidentally deleted four vmdk files that I absolutely need to recover.  What are my options?

19 Replies
BjornSH
Enthusiast
Enthusiast

If it is just the vmdk files and not the flat-vmdk files you have deleted, the it is possible to recreate them using the step-by-step guide from KB1002511 ( http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100251... ).

If you deleted the flat file, then you will have to restore from backup.

0 Kudos
continuum
Immortal
Immortal

are the vmdks thick provisioned ?
if yes I may be able to help - if they are thin provisioned call Ontrack


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

0 Kudos
antunesd
Contributor
Contributor

Mine were. Can you help, please?

0 Kudos
einstein-a-go-g
Hot Shot
Hot Shot

We have good success using VMFS Recovery from Disk Internals.

Recover Data from VMFS, ESX, ESXi, vSphere Disks

0 Kudos
KawasakiVM
Contributor
Contributor

Dear einstein

It wasn’t working totally, are you sure
it was working in vmware esxi 5.1 or new?

@ did anyone try it ? , please share the infomation, thanks you.

0 Kudos
continuum
Immortal
Immortal

I would try vmfs-fuse first - thats a free tool available for Linux.
In my recovery work I occasionally check what Diskinternals or UFS-explorer would be able to recover - but I do not remember a single case where we actually used one of them.

When the deleted vmdks were thick provisioned and the datastore was not too full I use a manual procedure to extract those vmdks.


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

0 Kudos
KawasakiVM
Contributor
Contributor

Dear continuum-san,

Thanks your feedback,

I re-try the Diskinternals as you mentioned.

Now it is working in W2K8R2, but the progress is so lazy only 4% for every
5hours.Smiley Sad

it still is scanning disk, maybe my disk was too big to recovery.

0 Kudos
admin
Immortal
Immortal

I would like to share the best third party tool which let you recover your data from deleted, formatted or lost VMDK files/folders or partition. Using this VMDK recovery software [Moderator edit: Removed spam link] one can easily get its important VMware files (created under NTFS/FAT file systems).

0 Kudos
KawasakiVM
Contributor
Contributor

Dear Anglina-san,

Thank you for your kindness, but I already gave up to recovery date.

0 Kudos
ballaflex
Contributor
Contributor

hello

i'm looking the best way to recover vmdk file from ESXi 3 datastore ,for your info i have vmfs recovery , ontrack easy recovery enterprise 11

Best regard

0 Kudos
alex3518
Contributor
Contributor

Firts be sure that you make a copy of files, what you want to delete, it is nclear, but sometimes it is be deleted in reccycle bin, and sometimes just go who knows where and cannot be recoverd !!!

So make a copy of each file you want to delete and better use option move it in (recycle bin, or where you want, you have this option in most windows boost software as auslogics boot speed (not free, but you habe it in torrents) or just add that keys to enable this in right click menu cotext:see attachnents !!!

0 Kudos
alex3518
Contributor
Contributor

Firts be sure that you make a copy of files, what you want to delete, it is nclear, but sometimes it is be deleted in reccycle bin, and sometimes just go who knows where and cannot be recoverd !!!

So make a copy of each file you want to delete and better use option move it in (recycle bin, or where you want, you have this option in most windows boost software as auslogics boot speed (not free, but you habe it in torrents) or just add that keys to enable this in right click menu cotext:see attachnents !!!

and see

11.  Re: Recover deleted vmdk files?

or just for you agin add it to right click context meny only wit this;

0 Kudos
admin
Immortal
Immortal

The best option is using a snapshot you've saved earlier. Virtual machine provides you a feature for saving snapshot, so that you can recover data if any problem or issue takes place. If there's nothing like that, you must try VMDK Recovery software to recover files from VMDK. The blog post shared below contains a very useful information regarding this. You must read the blog post.

[Moderator edit: Removed spam link.]

I hope this would be helpful here.

Regards.

0 Kudos
admin
Immortal
Immortal

Want to recover deleted VMDK files then go for the Best VMDK recovery software [Moderator edit: Removed spam link] with the help of which you can easily recover your deleted VMDK files in no time. The manual process is also available but everyone can not process it and can lose your data permanently. This software provides you the efficient features like three scanning modes, the most important feature of the software that helps to recover the deleted VMDK file easy and many more. The free version is also available.

0 Kudos
RajeevVCP4
Expert
Expert

If you have flat.vmdk file then you can recover vmdk file by creating descriptor file.

Here is the process

Detailed steps

To create a virtual machine disk:

  1. Log in to the terminal of the ESXi/ESX host
  2. Navigate to the directory that contains the virtual machine disk with the missing descriptor file using the command:

    # cd /vmfs/volumes/myvmfsvolume/mydir

    Notes:
    • If you are using a version of ESXi, you can access and modify files and directories using the vSphere Client Datastore Browser or the vifs utility included with the vSphere CLI. For more information, see the section Performing File System Operations in the vSphere Command-Line Interface Documentation.
    • If you are using VMware Fusion, the default location for the virtual machine files is the home/Documents/Virtual Machines.localized/virtual_machine/ folder, where home is your home folder, and virtual_machine is the name of the virtual machine.

  3. Identify the type of SCSI controller the virtual disk is using by examining the virtual machine configuration file (.vmx ). The controller is identified by the line scsi#.virtualDev , where # is the controller number. There may be more than one controller and controller type attached to the virtual machine, such as lsisas1068 (which is the LSILogic SAS controller), lsilogic , or buslogic . This example uses lsilogic :

    scsi0.present = "true"
    scsi0.sharedBus = "none"
    scsi1.present = "true"
    scsi1.sharedBus = "virtual"
    scsi1.virtualDev = "lsilogic"



  4. Identify and record the exact size of the -flat file using a command similar to:

    # ls -l vmdisk0-flat.vmdk

    -rw------- 1 root root 4294967296 Oct 11 12:30 vmdisk0-flat.vmdk



  5. Use the vmkfstools command to create a new virtual disk:

    # vmkfstools -c 4294967296 -a lsilogic -d thin temp.vmdk

    The command uses these flags:

    • -c size

      This is the size of the virtual disk.

    • -a virtual_controller

      Whether the virtual disk was configured to work with BusLogic, LSILogic (for both lsilogic and lsilogic SAS), Paravirtual, or IDE:
      Use lsilogic for virtual disk type "lsilogic" and "lsisas1068"

    • -d thin

      This creates the disk in thin-provisioned format.
    Note: To save disk space, we create the disk in thin-provisioned format using the type thin . The resulting flat file then consumes minimal amounts of space (1 MB) instead of immediately assuming the capacity specified with the -c switch. The only consequence, however, is the descriptor file contains an extra line that must be manually removed in a later step.

    The temp.vmdk and temp-flat.vmdk files are created as a result.


  6. Delete temp-flat.vmdk , as it is not needed. Run the command:

    # rm -i temp-flat.vmdk


  7. Rename temp.vmdk to the name that is required to match the orphaned .flat file (or vmdisk0.vmdk , in this example):

    # mv -i temp.vmdk vmdisk0.vmdk


  8. Edit the descriptor file using "vi" text editor ( vi vmdisk0.vmdk, in this example)

    1. Under the Extent Description section,

      • Use command "Shift + r" to enter replace mode.
      • Locate and change the name of the .flat file to match the orphaned .flat, Press "Esc" to exit replace mode.
    2. Find and remove the line ddb.thinProvisioned = "1" if the original .vmdk was not a thin disk. If it was, retain this line. Use command "Shift + zz" to save and exit "vi" editor.


      # Disk DescriptorFile
      version=1
      CID=fb183c20
      parentCID=ffffffff
      createType="vmfs"

      # Extent description
      RW 8388608 VMFS "vmdisk0-flat.vmdk"

      # The Disk Data Base
      #DDB

      ddb.virtualHWVersion = "4"
      ddb.geometry.cylinders = "522"
      ddb.geometry.heads = "255"
      ddb.geometry.sectors = "63"
      ddb.adapterType = "lsilogic"
      ddb.thinProvisioned = "1"


      The virtual machine is now ready to power on. Verify your changes and ensure Disk chain is consistent before starting the virtual machine.

  9. To check the disk chain for consistency, run this command against the disk descriptor file:

    For ESXi 6.0 and 5.x:

    # vmkfstools -e filename.vmdk

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10025...

Rajeev Chauhan
VCIX-DCV6.5/VSAN/VXRAIL
Please mark help full or correct if my answer is use full for you
0 Kudos
continuum
Immortal
Immortal

Hi Rajev

The procedure you posted looks like you just copied some lines from the knowledgebase.
Unfortunately doing it like this is neither the fastest, nor the smartest nor the best way to do it.
IMHO this KB should be deleted.
I do not support doing it like this as it is based on guesswork and can make matters worse.
Anyway - posting this in this context is not helpful.
Regards
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 ...

0 Kudos
continuum
Immortal
Immortal

> Want to recover deleted VMDK files then go for the Best VMDK recovery software [Moderator edit: Removed spam link] with the help of which you can easily recover your deleted VMDK files in no time.
I wonder why you post this in the vSphere-forum ?
The software you mentioned is completely useless for any scenario that is about recovering deleted vmdks from a vSphere-datastore.
If you are interested in advertising your product you should know this yourself.
If you are posting this as a normal user you should have noticed this in your first attempt of using this tool.
If you post this because you just heard about somebody that has heard about a case ... sorry - that is not helpful for any user that reads this post.
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 ...

0 Kudos
RajeevVCP4
Expert
Expert

In this forum, if any body post the question/query then we can reply with appropriate answer, Is it this tool (Best VMDK recovery software) recommended by vmware ?

I am not advertising any product here , we are here share our knowledge , that's why I gave also KB along with my answer.

edit wila: Removed spam link, do not repost a link previously removed by another moderator please!

Rajeev Chauhan
VCIX-DCV6.5/VSAN/VXRAIL
Please mark help full or correct if my answer is use full for you
0 Kudos
mackjohn
Contributor
Contributor

If your .vmdk file deleted from your storage device. Then you have to recover it by using any trusted recovery software. I found most of the above replies are suggesting to use vmdk data recovery software. Its wrong, your file is deleted from storage device so you need an HDD recovery software. I also faced the same kind of situation and I used SysTools Hard Drive Data Recovery Software and recovered all type data. Also, the SysTools provides hard drive recovery and VMDK Data Recovery in the bundle.

0 Kudos