{"id":3145,"date":"2023-11-17T10:57:19","date_gmt":"2023-11-17T10:57:19","guid":{"rendered":"https:\/\/blog.designed79.co.uk\/?p=3145"},"modified":"2023-11-17T13:30:54","modified_gmt":"2023-11-17T13:30:54","slug":"esxi-create-vmfs-datastore-on-usb-drives","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=3145","title":{"rendered":"ESXi Create VMFS Datastore on USB drives"},"content":{"rendered":"<ol>\n<li>Connect to the ESXi host with SSH<\/li>\n<li>Stop the USB\u00a0arbitrator service. This service is used to\u00a0passthrough USB device from an ESX\/ESXi host to a virtual machine. (When disabling it, you can no longer passthrough USB devices to VMs)\n<pre>~ # \/etc\/init.d\/usbarbitrator stop<\/pre>\n<\/li>\n<li>(optional) Use this command to permanently disable the USB\u00a0arbitrator service after reboot.\n<pre>~ # chkconfig usbarbitrator off<\/pre>\n<\/li>\n<li>Get the device list :\n<pre>~ # ls \/dev\/disks\/<\/pre>\n<\/li>\n<li>Plug in the USB Device to your ESXi host<\/li>\n<li>Get the device identifier (mpx.vmhbaXX). You should see the USB Device in \/dev\/disks\/ it will be the new device compared to step 4:\n<pre>~ # ls \/dev\/disks\/<\/pre>\n<\/li>\n<li>Write a GPT label to the device (Assuming that the Device ID is <strong>mpx.vmhba36<\/strong>)\n<pre>~ # partedUtil mklabel \/dev\/disks\/mpx.vmhba36 gpt<\/pre>\n<\/li>\n<li>To create a partition you need to know the start sector, end sector, which depends on the device size and the GUID.<br \/>\nThe start sector is always <strong>2048<\/strong><br \/>\nThe GUID for VMFS is <strong>AA31E02A400F11DB9590000C2911D1B8<br \/>\n<\/strong>The end sector can be calculated with the following formula (Use the numbers from getptbl):<\/p>\n<pre>~ # partedUtil getptbl \/dev\/disks\/mpx.vmhba36\r\ngpt\r\n1947 255 63 31293440<\/pre>\n<p>1947 * 255 * 63 &#8211; 1 =\u00a0<strong>31278554<\/strong><\/p>\n<p>You can also calculate the endsector with the following command:<\/p>\n<pre>~ # eval expr $(partedUtil getptbl \/dev\/disks\/mpx.vmhba36 | tail -1 | awk '{print $1 \" \\\\* \" $2 \" \\\\* \" $3}') - 1\r\n31278554<\/pre>\n<\/li>\n<li>Create the VMFS partition (Replace with your endsector)\n<pre>~ # partedUtil setptbl \/dev\/disks\/mpx.vmhba36 gpt \"1 2048 31278554 AA31E02A400F11DB9590000C2911D1B8 0\"<\/pre>\n<\/li>\n<li>Format the partition with VMFS5\n<pre>~ # vmkfstools -C vmfs5 -S USB-Stick \/dev\/disks\/mpx.vmhba36:1<\/pre>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/blog.designed79.co.uk\/wp-content\/uploads\/2023\/11\/How-to-add-a-USB-Disk-as-VMFS-Datastore-in-ESXi-6.7-IT-REACT.pdf\">How to add a USB Disk as VMFS Datastore in ESXi 6.7 &#8211; IT-REACT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Connect to the ESXi host with SSH Stop the USB\u00a0arbitrator service. This service is used to\u00a0passthrough USB device from an ESX\/ESXi host [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3145","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/3145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3145"}],"version-history":[{"count":3,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/3145\/revisions"}],"predecessor-version":[{"id":3149,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/3145\/revisions\/3149"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}