Maybe this topic shouldn't be under the area of recovery as its more of a anti-recovery issue. However, if you are getting ready to discard, or give away an old hard disk, its a good idea to clear the contents. There are several ways in which you can do this:
You can use the wipe utility to thoroughly erase the data on the hard disk. However, this takes a VERY long time (I estimate 775 minutes for a 40GB IDE drive).
You can simply cat from /dev/zero
to the hard disk or partition which you want to erase. This
is a very quick way to erase the contents of the disk (I've
been able to clear a 40GB IDE drive in less than 35 minutes
- less than a minute per gigabyte). However, there are those
that believe that if one had the right equipment, it might
be possible to recover data from a "zeroed" disk by looking
at "lingering" magnetic charges left on the media.
You can simply cat from
/dev/urandom
to the hard disk or
partition which you want to erase. This takes roughly 15
times longer than using /dev/zero
(it
took me 532 minutes to clear a 40GB IDE drive using this
method).
The following examples demonstrate how one might erase the
entire contents of the hard disk mapped to
/dev/hda
.
DO NOT run any of the commands shown below if you have any important data left on your hard drive. These commands clear everything (including your partition tables).
Example 12.2. Using /dev/zero
To Erase 40GB IDE Drive
[root@probe ~]#
time cat < /dev/zero > /dev/hda
cat: write error: No space left on device
real 532m0.313s
user 0m10.373s
sys 530m9.836s
[root@probe ~]#
Example 12.3. Using /dev/urandom
To Erase 40GB IDE Drive
[root@probe ~]#
time cat < /dev/urandom > /dev/hda
cat: write error: No space left on device
real 33m33.869s
user 0m9.741s
sys 5m40.749s
[root@probe ~]#