From: Ron Yorston <rmy@ti...> - 2004-04-19 09:44:20
I've been looking at what it takes to keep filesystem images and COW
files sparse. Such files usually start out sparse but get filled
with stuff: real data and deleted data. The deleted data still takes
up space in the underlying filesystem, and it would be nice to get it
I've written a couple of utilities: zerofree can be run on an unmounted
ext2 filesystem image to fill blocks on the free list with zeroes;
sparsify can make any file on an unmounted ext2 filesytem which has
blocks of zeroes into a sparse file.
One promising looking thing is the 'ext2fs privacy (i.e.secure deletion)
patch' which was discussed on the Linux kernel mailing list recently.
It's really intended for security, but it has the happy side effect of
keeping blocks in the free list full of zeroes. A UML kernel with this
patch would make it much easier to keep filesystem images sparse.
Some notes and source code are on my website: