Reclaim disk space on VMware thin disk

    In a vSphere based virtualization environment we can mainly use two disk types(Thick & Thin).I hope you all know the difference between these two.

    To optimize our shared/Direct attached storage we can use thin disk. But the problem is even we delete the data from os level . It will not reclaim automatically from the storage.

    To overcome this issue we have two options.

    1. Use third party tool(if it’s a Windows we can use sdelete) to zero-out the disk blocks and using vmkfstools we can shrink the disk
    2. Storage vMotion the virtual machine or VMDK to a datastore formatted with a different block size

    In this article we are going to showcase how to use sdelete & vmkfstools to this operation

    1.This vm we have two thin disks. We will use second disk for the our test case. Capacity of the disk is 3GB


    1. From the datastore we can see 80.47 GB free space


    1. We have copied some files to that second disk in the vm(this is windows 7 vm).now we have only 79.65 GB free space on datastore


    1. Now I’m removing data from the vm


    1. But still we have only 79GB free space in our datastore


    6.Now its time to use sdelete to zero-out the disk.sdelete is a free tool where we can download from microsoft site.


    1. Just ran the sdelete tool(syntact sdlete.exe -z e:) .E is the drive letter


    1. During this process it will consume total thin disk size from your datastore. Be careful, we should have enough space to run this tool


    1. Now we can use vmkfstool to shrink the vmdk(syntact vmkfstools -K w7_1.vmdk


    1. Now we can again see there is 84GB free space available



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: