mounting VMFS in linux

Posted on 2008-06-11
Last Modified: 2013-12-16
To simplify my backup system, it would be preferable for me to be able to mount a snapshot of the VMFS residing on my SAN. Is there a linux tool for that ?
Question by:drezzzz

Accepted Solution

palekar earned 250 total points
ID: 21762401
mount-vmfs is a program that mounts VMFS (VMware ESX Server File System) file systems. It is useful for automatically mounting partitions with valid VMFS file systems on the console operating system.

In its simplest usage, mount-vmfs does not take any arguments. It checks every SCSI device available to virtual machines for valid file systems. If a valid file system is found, mount-vmfs mounts it at /vmfs/vmhba<a>:<t>:<l>:<p>, where <a> specifies the SCSI adapter number, <t> specifies the SCSI target, <l> specifies the LUN (logical unit number) and <p> specifies the disk partition. If the disk has no partitions and the disk has a valid file system, <p> is zero.

If a partition has an associated file system name (vmkfstools -S), then
mount-vmfs also creates a symbolic link from /vmfs/<fsname> to the corresponding mount point (/vmfs/vmhba<a>:<t>:<l>:<p>).

The reverse operation - unmounting all VMFS partitions - can be performed by executing umount-vmfs.

By default, mount-vmfs does not mount any VMFS file systems that have the shared or public attribute. File systems with these attributes set are intended to be accessed by multiple ESX Server computers. Thus, it does not make sense to mount these file systems automatically on any one server. However, mount-vmfs will also mount any such file systems if you include the -f flag on the command line.

In addition, an individual file system can be mounted explicitly by supplying its device name or file system name as an argument to mount-vmfs. The format for the command is

mount-vmfs vmhba0:2:0:1

This mounts the file system on the specified partition if that partition holds a VMFS file system.

You can use the regular mount command to mount VMFS file systems. The file system type is vmfs and the device name is vmhba<a>:<t>:<l>:<p>. The format for the command is

mount -t vmfs vmhba0:1:0:2 /vmfs/vmhba0:1:0:2

This mounts partition 2 of the disk with target 1 on the adapter vmhba0.

Although VMFS file systems may appear similar to any other file system such as ext2, VMFS is mainly intended to store large files such as disk images. It does not support directory hierarchies. New file systems can be created using vmkfstools -C.

The reported file length of all VMFS files (disk images) is 512 bytes longer than the disk image. The additional 512 bytes contain certain file attributes such as the size of the disk image represented by the file. VMFS files that are not disk images do not incur this 512-byte overhead.


Disk images tend to be large. Unfortunately, the console operating system does not support files greater than 4GB and there is only limited functionality for files between 2GB and 4GB. The file size field of the stat system call has only 32 bits, therefore stat returns incorrect information for files equal to or bigger than 4GB. For such files, VMFS returns 4GB-1 as the file size in the stat system call. NFS and scp are known to run into this limitation, while FTP and cp are not affected by it.

VMFS files support standard permissions of read, write and execute for owner, group and other. The files do not support setuid or setgid flags. The VMFS directory has the same permissions as /tmp, which means that anyone can create a file in the directory, but users can read or modify only those files for which they have appropriate permissions.

Currently, VMFS file names are limited to 128 bytes.
LVL 18

Assisted Solution

larstr earned 250 total points
ID: 21762989
You can't mount vmfs from a normal linux machine. VMFS is a vmware proprietary file system that is only mounted (but not by "normal" means) in the Service Console on an ESX Server.

Through VCB you will however be able to mount virtual disk files, but VCB is currently only available on windows platform.


Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
Fine Tune your automatic Updates for Ubuntu / Debian
Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question