[NTLUG:Discuss] filling empty partition space with zeros

terry trryhend at gmail.com
Wed Feb 18 09:03:12 CST 2009


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. From this page:
>
>    http://bbs.archlinux.org/viewtopic.php?id=64150
>
> I see this suggestion:
>
>    dd if=/dev/zero of=/path/to/partition/zerofill.tmp & rm
> /path/to/partition/zerofill.tmp
>
> I think I would have said
>
>    "/path/to/file/on/mounted/partition/zerofill.tmp"
>
> rather than his example.
>
> Before I really hurt myself -
>
> Is this the best, safest way to do it? (Security is  not a concern.)
>
> Thanks,
>
> Ed
>
>
>
>
>
>
>
>

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...)

If the partition was the second one on the first IDE device, it would
go like this:

   dd if=/dev/zero of=/dev/hda2

Now if  you just want to wipe the whole drive:

   dd if=/dev/zero of=/dev/hda

-- 
<><



More information about the Discuss mailing list