Zeroing free space?
I've been working on creating an install of Gentoo Linux that will be imaged to multiple machines on the network. I have a machine here that had multiple hard drive bays, so all that needs to be done is something like:
dd if=/dev/hda bs=256k | tee /dev/hdb /dev/hdc /dev/hdd ... > /dev/null
Once the image is completed and mirrored to all the hard drives, I would like to backup the image for storage by doing something like:
dd if=/dev/hda1 bs=256k | tar -c linux_image_hda1.tar
dd if=/dev/hda2 bs=256k | tar -c linux_image_hda2.tar
But I worry that all free disk space on the disk is filled with random characters instead of zeros...due to me not doing a "dd if=/dev/zero of=/dev/hda" at the start of the project.
So, the question: is there a utiltity that will put zeros into the disk (or partition) where free space exists? Or....does ext2 and ext3 do that automatically when files are removed from the disk and I have nothing to worry about?
I know that zeroing the freespace isn't entirely necessary, but since I'm tarring the partition, a bunch of zeros will compress a lot nicer than a bunch of random characters.
Thanks,
Ryan Barnard
|