ESXi Create VMFS Datastore on USB drives

  1. Connect to the ESXi host with SSH
  2. Stop the USB arbitrator service. This service is used to passthrough USB device from an ESX/ESXi host to a virtual machine. (When disabling it, you can no longer passthrough USB devices to VMs)
    ~ # /etc/init.d/usbarbitrator stop
  3. (optional) Use this command to permanently disable the USB arbitrator service after reboot.
    ~ # chkconfig usbarbitrator off
  4. Get the device list :
    ~ # ls /dev/disks/
  5. Plug in the USB Device to your ESXi host
  6. Get the device identifier (mpx.vmhbaXX). You should see the USB Device in /dev/disks/ it will be the new device compared to step 4:
    ~ # ls /dev/disks/
  7. Write a GPT label to the device (Assuming that the Device ID is mpx.vmhba36)
    ~ # partedUtil mklabel /dev/disks/mpx.vmhba36 gpt
  8. To create a partition you need to know the start sector, end sector, which depends on the device size and the GUID.
    The start sector is always 2048
    The GUID for VMFS is AA31E02A400F11DB9590000C2911D1B8
    The end sector can be calculated with the following formula (Use the numbers from getptbl):

    ~ # partedUtil getptbl /dev/disks/mpx.vmhba36
    gpt
    1947 255 63 31293440

    1947 * 255 * 63 – 1 = 31278554

    You can also calculate the endsector with the following command:

    ~ # eval expr $(partedUtil getptbl /dev/disks/mpx.vmhba36 | tail -1 | awk '{print $1 " \\* " $2 " \\* " $3}') - 1
    31278554
  9. Create the VMFS partition (Replace with your endsector)
    ~ # partedUtil setptbl /dev/disks/mpx.vmhba36 gpt "1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0"
  10. Format the partition with VMFS5
    ~ # vmkfstools -C vmfs5 -S USB-Stick /dev/disks/mpx.vmhba36:1

How to add a USB Disk as VMFS Datastore in ESXi 6.7 – IT-REACT