Steps to recover a .vmdk file from flat.vmdk file


VMware instructs restoring the missing descriptor file from a backup but if it is not possible, we would then recreate the virtual machine file descriptor file. Now let’s see the solution to recover.vmdk files from flat.vmdk file:

1.    Login to connect ESXi host command line as root using SSH

2.    Navigate to the datastore where the flat.vmdk is stored using the following command:

cd /vmfs/volumes/DATASTORE_NAME/VM_NAME

3.    Now check the list of files and make a note of the actual size of the -flat file

ls -l vmdisk0-flat.vmdk

4.    To create a new .vmdk files, run the vmkfstools command.

# vmkfstools -c (Size of the file) -d thin temp.vmdk

As a result, the files temp.vmdk and temp-flat.vmdk will be created.

5.    Now we can delete temp-flat.vmdk since it is no longer required. Then run the below command:

rm -i temp-flat.vmdk

6.    Rename the temp.vmdk to the required name to match the original VM name.vmdk

mv -i temp.vmdk orignalvmname().vmdk

7.    Then edit the originalvmname.vmdklook for the line “RW, and you can replace it with file temp.vmdk to originalvmname.vmdk”.

8.    Power up the VM and verify to see whether it boots perfectly.

You can also check: Fix Cloudflare Error 524

To get more updates you can follow us on Facebook, Twitter, LinkedIn

Subscribe to get free blog content to your Inbox