Repair Vmfs: Datastore
The first rule of repair is diagnostic rigor. An administrator must connect to each ESXi host via SSH or the DCUI and run esxcfg-scsidevs -m to see if the device is detected at the physical layer, then vim-cmd hostsvc/storage/query to assess logical visibility. Often, the problem is not corruption but a "stale lock"—a remnant from a host that lost communication but never released its reservation. In such cases, the repair is a simple, non-destructive vmkfstools -D to check lock status, followed by releasing orphaned locks. VMware provides a surprisingly powerful yet underutilized command-line toolkit for datastore repair, primarily vmkfstools and esxcli storage filesystem . The most famous command in this domain is vmkfstools –fix , which performs a filesystem consistency check (FSCK) specific to VMFS.
The vmkfstools -F (or --fix ) switch is the closest analogue to Windows chkdsk . When executed against a volume path (e.g., vmkfstools -F check /vmfs/volumes/DatastoreName ), it scans for metadata inconsistencies, orphaned file descriptors, and incorrect resource counts. However, this is not a magic wand. It operates in three phases: "check" (read-only), "repair" (fixing minor issues like incorrect link counts), and "fix" (attempting more aggressive recovery). A crucial caveat: vmkfstools cannot recover actual file data; it can only repair the filesystem's pointers. If a virtual machine's VMDK descriptor file points to the wrong blocks, the repair may succeed logically while leaving the VM booting to a blue screen. repair vmfs datastore
For more severe cases—where the VMFS volume is unmountable—the esxcli storage vmfs command family offers esxcli storage vmfs snapshot mount and esxcli storage vmfs resignature . Resignaturing is a critical technique used when a datastore’s UUID conflicts with another (e.g., after a snapshot restore). It generates a new UUID, allowing the datastore to mount, but it breaks any snapshot chains or replicas dependent on the old signature. This is a "repair" of availability, not integrity. When native tools fail—typically in cases of overwritten metadata blocks or severe disk-level corruption—the administrator must turn to specialized third-party utilities. Tools like UFS Explorer RAID Recovery (which includes VMFS parsers), Runtime Software's GetDataBack for VMFS , or Stellar Data Recovery for VMware can scan raw block devices to reconstruct the VMFS structure. These tools operate by recognizing VMFS file signatures (e.g., the fdc.db file for descriptor chains) and ignoring the corrupt filesystem layer. The first rule of repair is diagnostic rigor