zero deleted blocks

Steven Schlansker stevenschlansker at gmail.com
Mon Aug 13 16:54:56 UTC 2012


On Aug 13, 2012, at 2:27 AM, Olivier Smedts <olivier at gid0.org> wrote:

> 2012/8/13 Petri Helenius <petri at helenius.fi>:
>> 
>> Hi,
>> 
>> Is it possible to have ZFS or UFS to zero out the deallocated blocks to facilitate VM disk compaction?
>> 
>> Pete
> 
> Did you try a classic "dd if=/dev/zero of=a-file-on-the-pool" ? This
> won't give good results if you do this on a filesystem with
> compression enabled.

ZFS uses copy on write (http://en.wikipedia.org/wiki/ZFS#Copy-on-write_transactional_model) so overwriting with zeroes will actually allocate new space to hold all the zeroed data and leave the old data mostly untouched.



More information about the freebsd-fs mailing list