USB Devices as VMFS Datastore in vSphere ESXi 6.0

In the last years I've seen many requests in forums and blogs where people are trying to use USB devices like USB sticks or external hard disks as VMFS formatted datastore. It was actually possible in vSphere 5, but very picky. Some USB flash drives were working, others not. In vSphere 6, this behavior has been changed obviously. This post explains how you can use USB devices as datastore on your ESXi host. Of course, this is neither a supported, nor a performant storage solution, so use at your own risk.

[Update: If you are looking for USB VMFS Datastores in vSphere 6.5, read this article.]

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. Plug in the USB Device to your ESXi host
  5. Get the device identifier (mpx.vmhbaXX). You should see the USB Device in /dev/disks/:
    ~ # ls /dev/disks/
  6. Write a GPT label to the device (Assuming that the Device ID is mpx.vmhba36)
    ~ # partedUtil mklabel /dev/disks/mpx.vmhba36\:C0\:T0\:L0 gpt
  7. 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\:C0\:T0\:L0
    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\:C0\:T0\:L0 | tail -1 | awk '{print $1 " \\* " $2 " \\* " $3}') - 1
    31278554
  8. Create the VMFS partition (Replace with your endsector)
    ~ # partedUtil setptbl /dev/disks/mpx.vmhba36\:C0\:T0\:L0 gpt "1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0"
  9. Format the partition with VMFS5
    ~ # vmkfstools -C vmfs5 -S USB-Stick /dev/disks/mpx.vmhba36\:C0\:T0\:L0:1

The USB-Stick should now appear in your datastores view.
vmfs-formatted-usb-stick

And the final proof is a virtual machine running on it:
vm-running-on-usb-stick

This is how your command output should look like:

~ # partedUtil mklabel /dev/disks/mpx.vmhba43\:C0\:T0\:L0 gpt
~ # eval expr $(partedUtil getptbl /dev/disks/mpx.vmhba43\:C0\:T0\:L0 | tail -1 | awk '{print $1 " \\* " $2 " \\* " $3}') - 1
31278554
~ # partedUtil setptbl /dev/disks/mpx.vmhba43\:C0\:T0\:L0 gpt "1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0"
gpt
0 0 0 0
1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0
~ # vmkfstools -C vmfs5 -S USB-Stick /dev/disks/mpx.vmhba43\:C0\:T0\:L0:1
create fs deviceName:'/dev/disks/mpx.vmhba43:C0:T0:L0:1', fsShortName:'vmfs5', fsName:'USB-Stick'
deviceFullPath:/dev/disks/mpx.vmhba43:C0:T0:L0:1 deviceFile:mpx.vmhba43:C0:T0:L0:1
ATS on device /dev/disks/mpx.vmhba43: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...
Creating vmfs5 file system on "mpx.vmhba43:C0:T0:L0:1" with blockSize 1048576 and volume label "USB-Stick".
Successfully created new volume: 56226b60-118f2e3f-04ba-001b2193b3b0

Performance

You cant expect much performance out of usb flash drives. To see what's possible I've connected a Samsung mSATA SSD (840 EVO 250GB) to my Intel NUCs (NUC5i5MYHE) USB3 port and created a VMFS datastore on it.
intel-nuc-with-usb3-connected-ssd

Unfortunatelly it's detected as USB 2 device. There is a USB 3.0 hub, but it is not utilized. That seems to be a common problem, I don't know if it's actually possible at the moment.

[Update: October 19. 2015 - Figured out why devices are detected as USB 2. Devices now with full USB 3.0 performance. Performance test results updated.]

Max Write Throughput: 301.91 MB/s
Max Read Throughput: 308.78 MB/s
Max Write IOPS: 8159.31 CMDS/s
Max Write IOPS: 8228.49 CMDS/s

Throughput Test:
vmware-io-analyzer-1.5.1-max-read-throughputvmware-io-analyzer-1.5.1-max-write-throughput


IOPS Test:
vmware-io-analyzer-1.5.1-max-read-iopsvmware-io-analyzer-1.5.1-max-write-iops

Mixed IO Test (I/O Analyzer Exchange 2007):
vmware-io-analyzer-1.5.1-exchange-2007-iopsvmware-io-analyzer-1.5.1-exchange-2007-throughputvmware-io-analyzer-1.5.1-exchange-2007-latency

 

Is it possible with ESXi 5.x?

USB Devices in ESXi 5.x are a little bit picky. Some devices work, others not. I couldn't figure out why, but it is definitely related to ESXi 5.x. I've use the same procedure on the same hardware with the same flash drives. ESXi 6.0 takes all devices without any Issues, ESXi 5.5 takes some, others not.

In ESXi 5.5 the output for non working devices looks like this:

/dev/disks # partedUtil mklabel mpx.vmhba38\:C0\:T0\:L0 gpt
/dev/disks # eval expr $(partedUtil getptbl mpx.vmhba38\:C0\:T0\:L0 | tail -1 | awk '{print $1 " \\* " $2 " \\* " $3}') - 1
31278554
/dev/disks # partedUtil setptbl mpx.vmhba38\:C0\:T0\:L0 gpt "1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0"
gpt
0 0 0 0
1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0
/dev/disks # vmkfstools -C vmfs5 -S terra mpx.vmhba38\:C0\:T0\:L0:1
create fs deviceName:'mpx.vmhba38:C0:T0:L0:1', fsShortName:'vmfs5', fsName:'terra'
deviceFullPath:/dev/disks/mpx.vmhba38:C0:T0:L0:1 deviceFile:mpx.vmhba38:C0:T0:L0:1
Checking if remote hosts are using this device as a valid file system. This may take a few seconds...
Creating vmfs5 file system on "mpx.vmhba38:C0:T0:L0:1" with blockSize 1048576 and volume label "terra".
Usage: vmkfstools -C [vmfs3|vmfs5] /vmfs/devices/disks/vml... or,
 vmkfstools -C [vmfs3|vmfs5] /vmfs/devices/disks/naa... or,
 vmkfstools -C [vmfs3|vmfs5] /vmfs/devices/disks/mpx.vmhbaA:T:L:P
Error: vmkfstools failed: vmkernel is not loaded or call not implemented.

To workaround that, I've tried to create the datastore with ESXi 6, and plugged it into an ESXi 5.5 host. No success. The datastore is recognized but appears as "inactive/unmounted".
vmfs-formatted-usb-stick-in-esx55

vmkernel.log:

2015-10-16T19:44:08.410Z cpu3:33315)WARNING: LinScsiLLD: scsi_add_host:573: vmkAdapter (usb-storage) sgMaxEntries rounded to 255. Reported size was 65535
2015-10-16T19:44:08.410Z cpu3:33315)DMA: 612: DMA Engine 'vmhba38' created using mapper 'DMANull'.
2015-10-16T19:44:08.411Z cpu3:33315)<6>usb-storage 1-1.2:1.0: interface is claimed by usb-storage
2015-10-16T19:44:08.411Z cpu3:33315)<6>usb 1-1.2: device is not available for passthrough
2015-10-16T19:44:08.411Z cpu3:33315)<6>usb 1-1.2: usbfs: registered usb0107
2015-10-16T19:44:08.422Z cpu2:32809)ScsiNpiv: 1504: GetInfo for adapter vmhba38, [0x410897b96400], max_vports=0, vports_inuse=0, linktype=0, state=0, failreason=0, sts=bad0020
2015-10-16T19:44:08.422Z cpu2:32809)ScsiNpiv: 1504: GetInfo for adapter vmhba32, [0x410897bda600], max_vports=0, vports_inuse=0, linktype=0, state=0, failreason=0, sts=bad0020
2015-10-16T19:44:09.436Z cpu0:37002)usb-storage: detected SCSI revision number 0 on vmhba38
2015-10-16T19:44:09.436Z cpu0:37002)usb-storage: patching inquiry data to change SCSI revision number from 0 to 2 on vmhba38
2015-10-16T19:44:09.436Z cpu2:37003)ScsiScan: 976: Path 'vmhba38:C0:T0:L0': Vendor: ' ' Model: 'Patriot Memory ' Rev: 'PMAP'
2015-10-16T19:44:09.436Z cpu2:37003)ScsiScan: 979: Path 'vmhba38:C0:T0:L0': Type: 0x0, ANSI rev: 2, TPGS: 0 (none)
2015-10-16T19:44:09.436Z cpu2:37003)ScsiUid: 273: Path 'vmhba38:C0:T0:L0' does not support VPD Device Id page.
2015-10-16T19:44:09.436Z cpu2:37003)ScsiScan: 1105: Path 'vmhba38:C0:T0:L0' : No standard UID: Failure. ANSI version 'SCSI-2' (0x2).
2015-10-16T19:44:09.437Z cpu1:37003)VMWARE SCSI Id: Could not get disk id for vmhba38:C0:T0:L0
2015-10-16T19:44:09.437Z cpu1:37003)ScsiScan: 1503: Add path: vmhba38:C0:T0:L0
2015-10-16T19:44:09.437Z cpu1:37003)ScsiPath: 4695: Plugin 'NMP' claimed path 'vmhba38:C0:T0:L0'
2015-10-16T19:44:09.981Z cpu0:37002)usb-storage: detected SCSI revision number 0 on vmhba38
2015-10-16T19:44:09.981Z cpu0:37002)usb-storage: patching inquiry data to change SCSI revision number from 0 to 2 on vmhba38
2015-10-16T19:44:09.981Z cpu3:37003)ScsiUid: 273: Path 'vmhba38:C0:T0:L0' does not support VPD Device Id page.
2015-10-16T19:44:09.981Z cpu3:37003)VMWARE SCSI Id: Could not get disk id for vmhba38:C0:T0:L0
2015-10-16T19:44:09.981Z cpu3:37003)vmw_psp_fixed: psp_fixedSelectPathToActivateInt:479: Changing active path from NONE to vmhba38:C0:T0:L0 for device "Unregistered Device".
2015-10-16T19:44:09.981Z cpu3:37003)StorageApdHandler: 698: APD Handle Created with lock[StorageApd0x410897]
2015-10-16T19:44:09.981Z cpu3:37003)ScsiEvents: 501: Event Subsystem: Device Events, Created!
2015-10-16T19:44:09.982Z cpu3:37003)VMWARE SCSI Id: Could not get disk id for vmhba38:C0:T0:L0
2015-10-16T19:44:09.982Z cpu3:37003)ScsiDeviceIO: 7410: Get VPD 80 Inquiry for device "mpx.vmhba38:C0:T0:L0" from Plugin "NMP" failed. Not supported
2015-10-16T19:44:09.982Z cpu3:37003)ScsiDeviceIO: 7420: Get VPD 83 Inquiry for device "mpx.vmhba38:C0:T0:L0" from Plugin "NMP" failed. Not supported
2015-10-16T19:44:09.982Z cpu3:37003)ScsiDeviceIO: 7456: Get VPD 86 Inquiry for device "mpx.vmhba38:C0:T0:L0" from Plugin "NMP" failed. Not supported
2015-10-16T19:44:09.983Z cpu3:37003)ScsiDeviceIO: 6170: Could not detect setting of QErr for device mpx.vmhba38:C0:T0:L0. Error Failure.
2015-10-16T19:44:09.983Z cpu2:32787)NMP: nmp_ThrottleLogForDevice:2322: Cmd 0x1a (0x412e80846d40, 0) to dev "mpx.vmhba38:C0:T0:L0" on path "vmhba38:C0:T0:L0" Failed: H:0x0 D:0x2 P:0x0 Valid sense data: 0x5 0x24 0x0. Act:NONE
2015-10-16T19:44:09.983Z cpu2:32787)ScsiDeviceIO: 2338: Cmd(0x412e80846d40) 0x1a, CmdSN 0x89a from world 0 to dev "mpx.vmhba38:C0:T0:L0" failed H:0x0 D:0x2 P:0x0 Valid sense data: 0x5 0x24 0x0.
2015-10-16T19:44:09.984Z cpu3:37003)ScsiDeviceIO: 6684: Could not detect setting of sitpua for device mpx.vmhba38:C0:T0:L0. Error Failure.
2015-10-16T19:44:10.004Z cpu3:37003)ScsiDevice: 3443: Successfully registered device "mpx.vmhba38:C0:T0:L0" from plugin "NMP" of type 0
Leave a comment ?

63 Comments.

  1. This is a great article, great for tinkerers. Florian, way to go!

    Just had somebody asking me about this last week, now I know where to point him ;-)

  2. USB 3.0 devices detected as USB 2 in ESXi 6.0 and 5.5 | Virten.net - pingback on October 19, 2015 at 9:01 pm
  3. Newsletter: October 24, 2015 | Notes from MWhite - pingback on October 24, 2015 at 11:36 pm
  4. Great web site!
    Question,
    Is it possible to have more than one datastore on multiple usb drives?
    Thanks

  5. Thx mate! That worked seamlessly. Having HP ProLiantmicroserver with ESXi on SD-card and FreeNAS on USB :)

  6. [Bilder+Kommentare] HomeServer-Vorstellungsthread - Seite 44 - pingback on December 15, 2015 at 9:20 am
  7. Thanks for sharing, this is what I am looking for so I can pass all onboard SATA controller to FreeNAS.

    Just wondering if I stop the USB arbitrator, that means I won't be able to pass any usb to VMs(keyboard, mouse, etc), what's the workaround? (extra pcie usb card?)

    New to the ESXi world, still learning.

    • Yes. You can no longer use usb passthrough to connect usb devices to virtual machines. Of course you can simply enable the usb arbitration service after connecting the USB VMFS datastore. An extra PCIe usb card will not work as expected. It is also affected by the arbitration service like any other device.

      • Great discussion. So it would seem you're saying that even when using VT-d to pass an entire PCIe USB 3.0 adapter through to a VM such as I describe here https://tinkertry.com/usb3speed
        stopping the USB arbitrator would also stop the pass through of those USB 3.0 devices to the VM, correct? I'm just curious, as I'm not using that particular configuration any longer, yet found this conversation quite interesting.

      • Morning fgrehl

        Thanks for the reply, you're saying "you can simply enable the usb arbitration service after connecting the USB VMFS datastore."

        I'm trying to understand your statement, do you mean after I successfully create the USB VMFS datastore I can re-enable the usb arbitration service for device passthrough and at the same time the USB VMFS datastore attached will still function?

        Looks like I want to sell the cow and drink the milk at the same time :D

  8. Thanks for the great tips. After successfully creating a data storage in thumb drive, I made a reboot,then esxi didn't recognize the data storage any more and even not listed in /dev/disks, unless I stop the usb service from ssh,then reinsert it. Any idea?

  9. Add USB Disk As DataStore in ESXI 6.0 – Void Technology - pingback on January 12, 2016 at 4:44 pm
  10. ESX / ESXi - Hilfethread - Seite 199 - pingback on January 15, 2016 at 2:19 pm
  11. Hey man, appreciate your great guide! I just tested this with a new Kingston 3.0 32 GB Flash Drive I bought. I'm booting ESXi 6.x via another USB stick on my main rig. I was a little nervous running some of these partitioning commands but I was pretty certain I wouldn't mess up my dual boot MBR!

    Anyway, I managed to get the stick formatted with VMFS and it showed up in vSphere as usable disk storage! However, after rebooting it just showed the USB storage as 0 GB and greyed out in vSphere. I was hoping since I kept the USB stick in the same slot it would recognize it after a reboot. I stopped the USB arbitration service and then went back into vSphere but still didn't show it as usable disk storage. So, I ran ls /dev/disks/ and noticed it wasn't showing up at all for some reason.. So, I removed the USB and re-inserted it and it came up as mpx.vmhba40:C0:T0:L0 / mpx.vmhba40:C0:T0:L0:1

    When I first did the procedure you provided my USB stick was vmhba39... So, do you know why that happened and if their is any way I can keep it as vmhba39 or vmhba40 or whatever it is when I format it and put the file system on?

    Thanks for an awesome how-to!

  12. Hello, it's working very well. Just for you, the last line of USB-stick vmfs creation, you missed "/dev/disks/" before the unit ;o)

    Format the partition with VMFS5

    ~ # vmkfstools -C vmfs5 -S USB-Stick mpx.vmhba36\:C0\:T0\:L0:1

  13. It works ! thank you

    For noobs : replace the last line with :
    vmkfstools -C vmfs5 -S USB-Stick /dev/disks/mpx.vmhba39\:C0\:T0\:L0:1

    Good luck

  14. I know its a year later but it works. when looking for your end sector use this command the Arthur posted.

    eval expr $(partedUtil getptbl /dev/disks/mpx.vmhba34\:C0\:T0\:L0 | tail -1 | awk '{print $1 " \\* " $2 " \\* " $3}') - 1

  15. I want to know if it's possible to install ESXi and Datastore in the same USB DISK ?? like a HDD the ESXI boot and datastore in the same HDD ?

    Regards

  16. Hey brothers I'm following this tutorial but at the command:
    vmkfstools -C vmfs5 -S USB-Stick /dev/disks/mpx.vmhba36\:C0\:T0\:L0:1

    I'm getting this error message:

    Error: vmkfstools failed: vmkernel is not loaded or call not implemented

    Please someone can throw me a bone here?

    Thanks in advance.

    • I known this problem from ESXi 5.x host only. Is this an ESXi 6 Host?
      The problem in 5.x is that some devices work, others not. I don't know why, but it's reproducible.

      • Thanks for answering, it's ESXi 5.1 host, any advice?

        • The problem in 5.x was that some devices work, others not. I've spent hours to figure out why, but never found a solution. It's 100% reproducible. The only solution you have is to try another USB device, or upgrade to 6.0 where all devices are working.

  17. Wanted to get your thoughts on this. I have ESXi 6.x installed to a USB 3.0 USB drive in my lab. When you format the local datastore (500GB local drive in my case) it creates the scratch partition on that drive. Without creating that scratch partition, you will see 4GB of RAM being eaten on your host for a RAMdrive for the Scratch Partition. Now my challenge is that I want to use the USB drive as the ESXi install drive and ALSO host the scratch partition there. I want to run VSAN in my lab, and I can't do that with the scratch partition on the datastore.

    So, thoughts on how I could get my system booting from the USB drive and also show up as a datastore so I could write the scratch partition to this?

  18. hi
    i have this error:

    Checking if remote hosts are using this device as a valid file system. This may take a few seconds...
    Creating vmfs5 file system on "mpx.vmhba41:C0:T0:L0" with blockSize 1048576 and volume label "USB-Stick".
    /dev/disks/mpx.vmhba41:C0:T0:L0: Permission denied. (Have you set the partition type to 0xfb?)
    Error: Permission denied

  19. Amazing article, was able to attach my 2TB USB 3.0 disk as a VMFS datastore thanks to this !

  20. How long does this usually take? my backup seems to take forever.

  21. Hi,

    Thanks for this post.

    I did exactly similar steps, and my usb drive can be seen in the devices section on vsphere client (as mounted ). However, I can not see it under the datastores section.

    it only shows the other usb drive in datastores section, which has the esxi host installed on it !

    When i try to add a new datastore it shows up the option of local hard disk, which i do not want to touch. I want to run my VM on this external usb drive that can not be seen as datastore on vsphere client.

    Can you suggest something here ? I did not get any errors while mounting the usb drive on esxi host as per steps mentioned above

    Thanks

  22. Hi,

    I followed the steps above and can see my USB3 drive in datasores. But I'm not able to use a USB dongle in the VMs.

    I restarted usbarbitrator and reboot the server and now I see the dongle, but not the drive.

    Isn't it possible to use both?

    Regards
    Thiemo

  23. Thank you man.

  24. [Sammelthread] ZFS Stammtisch - Seite 277 - pingback on July 29, 2016 at 7:59 pm
  25. Thanks Bro

    Great tutorial it helps me a lot in my VM infra

    Thanks

  26. How To: Create A VMFS5 Datastore On A USB Drive | iThinkVirtual™ - pingback on August 14, 2016 at 11:45 pm
  27. I couldn't find my device so I ran "fdisk -l" without the external HDD plugged in then plugged in the external HDD and ran "fdisk -l" again.
    I compared the results and found this, which also matched my expectations of 1TB HDD:

    ***
    *** The fdisk command is deprecated: fdisk does not handle GPT partitions. Please use partedUtil
    ***

    Disk /dev/disks/mpx.vmhba41:C0:T0:L0: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/disks/mpx.vmhba41:C0:T0:L0p1 1 121602 976759808 7 HPFS/NTFS
    Found valid GPT with protective MBR; using GPT

  28. Hi. I tried this as well with my external SSD on USB. I can see adapter, seems that I can do the partition. But on the last step, i get an error :
    Usage: vmkfstools -C [vmfs5|vfat] /vmfs/devices/disks/vml... or,
    vmkfstools -C [vmfs5|vfat] /vmfs/devices/disks/naa... or,
    vmkfstools -C [vmfs5|vfat] /vmfs/devices/disks/mpx.vmhbaA:T:LRazz
    Error: Connection timed out
    Any idea for me? It is shown now in esx, but also there I cannot format :-(

  29. Excellent! This is great for using a USB drive as a ghettoVCB backup destination! I needed such a solution and happened to find this great article. Works like a charm

    You rock... and damn you're clever.

  30. This is a great post, however, fell short of my desired goal. I managed to get the USB to present as a Datastore but as soon as I started the arbitrator service again it went. My Plex library is presented to to the VM over USB and it seems I cant have the best of both worlds :-(

  31. Thanks for this great write-up!

    This has worked fantastic for six months, but suddenly two USB disks in my datastore are unavailable - instead they are visible as usb-storage - like shown here:
    https://dl.dropboxusercontent.com/u/21766330/USB2.png

    The USB-enclosure works fine and the disks show no errors?

    In the datastore the usb-disks are visible as extents:
    https://dl.dropboxusercontent.com/u/21766330/USB1.png

    Here's how one of the(now) usb-disks are presented:
    https://dl.dropboxusercontent.com/u/21766330/USB3.png

    Any clues? Is there a remedy?

  32. Very good post, and I got 25% (1 of 4) of my USB Drives working. :)

    I have 1x 2TB-SSD and 3x 4TB-HD, that I want to use as datastores.
    - the SSD is working fine, with this method. I can reboot the host and everything still works. :)

    But the 3x HD's is a different story.

    All drives is giving errors in the log, but the 2TB-SSD is working, and I can also see the drive under /dev/disks/.

    I've partitioned the 2TB-SSD, as described in this post, and it is working great.

    Now to the 3x 4TB-HD's. They are also giving errors in the log, but unlike the SSD they are not showing the size of the drive. I have tried to disconnect all 4x drives, and use fdisk (ubuntu) to ensure I have the same content, and still only the SSD is working and showing it's size.
    - See below from # ls -la /dev/disks/


    -rw------- 1 root root 0 Oct 13 22:47 mpx.vmhba32:C0:T0:L0
    -rw------- 1 root root 2000398934016 Oct 13 22:47 mpx.vmhba33:C0:T0:L0
    -rw------- 1 root root 0 Oct 13 22:47 mpx.vmhba34:C0:T0:L0
    -rw------- 1 root root 0 Oct 13 22:47 mpx.vmhba35:C0:T0:L0

    I've tried to connect 1 HD at the time, tried different USB3 ports. Non of this helped.

    I thought this might be a special thing for "non-SSD", to I attached older HD's of different brands. Some of them is also showing size=0, and others is showing correctly with 1TB and 2TB.
    - So it seems there is something unique with the 3x drives here (Seagate Expansion models) that is causing the ESXi6 to just display "0" as the size.

    My question here is, how do I get the 3x 4TB-HD's working?
    - Anyone that can help me with some good ideas here, of how to fix this? :)

    Alternatively, I'm also interested in presenting my 1x 2TB-SSD and 3x 4TB-HD directly (raw) to an Ubuntu VM, as this is my file server. :)
    - What might be possible, best and easiest.

    Johnny

  33. Hei guys,
    I have an urgent request.
    After step 6 (the partedUtil) command I get the error "device has zero length and can't possibly store a file-system.."
    My external device is "WD Elements 25A3" with 3TB.
    I've googled this problem and found out that this device is not compatible with my VMWare ESXI 6.
    Do you know any external drive that is compatible?

  34. we are trying to connect a Seagate expansion 8TB desktop external hard drive
    usb 3.0 to the EXSI

    https://www.amazon.com/Seagate-Expansion-Desktop-External-STEB8000100/dp/B01HAPGEIE/ref=sr_1_1?ie=UTF8&qid=1477504014&sr=8-1&keywords=seagate+8tb+hard+drive

    But at the stage 6 we get an error saying "the device has zero length"
    Is it because this drive is not supported or any other reason ?

  35. Please help,
    we are also facing the problem like

    "The device /dev/disks/mpx.vmhba33:C0:T0:L0 has zero length, and can't possibly store a file system or partition table. Perhaps you selected the wrong device?
    Unable to get device /dev/disks/mpx.vmhba33:C0:T0:L0"

    At the stage 5 we can see the device.

  36. A great post,
    my question is can we make 1partition 2gb as esxi bootable and remaining partition as vmfs5 to transfer the data ?

  37. Esxi6.5 completely rejected USB Storage.
    In esxi6.0 esxi can be installed directly in the USB Storage, and then directly in the web space in the remaining space to create VMFS, but esix6.5 upgrade to the device partition can see VMFS, esxi6.5 will not mount it .

  38. @ gamexg
    Where did you get the information for that?
    I've only read that devices with over 2TB aren't compatible

  39. I also tried an 8TB drive (External Trancend), but received a different error message. (The message said that the partitioning tool did not properly support 4094 byte cluster disks).

  40. Followed the steps and the device showed up but it said 0 length. TI should be 4 TB

    0 Dec 10 07:24 mpx.vmhba39:C0:T0:L0

  41. Hi,

    I am getting "Permission denied" error in the last step. Here is the error message :

    [root@localhost:~] vmkfstools -C vmfs5 -S USB-ISO /dev/disks/mpx.vmhba33\:C0\:T0\:L0:1
    create fs deviceName:'/dev/disks/mpx.vmhba33:C0:T0:L0:1', fsShortName:'vmfs5', fsName:'USB-ISO'
    deviceFullPath:/dev/disks/mpx.vmhba33:C0:T0:L0:1 deviceFile:mpx.vmhba33:C0:T0:L0:1
    ATS on device /dev/disks/mpx.vmhba33: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...
    Creating vmfs5 file system on "mpx.vmhba33:C0:T0:L0:1" with blockSize 1048576 and volume label "USB-ISO".
    /dev/disks/mpx.vmhba33:C0:T0:L0:1: Permission denied. (Have you set the partition type to 0xfb?)
    Error: Permission denied

    Can anyone help me on this?

    Best Regards,
    Prashant

  42. Hi, I can confirm that it works on ESXi 6.5!
    It has different naming convention of /dev/disk.
    For example:


    ls /dev/disks/
    .
    .
    .
    t10.JMicron_USB_to_ATA2FATAPI_bridge
    t10.JMicron_USB_to_ATA2FATAPI_bridge:1

    So first I have created the VMFS partition on whole device:

    partedUtil mklabel /dev/disks/t10.JMicron_USB_to_ATA2FATAPI_bridge gpt

    partedUtil getptbl /dev/disks/t10.JMicron_USB_to_ATA2FATAPI_bridge
    gpt
    60801 255 63 976773168

    partedUtil setptbl /dev/disks/t10.JMicron_USB_to_ATA2FATAPI_bridge gpt "1 2048 976768064 AA31E02A400F11DB9590000C2911D1B8 0"

    then I have did following to file system USB drive:

    vmkfstools -C vmfs5 -S USB-Stick /dev/disks/t10.JMicron_USB_to_ATA2FATAPI_bridge:1

    If I wouldn't type :1 at the end, it will fail with this error:


    /dev/disks/t10.JMicron_USB_to_ATA2FATAPI_bridge: Permission denied. (Have you set the partition type to 0xfb?)

    So watch carefully what do you have in device list!

    • MyKE,

      thank you so much!!!!

      with your little but fundamental detail ':1' you made my day !
      Now i can see my external HD as datastore.

      I guess in this case it possible to apply the rule :

      "there are 10 types of people in this world, those who understand binary
      and those who dont" :-)

      thank you again, Bruno.

  43. Hi,

    thanks for this great article.
    Anyway i get same error of Prashant while formatting :

    - ATS on device ... not supported
    and
    - Permission denied. (Have you set the partition type to 0xfb?)

    any help is more than appreciated,
    Bruno.

    [root@localhost:~] vmkfstools -C vmfs5 -S EXT-Ina /dev/disks/mpx.vmhba33\:C0\:T0\:L0
    create fs deviceName:'/dev/disks/mpx.vmhba33:C0:T0:L0', fsShortName:'vmfs5', fsName:'EXT-Ina'
    deviceFullPath:/dev/disks/mpx.vmhba33:C0:T0:L0 deviceFile:mpx.vmhba33:C0:T0:L0
    ATS on device /dev/disks/mpx.vmhba33:C0:T0:L0: not supported
    .
    Checking if remote hosts are using this device as a valid file system. This may take a few seconds...
    Creating vmfs5 file system on "mpx.vmhba33:C0:T0:L0" with blockSize 1048576 and volume label "EXT-Ina".
    /dev/disks/mpx.vmhba33:C0:T0:L0: Permission denied. (Have you set the partition type to 0xfb?)
    Error: Permission denied

  44. Thanx bro,
    Great article its work for me

  45. How can I find the start of the partition if is not The starting at sector 2048 ?
    I want to create a datastore using the rest free space from an a SD card where esxi 6.5 is installed. I want to use that datastore to store ISO images and vm templates for my home lab.

    • Never done that but you can print the partition table with partedUtil getptbl /dev/disks/.... The third number for each partition entry is the end sector. Just add +1 and you have your new start sector.

      • Thank you for the reply. I'll try it and give an update if it worked.

        • I tried but I get :

          [root@localhost:~] partedUtil setptbl /dev/disks/mpx.vmhba35:C0:T0:L0 gpt "10 7086080 15518789 AA31E02A400F11DB9590000C2911D1B8 0"
          gpt
          0 0 0 0
          10 7086080 15518789 AA31E02A400F11DB9590000C2911D1B8 0
          Error: Read-only file system during write on /dev/disks/mpx.vmhba35:C0:T0:L0
          SetPtableGpt: Unable to commit to disk

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>