{"id":925,"date":"2021-02-11T23:48:35","date_gmt":"2021-02-11T23:48:35","guid":{"rendered":"http:\/\/labiol.xyz\/?p=925"},"modified":"2021-02-11T23:49:10","modified_gmt":"2021-02-11T23:49:10","slug":"vmkfstools-command-options","status":"publish","type":"post","link":"https:\/\/www.labiol.xyz\/index.php\/2021\/02\/11\/vmkfstools-command-options\/","title":{"rendered":"vmkfstools &#8211; command options"},"content":{"rendered":"\n<p>Inspiration for today&#8217;s article is a fantastic documentation of the vmkfstools founded here:<a href=\"https:\/\/docs.vmware.com\/en\/VMware-vSphere\/7.0\/com.vmware.vsphere.storage.doc\/GUID-0AC9C948-4D0A-4634-99B8-E10CC09EFE47.html\"> https:\/\/docs.vmware.com\/en\/VMware-vSphere\/7.0\/com.vmware.vsphere.storage.doc\/GUID-0AC9C948-4D0A-4634-99B8-E10CC09EFE47.html<\/a><\/p>\n\n\n\n<p>vmkfstools is a cli command you can find on every ESXi host. As with everything but you always need to be careful when using it because you can potentially easily delete or mess around with your virtual system files.&nbsp;<\/p>\n\n\n\n<p>But from the other side, it is a really powerful, irreplaceable command.<br>vmkfstools in vsphere version 7 looks like it is on steroids.<br>Again, you can find most of the info in VMware doc but I just wanted to point out some of the most important information to start with this tool.<\/p>\n\n\n\n<p>First of all, the file\/disk type you can operate is zeroedthick, eagerzeroedthick, thin, rdm (virtual mode rdm), rdmp (physical compatibility rdm), 2gbsparse.<\/p>\n\n\n\n<p>The last disk type, 2gbsparse you need to convert, when you are migrating virtual system from workstation (ie VMware fusion, windows VMware workstation) to ESXi. Such can\u2019t be easily migrated as VM can\u2019t start with 2gbsparse.&nbsp;<\/p>\n\n\n\n<p>Since I mention about converting, the following command can be used:<\/p>\n\n\n\n<p><code>vmkfstools -i OLD_DISK -d NEW_DISK_TYPE NEW_DISK<\/code>, where:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>OLD_DISK &#8211; is the full path to the disk you want to clone WITH the disk itself<\/li><li>NEW_DISK &#8211; is the full path to the output disk<\/li><li>NEW_DISK_TYPE is one of the following:<ul><li>thin<\/li><li>zeroedthick<\/li><li>eagerzeroedthick<\/li><li>rdm:device<\/li><li>rdmp:device<\/li><li>2gbsparse<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>Some additional information can be found: <a href=\"https:\/\/docs.vmware.com\/en\/VMware-vSphere\/7.0\/com.vmware.vsphere.storage.doc\/GUID-01D3CF47-A84A-4988-8103-A0487D6441AA.html\">https:\/\/docs.vmware.com\/en\/VMware-vSphere\/7.0\/com.vmware.vsphere.storage.doc\/GUID-01D3CF47-A84A-4988-8103-A0487D6441AA.html<\/a><\/p>\n\n\n\n<p><strong>Above command should be used above the \u201cunix\u201d style cp command, as cp will always create a non-thin disk and is not optimized.<\/strong><\/p>\n\n\n\n<p>Other most frequently used option will be to rename disk:<\/p>\n\n\n\n<p><code>vmkfstools -E OLD_DISK NEW_DISK<\/code> \u2192 please just remember about the full path. It is valid everywhere in this document.&nbsp;<\/p>\n\n\n\n<p>Remove disk (be carefull, as this command will not ask twice):&nbsp;<\/p>\n\n\n\n<p><code>vmkfstools -U DISK<\/code><\/p>\n\n\n\n<p>Change file to thin format with:<\/p>\n\n\n\n<p><code>vmkfstools -K DISK<\/code><\/p>\n\n\n\n<p>This command will remove all zero blocks. This means that before it could be worth cleaning and zeroing the OS file system. Another topic is UNMAP, that would be probably better option for you &#8211; but not always possible.<\/p>\n\n\n\n<p>With option -x you can check filesystem (and repair it)&nbsp;<\/p>\n\n\n\n<p><code>vmkfstools -x check(repair) DISK<\/code><\/p>\n\n\n\n<p>Check the snapshot chain, to determine if any of the parietal snapshot are corrupted:<\/p>\n\n\n\n<p><code>vmkfstools -e DISK<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Inspiration for today&#8217;s article is a fantastic documentation of the vmkfstools founded here: https:\/\/docs.vmware.com\/en\/VMware-vSphere\/7.0\/com.vmware.vsphere.storage.doc\/GUID-0AC9C948-4D0A-4634-99B8-E10CC09EFE47.html vmkfstools is a cli command you can find on every ESXi host. As with everything but you always need to be careful when using it because you can potentially easily delete or mess around with your &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-925","post","type-post","status-publish","format-standard","hentry","category-vmware"],"_links":{"self":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts\/925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=925"}],"version-history":[{"count":4,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts\/925\/revisions"}],"predecessor-version":[{"id":929,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts\/925\/revisions\/929"}],"wp:attachment":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}