1

Тема: Unix: Reclaim unused space on thin provisioned disk?

Hi Guys,



What you probably need to do first is to write zeros to the freespace on each of the Linux filesystems to make VMware or storage thin provisioning mechanism think the blocks were not touched and contain no data (all zeros).



1. Classic approach

I think, you might want to look at:

dd utility method decribed here:

http://www.michaelcole.com/node/13

the command you need is this one:



sudo dd if=/dev/zero of=/zerofile; sudo rm /zerofile



It created a file filled with zeros to make the filesystem full (out of space) and then deletes the file, resulting in a free space zeroed for you. Repeat for every filesystem.





2. Scrub

Please also look at the scrub utility (probably with -X option)  that is available on Linux:

Man pages and some examples:

http://linux.die.net/man/1/scrub

http://www.bgevolution.com/blog/scrub-f … for-linux/





3. Zerofree (Debian/Ubuntu)

Have also a try with zerofree utility that should be availalbe on Debian and Ubuntu based distros. Beware - it is slow.

http://manpages.ubuntu.com/manpages/nat … ree.8.html

http://community.linuxmint.com/software/view/zerofree

http://maketecheasier.com/shrink-your-v … 2009/04/06



4. Shred

You may also want to look at shred command, but it may not be what you really needed.

http://linux.die.net/man/1/shred



All of these are not as straightforward as sdelete (-c) used on Windows, but you should be able to make the first step.



The second step should be trying to convince the thin provisioning mechanism to compact the zeros. EMC's block compression available on CX4/VNX storage arrays would surely do it when you enable compression on a thick or thin LUN, squeezing all zeros out of it.



Regards,

oczkov