Gordan Bobic <[email protected]> wrote:
>If you are using an image, please make sure you do:
>
>dd if=/dev/zero of=/scrub bs=8MB; rm -f /scrub
>
>before you create the image to zero out the free space.

I wrote the zerofree utility for just this sort of thing.  It looks
for non-zero free blocks in an ext2/3/4 filesystem and zeroes them.
Because it doesn't write to blocks that are already zeroed it can be
more efficient than using dd.  It only works on unmounted (or read-only)
filesystems, though.

My write-up on zerofree is here:

   http://intgat.tigress.co.uk/rmy/uml/sparsify.html

For the terminally impatient:

   # e2fsck -f /dev/sdx1
   # zerofree -v /dev/sdx1
   # e2fsck -f /dev/sdx1

The -v flag shows progress and prints the number of blocks zeroed,
total free blocks and total blocks at the end of the process.  Use '-n
-v' to perform a dry run to see if it's worth bothering to zero a given
filesystem.

It's available in the standard repositories for Fedora and Debian, plus
EPEL for CentOS/RHEL 5, though not 6.  I really ought to make an RPM
for 6.

Ron
_______________________________________________
users mailing list
[email protected]
http://lists.redsleeve.org/mailman/listinfo/users

Reply via email to