Reclaim Disk Space by Shrinking Files.
Sandeep Sahore · ;login:: the magazine of USENIX & SAGE · 2008
The source for cfsize.c may be found at http:// www.usenix.org/publications/login/2008-10/ cfsize.c. s y s a d m i n s f r o m t i m e t o t i m e a r e faced with the problem of reclaiming disk space, a problem that lurks in the shadows waiting to buzz the pager into life. The typical response is either to remove files or to compress them, or to invoke some combination of the two approaches. But there are many situations where the choice is not so cut-and-dried. Let’s say there is a file filling up a storage partition that cannot be removed because its data should be kept for a rolling window of one year or because its contents are sensitive or because it is being held open by a process. In such cases it is better to shrink the file in size instead of removing or compressing it.