Re: Best way to ZERO a harddrive


Subject: Re: Best way to ZERO a harddrive
From: Christopher E. Brown (cbrown@woods.net)
Date: Thu Mar 28 2002 - 19:17:12 AKST


On Thu, 28 Mar 2002, Mike Barsalou wrote:
> I have some drives that I want to blank out. What is the best way to zero a
> harddrive?
>
> dd if=/dev/zero of=/dev/hdx

dd if=/dev/zero of=/dev/<sdx|hdx> bs=8192
or
dd if=/dev/zero of=/dev/<sdx|hdx> bs=1024k

Both of these will run much faster instead of the default 512 octet
blocks that dd uses, 8k or 1MB. Can speed up the wide by a factor of
10 or more.

As to the comment about using /dev/urandom as the input...
This is valid, but it depleats the entropy pool within a few moments.
It would be a good idea to increase the

echo 8192 > /proc/sys/kernel/random/poolsize

And allow entropy in the pool build for a time (greater that 16384) in
order to maintain a cryptographicly strong number stream.

        Unless doing a 16x overwrite there is little benefit from
using /dev/urandom, and *never* use /dev/random for this, as it is
only capable of producing a few thousand bytes at a time.

On a side note, it is not the best idea to depleat the entropy pool on
a network server. It is used for seeding things like sequence numbers
and for anti connection spoofing stuff. Until it rebuilds the system
will be very predictable.

urandom and random feed from the same pool, random producing truly
random numbers by tracking its draw vs input to the pool, but urandom
just draws from the pool with no limit. After a few to a few hundred
bytes this depleats the random nature of the pool, leaving you with a
supply of cryptographicly strong pseudo-random numbers. If you draw
heavily from urandom, give the pool time to refresh itself before
doing anything that requires data from random.

-- 
I route, therefore you are.



This archive was generated by hypermail 2a23 : Thu Mar 28 2002 - 19:18:40 AKST