Sterilizing free space

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Jan 3 16:08:00 UTC 2006


On Mon, Dec 26, 2005 at 04:54:22PM -0500, Sy Ali wrote:
> I can nicely sterilize a complete drive with shred -n 2 -z -v
> /dev/<device> however I don't know how to do a partition or just the
> slack space on a drive.
> 
> This bails out with a complaint about running out of disk space,
> before completing its first pass:
> shred -n 2 -z -v /dev/<partition>

Maybe it has bugs and doens't get the size correct of the device.

> The only solutions I've come across deal with an entire drive:
> dd if=/dev/zero of=/dev/<device>
> http://dban.sourceforge.net/

Still pretty effective but not the same.

dd if=/dev/random of=/dev/device might be good, but much slower
obviously.

To clearn free disk space try this:

dd if=/dev/zero(or random) of=/mount/to/filesystem/junkfile

When it stops, the disk is full and there is one large file you can
delete which has written to all free blocks.

There is also a tool called 'wipe' on debian that seems similar to
shred.  No idea if it is better or not.  Of course these tools don't
work for erasing a file on many filesystems, but erasing the file and
then filling all free space does a decent job, although takes much
longer.

Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list