# How do I wipe out my hard drive?



## Persona (Sep 10, 2011)

How can I wipe out my hard drive? I've tried Googling it and no success.  I'm pretty sure I'm not the only one who is wondering how.


----------



## jrm@ (Sep 11, 2011)

Smash it into as many small pieces as possible if your aim is to prevent anyone from seeing the contents, otherwise you can boot from a live cd and do:


```
dd if=/dev/null of=/dev/ad0
```

Replace /dev/ad0 with your device.


----------



## fwaggle (Sep 11, 2011)

If there's just particular content you don't want anyone to see, `$ rm -P` will probably do the trick (and not take near as long, depending on how much content you want to blow away compared to the size of the drive). Check rm(1) for more details.


----------



## wblock@ (Sep 11, 2011)

mingrone said:
			
		

> Smash it into as many small pieces as possible if you're aim is to prevent anyone from seeing the contents, otherwise you can boot from a live cd and do:
> 
> 
> ```
> ...



Use /dev/zero instead of null.  It will take a long time.  Give it some buffer space to reduce overhead and speed up with bs=64k.  Or larger if it's RAID or a faster controller than average.


----------



## bes (Sep 11, 2011)

For the truly paranoid , more preferably , it would be to use /dev/urandom thought , but it's too slow . However , there is fast enough  technique :

```
# dd if=/dev/urandom of=ad0.key bs=128
# geli init -s 4096 -P -K ad0.key -s 4096 -l 256 
# geli attach -p -k ad0.key /dev/ad0
# dd if=/dev/zero of=/dev/ad0.eli [FILE]bs=8M[/FILE]
# geli kill /dev/ad0.eli
```
I usually use a value bs =`the size of the hard disk cache'

Replace /dev/ad0 with your device.


----------



## gpw928 (Sep 12, 2011)

Hi,

Overwriting with /dev/urandom or /dev/zero would not satisfy the paranoid.

Googling "Gutmann method" will give you some background.  For the lazy, see:

scrub(1)

Cheers,

-- 
Phil


----------



## bes (Sep 12, 2011)

Times change  The recording density of magnetic storage devices in today's so great, and the coding scheme so complex that even once overwritten data is practically impossible to recover
Secure deletion: a single overwrite will do it :


> They concluded that, after a single overwrite of the data on a drive, whether it be an old 1-gigabyte disk or a current model (at the time of the study), the likelihood of still being able to reconstruct anything is practically zero. Well, OK, not quite: a single bit whose precise location is known can in fact be correctly reconstructed with 56 per cent probability (in one of the quoted examples). To recover a byte, however, correct head positioning would have to be precisely repeated eight times, and the probability of that is only 0.97 per cent. Recovering anything beyond a single byte is even less likely.
> 
> Nevertheless, that doesn't stop the vendors of data-wiping programs offering software that overwrites data up to 35 times, based on decades-old security standards that were developed for diskettes. Although this may give a data wiper the psychological satisfaction of having done a thorough job, it's a pure waste of time.


Lecture Notes in Computer Science series (Craig Wright, Dave Kleiman, Shyaam Sundhar R. S.: Overwriting Hard Drive Data: The Great Wiping Controversy


----------



## fwaggle (Sep 12, 2011)

gpw928 said:
			
		

> Overwriting with /dev/urandom or /dev/zero would not satisfy the paranoid.



Honestly if you're that paranoid though, you should be mechanically or chemically destroying the hard drives, so there's no mistaking that the data is gone.


----------



## DutchDaemon (Sep 12, 2011)

There is a difference between _wiping_ and _wiping out_, though.. I'm assuming OP has some hope of re-using the disk.


----------



## kpedersen (Sep 12, 2011)

I tend to use dban (http://www.dban.org/) to easily wipe disks in a simple non platform specific way.

... and then smash it with a novelty sized mallet!


----------

