Deleting files is not enough however because when you a delete file it only deletes the directory entry for the file, all the "1's and 0's" stay as they were before and therefore cannot be efficiently shrunk.
Run this command to fill all empty space on each drive with zero's.
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill
Note: if you have more than one virtual disk you will need to run this command from within any directory on the mounted disk.
Shut down the guest and log on to the host server.
Change directory (cd) to where the virtual machines vmdk files are located.
Use the vmware-vdiskmanager command to shrink the disk(s).
vmware-vdiskmanager -k sda.vmdk
When this completes, check the size of your vmdk files and they should now be considerably smaller!
No comments:
Post a Comment