If you’re using ESXi in your home lab like me and you want some more storage for your datastore, you can use an external USB hard drive. I do recommend you use a USB-C SSD so you get some speed or even better you can use an PCIe 5 NVME drive in an external encloser. But to get this to work you need to do some configurations, I’ll guide you through them in this how-to.
Introduction
Validated on
This how-to have been tested and known to work, but not limited to the following versions
- ESXi 8
Prerequisite
- Root access to ESXi
- SSH software
- macOS, you can use Terminal
- Linux, you can use Terminal
- Windows, I do recommend you to use PuTTY
Good to know
You don’t need to reboot your ESXi host
Start
As you can see in the picture below, I don’t have any more storage then datastore1.

Enable SSH
We need to login to our ESXi host with SSH, so first we need to enable SSH.
You can do that by going to ESXi web portal -> Click on Host in the left menu -> at the right click on Actions -> in the menu that will appear go down to Services and then click on Enable Secure Shell (SSH)
A banner will appear that warns you that SSH is enabled
Now when SSH are enabled connect to your ESXI trough SSH, if your using Windows you can use PuTTY if you use any Linux based system including macOS you can use terminal.
Collect information from our USB hard drive
We need to collect some information from our USB hard drive so type the following
esxcli hardware usb passthrough device list
Take notes of Bus, Dev, VendorId and ProductId in the command Time to disable USB passthrough, device are translated to BUS:DEV:VENDORID:PRODUCTID so in my case I’ll enter the following command
esxcli hardware usb passthrough device disable -d 1:4:1058:1140
Configure the USB hard drive
Now we need to create a label for the USB disc and that will remove all the data from the disc. Make sure that you don’t have anything you want to save on it. Remember to replace mpx.vmhba32:C0:T0:L0 with your own
partedUtil mklabel mpx.vmhba32:C0:T0:L0 gpt
We are going to create a VMFS partition, first we need to get the GUID for VMFS it usually is “AA31E02A400F11DB9590000C2911D1B8” but I’ll throw in the command how to make sure it’s correct
partedUtil showGuids
Let’s create the VMFS partition, remember to replace mpx.vmhba32:C0:T0:L0 with your own
partedUtil "setptbl" " mpx.vmhba32:C0:T0:L0" "gpt" "1 2048 $(eval expr $(partedUtil getptbl mpx.vmhba32:C0:T0:L0 | tail -1 | awk '{print $1 " \* " $2 " \* " $3}') - 1) AA31E02A400F11DB9590000C2911D1B8 0"
And now the last thing to do in SSH is to format it, you can replace “usbdrive-samsung” to whatever that fits you. Remember to replace mpx.vmhba32:C0:T0:L0 with your drive and don’t forget :1 at the end of your USB hard drives name
vmkfstools -C vmfs6 -S "usbdrive-samsung" mpx.vmhba32:C0:T0:L0:1
Error
I did stumble over the following error, and after some ninja-google skills and reading some documentation I did figure out that I did forget to write :1 at the end of my USB hard drive name in the previous command.

Verify in ESXi web portal
Now if we go to ESXi web portal we can see that our USB hard drive is showing up under Storage. You can find it under Storage in the left menu -> Datastore in the middle top menu

Disable SSH
Always remember to disable SSH when you’re done, it’s a security risk to leave SSH on!
- Click on host in the left menu
- Now in the middle you will see a yellow banner
- Click on the Action button at the right end of the yellow banner
In the menu that will appear click Services -> Disable Secure Shell (SSH)
Conclusion
Now we are finished, and we can use a external USB hard drive as datastore!