[NTLUG:Discuss] filling empty partition space with zeros

Patrick R. Michaud pmichaud at pobox.com
Wed Feb 18 09:28:48 CST 2009


On Wed, Feb 18, 2009 at 09:03:12AM -0600, terry wrote:
> On Tue, Feb 17, 2009 at 9:45 AM, Ed Leach <ntlug at levelofdetail.com> wrote:
> >
> > I'd like to fill the empty space of an ext3 partition with zeros in
> > order to make it compress better. [...]
> > I see this suggestion:
> >
> >    dd if=/dev/zero of=/path/to/partition/zerofill.tmp & rm
> > /path/to/partition/zerofill.tmp
>
> Write zeros to the partition, not the mount point.
> (Probably shouldn't be mounted either, but I know know if it matters,
> someone else should comment on whether it should be mounted or not...
> but...)
> [...]
>    dd if=/dev/zero of=/dev/hda2

Note that the original request was to "fill the empty space with zeroes",
not "wipe the entire partition".  There's a significant difference.  :-)

In particular, filling the empty space with zeroes doesn't wipe out
any existing files on the partition.

Pm



More information about the Discuss mailing list