{"id":108,"date":"2011-02-17T11:11:16","date_gmt":"2011-02-17T11:11:16","guid":{"rendered":"http:\/\/songoku.homelinux.com\/wordpress\/?p=108"},"modified":"2011-02-17T11:11:16","modified_gmt":"2011-02-17T11:11:16","slug":"how-to-shrink-a-vmdk-file-in-esx","status":"publish","type":"post","link":"https:\/\/ndk.sytes.net\/wordpress\/?p=108","title":{"rendered":"How to Shrink\/Resize a VMDK file in ESXi"},"content":{"rendered":"<p>\n\t** Use this technique at your own risk. I do not and will not take responsibility for your corrupted vmdk&rsquo;s as a result of following this process, whether correctly or incorrectly **\n<\/p>\n<p>\n\tIf you have ever taken a look at the descriptor file for a vmdk file, you will the &ldquo;Extent description&rdquo; section:\n<\/p>\n<p>\n\t# Extent description<br \/>\n\tRW 52428800 VMFS &ldquo;foo-flat.vmdk&rdquo;\n<\/p>\n<p>\n\tThe value between &lsquo;RW&rsquo; and &lsquo;VMFS&rsquo; is the size of disk when divided by 512 and is in bytes:\n<\/p>\n<p>\n\t52428800 * 512 = 26843545600 (25G)\n<\/p>\n<p>\n\t-rw&mdash;&mdash;- 1 root root 26843545600 Sep 18 19:10 foo-flat.vmdk<br \/>\n\t-rw&mdash;&mdash;- 1 root root 370 Sep 18 19:11 foo.vmdk\n<\/p>\n<p>\n\tIf you want to shrink (or increase) the size of your vmdk file, alter this value in the descriptor file to reflect your new desired size*. You can do with this &lsquo;vi&rsquo; or &lsquo;nano&rsquo;:\n<\/p>\n<p>\n\t* For this example we will to shrink the disk to 12.5G\n<\/p>\n<p>\n\t# Extent description<br \/>\n\tRW 26214400 VMFS &ldquo;foo-flat.vmdk&rdquo;\n<\/p>\n<p>\n\tAfter making this change you can use &lsquo;vmkfstools -i&rsquo; to clone this disk:\n<\/p>\n<p>\n\t# vmkfstools -i foo.vmdk -d thin foo_1.vmdk<br \/>\n\tDestination disk format: VMFS thick<br \/>\n\tCloning disk &lsquo;foo.vmdk&rsquo;&hellip;<br \/>\n\tClone: 100% done.\n<\/p>\n<p>\n\tYou will discover that the cloned disk now reflects the new size of 12.5G:\n<\/p>\n<p>\n\t-rw&mdash;&mdash;- 1 root root 13421772800 Sep 18 19:13 foo_1-flat.vmdk<br \/>\n\t-rw&mdash;&mdash;- 1 root root 372 Sep 18 19:13 foo_1.vmdk<br \/>\n\t-rw&mdash;&mdash;- 1 root root 26843545600 Sep 18 19:10 foo-flat.vmdk<br \/>\n\t-rw&mdash;&mdash;- 1 root root 370 Sep 18 19:11 foo.vmdk\n<\/p>\n<p>\n\tthe -d parameter defines the disk type: zerothick, thin etc.\n<\/p>\n<p>\n\tsource: <a href=\"http:\/\/professionalvmware.com\/2009\/09\/how-to-shrink-a-vmdk-file-in-esx\/\" target=\"_blank\">http:\/\/professionalvmware.com\/2009\/09\/how-to-shrink-a-vmdk-file-in-esx\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>** Use this technique at your own risk. I do not and will not take responsibility for your corrupted vmdk&rsquo;s as a result of following this process, whether correctly or incorrectly ** If you have ever taken a look at the descriptor file for a vmdk file, you will the &ldquo;Extent description&rdquo; section: # Extent [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-108","post","type-post","status-publish","format-standard","hentry","category-servers"],"_links":{"self":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=108"}],"version-history":[{"count":0,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/108\/revisions"}],"wp:attachment":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}