Let’s look at several ways to access data stored on the datastore with the ESXi host’s VMFS file system (these configuration files, data files, and snapshots of the virtual machine) from Linux, Windows, and the VMware hypervisor. In fact, this article is based on a real case of our client when a VMware ESXi host is suddenly crushed.
If your ESXi host crashes, but the local disks (or LUNs) are still functional, you can copy the virtual machine files and run the VMs on another host (even on VMware Workstation or Hyper-V) Huh. Common operating systems (Windows and Linux) will not see data on partitions containing the VMFS file system by default, because they do not have a VMFS driver.
Let us consider three scenarios of accessing data on VMFS datastore.
How to Mount VMFS File System on Linux (Ubuntu)?
Let’s see how to mount partition with VMFS file system on a computer with Ubuntu 20.04 LTS installed. Install the vmfstools package depending on the version of the VMFS file system:
- vmfs-tools – Supports VMFS 3 (ESXi 3.x, 4x) and VMFS 5 (ESXi 5.x)
- vmfs6-tools – VMFS 6 (used by default in modern versions of ESXi since vSphere 6.5)
In our example, the disk was connected to an ESXi 7.1 host, so you need to install vmfs6-tools to access the data on the VMFS6 file system:
# apt-get -y install vmfs6-tools
Create a mount directory:
# mkdir /mnt/vmfs
Get disk name and partition type:
# fdisk -l
In our example, you can see that /dev/sdb drive has one sdb1 split with vmware vmfs file system.
# parted -l
To mount this VMFS partition on Linux, run the command:
# sudo vmfs6-fuse /dev/sdb1 /mnt/vmfs
The command returned that the specified partition has a VMFS6 file system and is mounted to the target directory.
Virtual machine files on VMFS disks are read-only available to you and you can copy them or play them quickly with VMware Player/Workstation.
An error may occur while mounting the partition:
VMFS Unsupported version 5 Unable to openfilesystem
In this case, you need to install vmfs-tools which supports VMFS3 and VMFS5:
# apt-get install vmfs-tools
It remains to mount the disk partition with the VMFS 5 datastore:
#vmfs-fuse /dev/sdb1 /mnt/vmfs
Mounting a VMFS Partition on a New VMware ESXi Host
Above, we saw how to mount a VMFS partition using third party VMFS drivers. However, the most universal way to access data on a failed server’s VMFS data store is to connect its disks to a new ESXi server (you can have ESXi installed on a new host in less than an hour). I think this is the easiest way to mount a VMFS volume from a physical hard drive or LUN to a storage array device (connected via fiber channel or iSCSI).
To mount an existing VMFS datastore on a new ESXi host without formatting it, follow the steps below:
- Connect to the new ESXi server (ESXi 6.7 in this example) using the vSphere Web Client;
- Connect the disk to the new host and perform storage rescan (if your VMFS is located on an iSCSI LUN, you connect to it according to the guide);
- go to Device tab, and find your LUN in the list. Make sure ESXi sees VMFS there division;
If the VMFS datastore is deleted from the storage device, see “How to recover accidentally deleted VMFS datastore?” Check the post
- Connect to the ESXi host’s console via SSH and run the command:
- This command should find the available VMFS partitions on the disk and mount them;
- Open vSphere Client and make sure your VMFS storage is now available. click on it and select Mountain,
- Open Datastore browser. Now you can access all files on VMFS datastore. You can find the required vmx files, register them on the current ESXi host, and run critical virtual machines right away.
Accessing VMFS Datastore from Windows
To mount a VMFS partition and access virtual machine files from Windows, you will need a special Java driver – Open Source VMFS Driver, This driver requires Java version 6 or later and allows mounting VMFS volumes in read-only mode.
You can download the open source VMFS driver here: https://code.google.com/archive/p/vmfs/, This project hasn’t been updated since 2010 and the latest version of the driver available on the site is VMFS driver r95, which only supports VMFS 3 (< VMware ESXi 5.x).
Comment, If you try to mount in a newer version of VMFS, you will receive an error message: No VMware file system found,
- Download the open source VMFS driver (fvmfs_r95_dist.zip) and extract it to any directory (eg, C:\vmfs);
- You can check the operation of java-application fvmfs.jar as follows:
java -jar fvmfs.jar
- Next, you need to determine the number of disks containing the VMFS datastore connected to your Windows computer. You can find the disk number in the Disk Management console or by using diskpart (in our example, the connected disk has index 1 – disk 1. For the fvmfs driver, this disk has the following name \\.\PhysicalDrive.1,
- Try to get information about this disk:
java -jar fvmfs.jar \\.\PhysicalDrive1 info
- Share this disk with WebDAV:
java -jar fvmfs.jar \\.\PhysicalDrive1 webdav
- Make sure the WebClient service is started. If the service is disabled, run it;
- Mount shared disk:
net use *
- A new disk with a read-only VMFS datastore will appear in Windows;
- Do not close the Command Prompt window when working with files on the VMFS datastore.