This article provides steps to create a new VMFS volume on a disk that has free, unallocated space.
Note: VMFS Datastores are normally created using the vSphere Client, and it is not necessary to format the disk from the command line. For more information, see the Create VMFS Datastores.
VMware vSphere ESXi 8.0
VMware vSphere ESXi 7.0
To create a new VMFS volume from the ESX/ESXi host command line:
partedUtil setptbl "/vmfs/devices/disks/DeviceName" DiskLabel ["partNum startSector endSector type/guid attribute"]
partedUtil setptbl /vmfs/devices/disks/DeviceName gpt "1 2048 7516192734 AA31E02A400F11DB9590000C2911D1B8 0"
vmkfstools -C vmfs5 -S <NewDatastore> /vmfs/devices/disks/naa.6090123456xxx:1
Note: The recommended starting offset in a VMFS-5/VMFS-6 file system is 2048. This mitigates failures if the SCSI UNMAP command is used.