[Techtalk] clean the swap partition

Devdas Bhagat devdas at dvb.homelinux.org
Tue Jan 18 02:41:51 EST 2005


On 16/01/05 15:19 -0600, ed orphan wrote:
> Is there a way to clean out the swap partition
> without re-formatting it? I'm thinking of something
> like a disk wipe that can be set to just one
> partition and does not wander. Or is there
> a simple command line instruction that will
> do the job?

Depending on your toolkit of choice, 
shred(1)

There are a few wipe utilities shipped with The Coroner's Toolkit, and
one with PGP.

A cheap way is dd if=/dev/zero of=/dev/hda3 bs=1M count=1024
(or whatever your swap partition is, the above invocation writes once to
a 1024 M partition in 1M steps). To be a little more secure, repeat
about 14 times with /dev/urandom and /dev/zero alternating.

The level of security you desire depends on who you are trying to defend
yourself from. Sometimes, magnets are the best form of defense (or a
drop from a high building on a concrete floor).

Devdas Bhagat


More information about the Techtalk mailing list