VMware: How to Shrink a Thin VMDK on ESXi 5.0
Many customer/service request we receive from
our client is..
is it possible to reduce the disk?
This means the files inside the VM, but the size
of the VMDK as well.
So I wanted
to shrink my VMDK size as much as possible. After cleaning up the VM
itself and running sdelete, it’s time to shrink the VMDK.
First let’s review the actual usage of it:
The virtual
disk size can be seen with ls –lh *.vmdk. In my example, I
have a 40 GB virtual size.
To
see the ‘real’ size of the vmdk, run du –h *.vmdk. This gives
us a 36 GB size (while the VM itself actually uses about 10
GB).
Issue the
command vmkfstools –punchzero VM.vmdk. This will take a
while so be patient (and oh yes, you VM must be powered off).
On a 40 GB
VMDK it took me about 10 minutes, but this will depend mostly on your SAN
speed.
After it’s
done, let’s re-issue du –h *.vmdk.
Nice, now
it’s actually 10.8 GB.
Comments
Post a Comment