VMFS Recovery
Recovers data from VMware ESXi servers

Mapping a VMFS disk to Guest OS as RDM disk


Mapping VMFS disk to guest OS as RDM drive


Warning: officially VMware doesn't support this feature. But we've tested mounting the VMFS disk as RDM at ESX 6.5 and it worked.

You need to create a new VMDK file and mount it to a VMFS disk using RDM. After it's done, you'll be able to add this “VMDK” disk to the VM and use its data from within the guest OS.

Now connect to the ESXi host using SSH. If SSH is disabled, please see this guide on how to enable it

Browse to the folder with a virtual machine where the RDM disk should be added. To do this enter:

cd /vmfs/volumes/"your_datastore_name"/"virtual_machine_name"

Obtain path to the local hard drive and datastores that should be mapped. Use the following commands to list available HDDs and datastores:

ls -l /vmfs/devices/disks/
ls -l /vmfs/volumes/

Create a vmdk file:

vmkfstools -z /vmfs/devices/disks/"test_rdm_disk".vmdk

Mapping local hard drive to vmdk file:

vmkfstools -z /vmfs/devices/disks/"HDD_name" /vmfs/volumes/"datastore_name"/"test_rdm_disk".vmdk

Add a new VMDK file to the virtual machine using vSphere as a new drive from the existing VMDK.
Now you can scan the datastore from inside of one of the VMs. datastore will be represented as one of the local RAW disks in the Windows disk manager or as a VMFS volume in the "Hard drives" section of the disk list in VMFS Recovery™.

Please note: you can use -r parameter instead of -z:

vmkfstools -r /vmfs/devices/disks/"HDD_name" /vmfs/volumes/"datastore_name"/"test_rdm_disk".vmdk

Warning: Quotes represent parameters you should replace with your own values from the results of execution of ls -l command (above).

Also, pay attention to the spaces in the command, so you pass exactly 3 parameters to vmkfstools command. Here it is again with "[SPACE]" string to highlight these important spaces:

vmkfstools[SPACE]-r[SPACE]/vmfs/devices/disks/"HDD_name"[SPACE]/vmfs/volumes/"datastore_name"/"test_rdm_disk".vmdk

Disks connected as “-r” are connected as hypervisor disks. Such mode offers better compatibility for some guest OS, but some features like disk's S.M.A.R.T. are unavailable. We recommend using the -z parameter during mount operation as in this case disks are mounted as-is and represented to guest OS as real hardware drives.

Hint: In some cases, ESX required that the datastore should have an "unmounted" state to allow RDM mapping.




Return to contents