vmkfstools is one of the ESXi Shell commands for managing VMFS volumes, storage devices, and virtual disks. You can perform many storage operations using the vmkfstools command. For example, you can create and manage VMFS datastores on a physical partition, or manipulate virtual disk files, stored on VMFS or NFS datastores.

Note: After you make a change using the vmkfstools, the vSphere Client might not be updated immediately. Use a refresh or rescan operation from the client.

For more information on the ESXi Shell, see Getting Started with ESXCLI.

vmkfstools Command Syntax

Generally, you do not need to log in as the root user to run the vmkfstools commands. However, some commands, such as the file system commands, might require the root user login.

The vmkfstools command supports the following command syntax:

vmkfstools options target.

Target specifies a partition, device, or path to apply the command option to.

Table 1. vmkfstools Command Arguments
Argument Description
options One or more command-line options and associated arguments that you use to specify the activity for vmkfstools to perform. For example, selecting the disk format when creating a new virtual disk.

After entering the option, specify a target on which to perform the operation. Target can indicate a partition, device, or path.

partition Specifies disk partitions. This argument uses a disk_ID:P format, where disk_ID is the device ID returned by the storage array and P is an integer that represents the partition number. The partition digit must be greater than zero (0) and must correspond to a valid VMFS partition.
device Specifies devices or logical volumes. This argument uses a path name in the ESXi device file system. The path name begins with /vmfs/devices, which is the mount point of the device file system.

Use the following formats when you specify different types of devices:

  • /vmfs/devices/disks for local or SAN-based disks.
  • /vmfs/devices/lvm for ESXi logical volumes.
  • /vmfs/devices/generic for generic SCSI devices.
path Specifies a VMFS file system or file. This argument is an absolute or relative path that names a directory symbolic link, a raw device mapping, or a file under /vmfs.
  • To specify a VMFS file system, use this format:
    /vmfs/volumes/file_system_UUID

    or

    /vmfs/volumes/file_system_label
  • To specify a file on a VMFS datastore, use this format:
    /vmfs/volumes/file_system_label|file_system_UUID/[dir]/myDisk.vmdk

    If the current working directory is the parent directory of myDisk.vmdk, do not enter the entire path.

The vmkfstools Command Options

The vmkfstools command has several options. Some of the options are suggested for advanced users only.

The long and single-letter forms of the options are equivalent. For example, the following commands are identical.

vmkfstools --createfs vmfs6 --blocksize 1m disk_ID:P
vmkfstools -C vmfs6 -b 1m disk_ID:P

-v Suboption

The -v suboption indicates the verbosity level of the command output.

The format for this suboption is as follows:

-v --verbose number

You specify the number value as an integer from 1 through 10.

You can specify the -v suboption with any vmkfstools option. If the output of the option is not suitable for use with the -v suboption, vmkfstools ignores -v.

Note: Because you can include the -v suboption in any vmkfstools command line, -v is not included as a suboption in the option descriptions.