Mount external USB device in ESXi hypervisor
How to mount an external USB drive in an ESXi hypervisor for host access. I highly recommend using a new, large disk (depending on your requirements) which will be formatted using VMFS/VMFS6.
Stop USB service
[root@esxi:~] /etc/init.d/usbarbitrator stop
watchdog-usbarbitrator[2101796]: Terminating watchdog process with PID 2098419
stopping usbarbitrator...
usbarbitrator stopped
Connect external USB drive to ESXi host (in this example we're using a 32GB SanDisk USB)
[root@esxi:~] vdq -q
"Name" : "mpx.vmhba35:C0:T0:L0",
"VSANUUID" : "",
"State" : "Ineligible for use by VSAN",
"Reason" : "Has partitions",
"IsSSD" : "0",
"IsCapacityFlash": "0",
"IsPDL" : "0",
"Size(MB)" : "29340",
"FormatType" : "512n",
"IsVsanDirectDisk" : "0"
}
Format entire external drive using vmkfstools
[root@esxi:~] vmkfstools -C vmfs6 -S MyVolume /dev/disks/mpx.vmhba35:C0:T0:L0:1
create fs deviceName:'/dev/disks/mpx.vmhba35:C0:T0:L0:1', fsShortName:'vmfs6', fsName:'MyVolume'
deviceFullPath:/dev/disks/mpx.vmhba35:C0:T0:L0:1 deviceFile:mpx.vmhba35:C0:T0:L0:1
ATS on device /dev/disks/mpx.vmhba35:C0:T0:L0:1: not supported
.
Checking if remote hosts are using this device as a valid file system. This may take a few seconds...
Scanning for VMFS-6 host activity (4096 bytes/HB, 1024 HBs).
Creating vmfs6 file system on "mpx.vmhba35:C0:T0:L0:1" with blockSize 1048576, unmapGranularity 1048576, unmapPriority default and volume label "MyVolume".
Successfully created new volume: 66909728-dd72c566-8a2f-3cecef04e91c
Check volume is mounted and accessible
[root@esxi:~] ls -lah /vmfs/volumes/
<snip>
lrwxr-xr-x 1 root root 35 Jul 12 02:39 MyVolume -> 66909728-dd72c566-8a2f-3cecef04e91c
Check you can read/write to mounted volume
[root@esxi:~] echo "32GB" > /vmfs/volumes/MyVolume/something.txt
[root@esxi:~] cat /vmfs/volumes/MyVolume/something.txt
32GB
To mount your VMFS volume/disk on Linux, read this https://www.iblue.team/esxi-forensics/esxi-vmfs-exploration
Note: if you receive an error similar to the following, you need to specify the actual partition you're intending to format (mpx.vmhba35:C0:T0:L0:1 instead of mpx.vmhba35:C0:T0:L0)
Failed to create VMFS on device mpx.vmhba35:C0:T0:L0
/dev/disks/mpx.vmhba35:C0:T0:L0: Permission denied. (Have you set the partition type to 0xfb?)
Error: Permission denied
Last updated
Was this helpful?