[NTLUG:Discuss] filling empty partition space with zeros
Kenneth Loafman
kenneth at loafman.com
Tue Feb 17 12:11:49 CST 2009
Ed Leach 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.)
If you have data on the partition, this is probably the only way.
You'll need to do it as root to zero the reserved portion as well.
If its empty, then just 'dd if=/dev/zero of=/dev/sdn' where n is the
partition number. You'll need to run 'mkfs /dev/sdn' again, but the
partition will be clear.
...Ken
More information about the Discuss
mailing list