One way to reclaim storage space is overwrite the dead space with zeros and then get rid of them.
One thing to keep in mind that when you write zeros to the disk/LUN it will grow to full size.
Sdelete – free tool from Microsoft that can be used to write zeros to disks.
Command: sdelete -z E:\
Raxco PerfectDisk – a commercial tool to intelligently overwrite dead space with zeros.
Condusiv V-locity – a commercial tool to overwrite dead space with zeros.
dd – is a command-line utility for Unix and Unix-like operating systems which can be used to copy disks and files.
Command: dd if=/dev/zero of=/home/zerofile.0 bs=1M
Getting rid of zeros in VMware level
Zeros can be removed using Storage vMotion. When performing Storage vMotion thin must be selected and the source and destination datastores have to have different block size. I have used following combinations:
VMFS5 -> select thin -> VMFS3 (8MB block) -> VMFS5
VMFS5 -> select thin -> NFS -> VMFS5
Reclaim zeros in array level
Different arrays support zero space reclamation in different ways. Check your vendor documents how exactly accomplish this.
Command can be executed to reclaim zero space from a LUN.
Solution Enabler command example: symconfigure -cmd “start free on tdev <TDEVID> start_cyl=0 end_cyl=last_cyl type=reclaim;” commit -sid <SID>
Zero space from LUN can be reclaimed by running “Reclaim Zero Pages” from Hitachi Command Suite.
Performing LUN migration will reclaim zero space from LUN. In addition compressing and then uncompressing the LUN will also discard zeros.
Any array that supports inline compression and/or deduplication will probably reclaim any zero space during write operation.
Other posts in this series: