Create a VMFS volume on a LUN:
vmkfstools -C vmfs3 -S label vmhba1:0:2:1

Identify disks attached to the ESX server including SAN LUNs (in human readable format):
vdf -h

Read Metadata from VMFS volumes (version, capacity and file block size):
vmkfstools -P /vmfs/volumes/LUN-A1

Add and extent to a datastore (Each LUN can be max 2TB. 32 extents can be added to reach 64TB):
[vmkfstools -Z addthislun tothislun]
vmkfstools -Z vmhba1:0:12:1 vmhba1:0:11:1

Delete an extended volume:
vmkfstools -C vmfs3 -S LUNB vmhba1:0:12:1

Rename a VMFS datastore:
ls -laF /vmfs/volumes/
Note down the id of the volume linked to the datastore you want to rename (e.g. /vmfs/volumes/477c7-634968-3c1a-001...).
rm -rf /vmfs/volumes/oldname
ln -s /vmfs/volumes/477c7-634968-3c1a-001... /vmfs/volumes/newname


Command Options:
/usr/sbin/vmkfstools -h
No valid command specified

OPTIONS FOR FILE SYSTEMS:
vmkfstools -C --createfs vmfs3
-b --blocksize #[mMkK]
-S --setfsname fsName
-Z --extendfs extension-partition
deviceName
-P --queryfs -h --humanreadable
-T --tovmfs3
-x --upgradetype [zeroedthick|eagerzeroedthick|thin]
-u --upgradefinish
vmfsPath

OPTIONS FOR VIRTUAL DISKS:
vmkfstools -c --createvirtualdisk #[gGmMkK]
-d --diskformat [zeroedthick|
eagerzeroedthick|
thick|
thin]
-a --adapterType [buslogic|lsilogic]
-w --writezeros
-j --inflatedisk
-U --deletevirtualdisk
-E --renamevirtualdisk srcDisk
-i --clonevirtualdisk srcDisk
-d --diskformat [rdm:|rdmp:|
raw:|thin|2gbsparse|
monoflat|monosparse]
-X --extendvirtualdisk #[gGmMkK]
-M --migratevirtualdisk
-r --createrdm /vmfs/devices/disks/...
-q --queryrdm
-z --createrdmpassthru /vmfs/devices/disks/...
-v --verbose #
-g --geometry
-J --miscop [setuuid | getuuid]
vmfsPath

OPTIONS FOR DEVICES:
vmkfstools -s --scan adapterName
-L --lock [reserve|release|lunreset|targetreset|busreset] /vmfs/devices/disks/...

Share this blog post on social media:

Social Links

Disclaimer

All advice, installation/configuration how to guides, troubleshooting and other information on this website are provided as-is with no warranty or guarantee. Whilst the information provided is correct to the best of my knowledge, I am not reponsible for any issues that may arise using this information, and you do so at your own risk. As always before performing anything; check, double check, test and always ensure you have a backup.

Copyright ©2008-2021 Andy Barnes - Please do not copy any content including images without prior consent!

Designed and Hosted by Andy Barnes

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.