{"id":290,"date":"2010-11-09T17:38:22","date_gmt":"2010-11-09T17:38:22","guid":{"rendered":"http:\/\/www.stevenwhiting.com\/blog\/?p=290"},"modified":"2010-11-17T20:12:58","modified_gmt":"2010-11-17T20:12:58","slug":"shrink-a-vmware-vmdk-virtual-disk","status":"publish","type":"post","link":"https:\/\/stevenwhiting.com\/blog\/?p=290","title":{"rendered":"Shrink a VMware .VMDK virtual disk"},"content":{"rendered":"<p>Ran into an issue recently with one of my VMs.  Wanted to back it up but was 200GB.  I knew there wasn&#8217;t that much data on it anymore, it had just grown to that.  But in Windows when you delete a file you don&#8217;t delete it really, Windows just flags it to be overwritten.<\/p>\n<p>You can use this tool first but don&#8217;t think it&#8217;s needed.  CCleaner and Fileshredder can do the same.  That is, wipe the free space while in Windows.<\/p>\n<p><a href=\"http:\/\/technet.microsoft.com\/en-ca\/sysinternals\/bb897443.aspx\">SDelete Sysinternals as MS<\/a> <\/p>\n<p>In Windows go to a CMD and to the location of sdelete and type<\/p>\n<p>sdelete -c<\/p>\n<p>That cleans the free space.  Then shut down the VM.<\/p>\n<p>Once shut down go to a CMD and go to where VMWARE is installed.  Mine is<\/p>\n<p>D:\\Program Files (x86)\\VMware\\VMware Workstation<\/p>\n<p>Then run vmware-vdiskmanager.exe to shrink the VM.  This is done with the -k switch.<\/p>\n<p>My VM was in a different location to the diskmanager tool so ended up like this<\/p>\n<p>vmware-vdiskmanager.exe -k &#8220;f:\\vm\\test lab\\xp.vmdk&#8221;<\/p>\n<p>Once you hit enter you should see a Shrink: 0%  meaning it&#8217;s started.  Could take a while.  I just left mine running while at work so don&#8217;t know how long it took.<\/p>\n<p>The &#8221; are needed it appears.<\/p>\n<p>It works great.  Mine went from 200GB to 26GB.<\/p>\n<p>This site helped with this discovery.<br \/>\n<a href=\"http:\/\/www.itstuff.ca\/2009\/06\/how-to-shrink-vmware-virtual-disk-files.html\"><br \/>\nhttp:\/\/www.itstuff.ca\/2009\/06\/how-to-shrink-vmware-virtual-disk-files.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ran into an issue recently with one of my VMs. Wanted to back it up but was 200GB. I knew there wasn&#8217;t that much data on it anymore, it had just grown to that. But in Windows when you delete &hellip; <a href=\"https:\/\/stevenwhiting.com\/blog\/?p=290\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[70,56],"class_list":["post-290","post","type-post","status-publish","format-standard","hentry","category-it-notes","tag-vmdk","tag-vmware"],"_links":{"self":[{"href":"https:\/\/stevenwhiting.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevenwhiting.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevenwhiting.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevenwhiting.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/stevenwhiting.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=290"}],"version-history":[{"count":2,"href":"https:\/\/stevenwhiting.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/290\/revisions"}],"predecessor-version":[{"id":331,"href":"https:\/\/stevenwhiting.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/290\/revisions\/331"}],"wp:attachment":[{"href":"https:\/\/stevenwhiting.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevenwhiting.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevenwhiting.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}