# Mount external USB device in ESXi hypervisor

1. Stop USB service

```
[root@esxi:~] /etc/init.d/usbarbitrator stop
watchdog-usbarbitrator[2101796]: Terminating watchdog process with PID 2098419
stopping usbarbitrator...
usbarbitrator stopped
```

2. 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"
   }
```

3. Format entire external drive using **vmkfstools**&#x20;

```
[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
```

4. 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
```

5. 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
```

6. 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:L&#x30;**: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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.iblue.team/esxi-forensics/mount-external-usb-device-in-esxi-hypervisor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
