ESX Virtualization

VMware ESXi, vSphere, VMware Backup, Hyper-V... how-to, videos....

Nakivo Backup and Replication - #1 Backup solution for Virtual, physical, cloud, NAS and SaaS

Menu
  • Certification
      • VCP-DCV vSphere 8
          • vcp2024-125.
        • Close
    • Close
  • VMware
    • Configuration Maximums
    • vSphere
      • VVF 9 and VCF 9
      • vSphere 8.0
      • vSphere 7.0
      • vSphere 6.7
      • vSphere 6.5
      • vSphere 6.0
      • Close
    • VMworld
      • VMware EXPLORE 2024
      • VMware EXPLORE 2023
      • VMware EXPLORE 2022
      • VMworld 2019
      • VMworld 2018
      • VMworld 2017
      • VMworld 2016
      • VMworld 2015
      • VMworld 2014
      • VMworld 2013
      • VMworld 2012
      • VMworld 2011
      • Close
    • Close
  • Microsoft
    • Windows Server 2012
    • Windows Server 2016
    • Windows Server 2019
    • Windows Server 2025
    • Close
  • Categories
    • Tips – VMware, Microsoft and General IT tips and definitions, What is this?, How this works?
    • Server Virtualization – VMware ESXi, ESXi Free Hypervizor, VMware vSphere Server Virtualization, VMware Cloud and Datacenter Virtualization
    • Backup – Virtualization Backup Solutions, VMware vSphere Backup and ESXi backup solutions.
    • Desktop Virtualization – Desktop Virtualization, VMware Workstation, VMware Fusion, VMware Horizon View, tips and tutorials
    • How To – ESXi Tutorials, IT and virtualization tutorials, VMware ESXi 4.x, ESXi 5.x and VMware vSphere. VMware Workstation and other IT tutorials.
    • Free – Free virtualization utilities, ESXi Free, Monitoring and free backup utilities for ESXi and Hyper-V. Free IT tools.
    • Videos – VMware Virtualization Videos, VMware ESXi Videos, ESXi 4.x, ESXi 5.x tips and videos.
    • Home Lab
    • Reviews – Virtualization Software and reviews, Disaster and backup recovery software reviews. Virtual infrastructure monitoring software review.
    • Close
  • Partners
    • NAKIVO
    • StarWind
    • Zerto
    • Xorux
    • Close
  • This Web
    • News
    • ESXi Lab
    • About
    • Advertise
    • Archives
    • Disclaimer
    • PDFs and Books
    • Close
  • Free
  • Privacy policy

Recreate a missing VMDK header file

By Vladan SEGET | Last Updated: November 1, 2014

Shares

If your VMDK file is lost. How do I found out? It's simple, if you don't see your usual vmdk file through the VI browser, and you see some kind of file with yourfile-flat.vmdk, then you lost your descriptor file.

Then it happens that your VM does not want to start. Sure, you can restore from your yesterday's backup. But, if, for X reasons your last backup is like a week old or so and you do not want to loose the delta of your work, than the next several lines could be crucial for you…

In this example 2003srvis the name of the virtual machine, 2003srv.vmdk was the name of the descriptive file, and 2003srv-flat.vmdk as the content, or -flat file. Now you can actually see the 2003srv-flat.vmdk file throught your VI client's browser datastore. Your file you need to recreate is 2003srv.vmdk

To create a descriptive file (I suppose that the disk was thin provisioned) :

1. Login to console with putty. You have to enable SSH first (if not the case already).
2. Run this command:

# cd /vmfs/volumes/myvmfsvolume/mydir

3. Run this command to identify and record the exact size of the flat file:

# ls -l vm-vCenter-flat.vmdk

vmkfstools

4. run the vmkfstools and create new virtual disk

# vmkfstools -c 85921274880 -d thin -a lsilogic temp2.vmdk

vmkfstools2

5. Like this there are 2 new files created:  temp2.vmdk and temp2-flat.vmdk are created as a result.
6. You can delete temp2-flat.vmdk as it is not needed.

# rm temp2-flat.vmdk

7.Rename temp2.vmdk to the name that is needed to match the orphaned -flat file (vm-vCenter.vmdk in this example):

# mv temp2.vmdk vm-vCenter.vmdk

8. Edit the descriptor file (the vm-vCenter.vmdk)

edit-vmdk-file

find the line with RW ####### and change the name of the -flat to match the orphaned -flat file you have. So I chanded temp2.vmdk to vm-vCenter.vmdk as you can see on the image below.

edit-vmdk-file-recreate

9. Power up the virtual machine and access the disk drive. The drive contains the data from the old disk.

Source: VMware KB 1002511

Shares
Vote !

| Filed Under: Server Virtualization Tagged With: recover VMDK, recreate missing VMDK (header) file, troubleshooting VMDK, VM start trouble, Vmdk, VMDK lost, VMDK-flat

About Vladan SEGET

This website is maintained by Vladan SEGET. Vladan is as an Independent consultant, professional blogger, vExpert x16, Veeam Vanguard x9, VCAP-DCA/DCD, ESX Virtualization site has started as a simple bookmarking site, but quickly found a large following of readers and subscribers.

Connect on: Facebook. Feel free to network via Twitter @vladan.

Comments

  1. Bouke Groenescheij says

    July 17, 2009 at 3:38 am

    This works fine as long as you know *exactly* how large the original virtual disk was. But I’ve had some cases where I change from ESX 3i to 3.5 and to ESX 4 and 4i, and it seemed that the size calculation changed somewhat. My virtual disk isn’t 15GB, but 14,99543 or something like that. Or my 3GB virtual disk is 2,93233…
    I’ve spend some time, trial and error trying to get an header file, using an Excel sheet to extrapolate the correct setting :-s

    Anyway, good post. Thanks for sharing…

    • Vladan SEGET says

      July 17, 2009 at 3:59 am

      Bouke,

      great sharing your experience. It’s always count for me having different view points from differents sides. Thanks for the comment.
      Vladan

  2. Pawel says

    July 1, 2012 at 4:58 am

    Thanks! Worked out like a charm!

  3. Eric_ says

    January 25, 2015 at 9:50 pm

    Dumped my VM but forgot to copy one set of files. Managed to get the disks back with your solution and copy my files afterall.

    Thanks

  4. poya says

    October 2, 2019 at 4:55 pm

    hi dear
    what shuold i do for vmdk bigger than 4T?

    thanks.

Private Sponsors

Featured

  • Thinking about HCI? G2, an independent tech solutions peer review platform, has published its Winter 2023 Reports on Hyperconverged Infrastructure (HCI) Solutions.
  • Zerto: One Platform for Disaster Recovery, Backup & Cloud Mobility: Try FREE Hands-On Labs Today!
Click to Become a Sponsor

Most Recent

  • And Another Hypervisor Platform that will be supported by Veeam – HPE VM Essentials!
  • Zerto 10 U7 – Ransomware Defense and Disaster Recovery on VMware vSphere and other virtualization platforms
  • Another VMware Alternative Called Harvester – How does it compare to VMware?
  • Dream Lab with PCIe Gen 5.0 M.2 NVMe Storage
  • Backup solution that supports 15+ Hypervisors – Vinchin Backup and Recovery
  • Why NordVPN is Your Must-Have for Business Security and Personal Freedom
  • Agentless Backup Solutions for XCP-ng Hypervisor: External Vendor Options
  • Vinchin Earns Acclaimed Recognition in Gartner Peer Insights 2025 Report
  • VMware vSphere 9 Standard and Enterprise Plus – Not Anymore?
  • Free Virtual Backup Appliance from StarWind – With Community Support (example configuration for ESXi and Veeam Backup)

Get new posts by email:

 

 

 

 

Support us on Ko-Fi

 

 

Buy Me a Coffee at ko-fi.com

Free Trials

  • DC Scope for VMware vSphere – optimization, capacity planning, and cost management. Download FREE Trial Here.
  • Augmented Inline Deduplication, Altaro VM Backup v9 For #VMware and #Hyper-V – Grab your copy now download TRIAL.

VMware Engineer Jobs

VMware Engineer Jobs

YouTube

…

Find us on Facebook

ESX Virtualization

…

Copyright © 2025 ·Dynamik-Gen · Genesis Framework · Hosted with HostColor.com