Using a USB drive as a VMFS Datastore in VMware ESXi can be incredibly useful for homelab environments, testing, or lightweight workloads. While USB devices are not officially supported for VMFS datastores in production setups, this guide will walk you through the step-by-step process of formatting and mounting a USB drive as a VMFS datastore in VMware ESXi.
🛑 Important Note: This method is a workaround and should only be used in non-production environments (e.g., homelabs, testing, or backup storage).
Here is the video version of this written tutorial:
🔹 Credit & Reference
This guide is inspired by the original tutorial from Virten.net. Special thanks to Virten.net for their detailed documentation on using USB devices as VMFS datastores in VMware ESXi.
For further reading and additional insights, visit the original post:
🔗 USB Devices as VMFS Datastore in vSphere ESXi 6.5 🚀
📌 Prerequisites
- A USB Drive or external Nvme or SATA Drives connected to the ESXi host
- VMware ESXi installed and running
- SSH access enabled on your ESXi host
- An SSH client like PuTTY (Windows) or Terminal (Mac/Linux)
🔹 Step 1: Enable SSH on Your ESXi Host
To perform these operations, you need SSH access to your ESXi server.
🔹 Enable SSH via the ESXi Web UI
- Log in to your ESXi host via Web UI:
👉https://<your-esxi-ip>
- Navigate to Host > Manage > Services
- Find TSM-SSH and Start the service
🔹 Enable SSH via Direct Console User Interface (DCUI)
- Press
F2
at the ESXi console - Navigate to Troubleshooting Options
- Select Enable SSH
🔹 Step 2: Identify Your USB Drive in ESXi
- SSH into your ESXi host:
ssh root@<your-esxi-ip>
- Stop the USB arbitrator service (this prevents passthrough issues):
/etc/init.d/usbarbitrator stop
- To permanently disable the USB arbitrator service after reboot:
chkconfig usbarbitrator off
- List all available storage devices:
ls -l /dev/disks
- Verify the USB device by checking its size:
ls -lh /dev/disks
🔹 Step 3: Create a GPT Partition Table on the USB Drive
To create a new GUID Partition Table (GPT):
partedUtil mklabel /dev/disks/mpx.vmhbaXX:C0:T0:L0 gpt
Replace
mpx.vmhbaXX:C0:T0:L0
with your USB disk path.
🔹 Step 4: Create a VMFS Partition on the USB Drive
Before creating a partition, you need to determine the start and end sectors:
The start sector is always 2048.
The GUID for VMFS is AA31E02A400F11DB9590000C2911D1B8
🔹 Determine End Sector
Run this command to calculate the last sector:
eval expr $(partedUtil getptbl /dev/disks/mpx.vmhbaXX:C0:T0:L0 | tail -1 | awk '{print $1 " \\* " $2 " \\* " $3}') - 1
This will return a number, which is the EndSector value.
🔹 Create the Partition
Use this command to create a VMFS partition:
partedUtil setptbl /dev/disks/mpx.vmhbaXX:C0:T0:L0 gpt "1 2048 <EndSector> AA31E02A400F11DB9590000C2911D1B8 0"
Replace
<EndSector>
with the actual value calculated in the previous step.
🔹 Step 5: Format the USB Drive as a VMFS Datastore
Now, format the partition as VMFS6:
vmkfstools -C vmfs6 -S USB-Datastore /dev/disks/mpx.vmhbaXX:C0:T0:L0:1
USB-Datastore
→ The name of your datastorempx.vmhbaXX:C0:T0:L0:1
→ Partition 1 of the USB drive
✅ Verify the Datastore Creation
Run this command to check if the datastore was successfully created:
esxcli storage filesystem list
🔹 Step 6: Mount the USB Datastore in ESXi
- Go to the ESXi Web UI:
👉https://<your-esxi-ip>
- Navigate to Host > Storage > Datastores
- Click Refresh
- You should see the USB-Datastore appear! 🎉
- Disable SSH via the ESXi Web UI
🛠️ Troubleshooting Tips
USB Drive Not Recognized?
Run the following command to check if ESXi detects the USB:
dmesg | grep usb
Fix: Ensure the USB drive is connected before booting ESXi.
Datastore Not Mounting?
Stop the USB arbitrator service (this prevents passthrough issues):
/etc/init.d/usbarbitrator stop
Manually mount the datastore:
esxcli storage filesystem mount -l USB-Datastore
🎉 Conclusion: Successfully Using a USB as a VMFS Datastore in ESXi
Congratulations! 🎉 You’ve successfully configured a USB drive as a VMFS datastore in VMware ESXi. This method is ideal for homelabs, testing environments, and lightweight workloads, but it is not recommended for production use due to performance limitations.
💬 Got questions? Drop a comment on our Facebook Page!
🔔 Like our Facebook Page for more homelab, virtualization, and cybersecurity content!
🔗 Related Articles
#VMware #ESXi #USBStorage #Homelab #Virtualization #VMFS #TechGuide
🔥 Want to support my content? Check out ways to help here!
Your support helps keep valuable tech content coming! 🚀