Partition Recovery - Vmfs 5

sudo apt-get install vmfs-tools # Debian/Ubuntu vmfs-fuse /dev/sdX1 /mnt/recover -o ro,allow_other If files appear, copy them off immediately. No writing back. If the datastore UUID conflicts or header is damaged but VMs are still on-disk:

esxcli storage vmfs snapshot resignature -l <old_label> # or vmkfstools -Z /vmfs/volumes/<new_ds_name> /vmfs/devices/disks/naa.600...:1 Resignature changes UUID – may break VM references in vCenter. Fix by re-adding VMs to inventory. 4. When to Use Third-Party Tools | Tool | Best for | |------|-----------| | UFS Explorer (with VMFS add-on) | Corrupted FBMs, deleted VMDK recovery | | R-Studio for VMFS | Full datastore rebuild, filename recovery | | Klennet VMFS Recovery | No-OS-boot situations (bootable ISO) | | ddrescue | Clone failing LUN before recovery | vmfs 5 partition recovery

Scope: Accidental deletion, corrupted partition table, or "raw" appearance of a VMFS 5 datastore. No backups of the datastore metadata. 1. Immediate Do’s & Don’ts | Do | Don’t | |----|-------| | Power off VMs on the affected LUN | Write any new data to the LUN | | Take a VM snapshot of critical VMs (if any are still visible) | Run vmkfstools repair commands blindly | | Use dd or esxcli storage core device to preserve LUN header | Reformat or create a new datastore | | Work on a clone of the LUN if possible | Trust Windows CHKDSK or Linux fsck on the device | Key: VMFS 5 keeps metadata in the first ~8-10 MB of the partition (heartbeat region, file descriptors, FBMs). If that’s overwritten – recovery becomes hard but not impossible. 2. Check If It’s Really Gone SSH into an ESXi host with access to the LUN: Fix by re-adding VMs to inventory

voma -m vmfs -f fix -d /vmfs/devices/disks/naa.600... If voma detects a backup header, it will offer to automatically. Step 2 – Manual recovery of partition table (if lost) If the partition table itself is gone but the VMFS data starts at sector 128 (typical), recreate: No backups of the datastore metadata

If voma and vmfs-fuse fail → go straight to Klennet or UFS Explorer. They understand VMFS 5 B+tree structure and can rebuild without a valid header. Situation: ESXi 6.5, 4 TB LUN, accidentally formatted as VMFS 6 by another host. User aborted after 3 seconds.

partedUtil set /vmfs/devices/disks/naa.600... 1 0xfb 0 0 # vmfs5 type partedUtil set /vmfs/devices/disks/naa.600... 1 0xfb 128 <end_sector> # adjust end partedUtil get /vmfs/devices/disks/naa.600... or ls -l /vmfs/devices/disks/naa.600...:1 (if partition 1 still exists). Step 3 – Force mount with VMFS recovery driver On a Linux host with vmfs-tools (safer than ESXi):