views:

7364

answers:

16

I mean really erase. In a secure way.

(It's Ubuntu)

UPDATE: Ok, "shred -vfz -n 10 /dev/hda" looks like what I was after.

+4  A: 

Looked into http://www.dban.org/ ?

Benjamin W. Smith
+1  A: 

dd if=/dev/zero of=[raw disk device] bs=512

Some authorities suggest that you need to do this as many as 7 times to really be sure, but if you want to eBay a hard disk, once ought to be sufficient in my opinion.

Be sure you use the correct disk device! You don't want to do that to any disk that has anything important on it!

nsayer
/dev/urandom is also a good one ;-)
dsm
yeah, but /dev/zero takes less CPU.
nsayer
True, but is overwriting an entire disk likely to be CPU-bound?
Steve Jessop
/dev/urandom should have a lot of entropy and this makes it slow. I can read only 4.5 MB/s from it.
Cristian Ciupitu
+4  A: 

GNU Shred will wipe everything. Boot from a livecd and run sudo shred /dev/sda (or whatever hard drive you want wiped is). This will even protect from magnetic analysis of the disk.

There are various commercial tools that also do this, but shred is free.

Branan
A: 

Randomly write bytes across the drive, perhaps several times. The scene from Cryptonomicon comes to mind.

EndangeredMassa
+14  A: 

Use the "shred" command:

Suppose I want to erase all the data on my hard disk, then I boot using a LiveCD like Knoppix and open a shell and type the following command:

shred -vfz -n 10 /dev/hda

Here /dev/hda is my whole hard disk. And I am asking shred to make (-n) 10 passes by overwriting the entire hard disk with (-z) zeros. And shred program (-f) forces the write by changing the permissions wherever necessary.

10 passes is probably way overkill, I'm not aware of a single confirmed example of someone recovering data from an erased disk even after 1 pass. Its a time-paranoia trade off.

sanity
Actually, -z -n10 overwrites 10 times with data from /dev/urandom, and then once with zeros.
Steve Jessop
http://stackoverflow.com/questions/276832/how-does-a-7-or-35-pass-erase-work-why-would-one-use-these-methods
Dustin Getz
Modern drives already use most of the tricks the spooks would use to recover data, just to get their enormous capacity.
Mark Ransom
+1  A: 

A large magnet plus a sledgehammer is the most secure way :)

Aeon
+1  A: 

Thermite, or a industrial metal shredder. Drilling some holes in it with a power drill may do in a pinch.

ceejayoz
+2  A: 

Depends on the threat model.

If you're only worried about someone reading bits off the disk in the usual way, then overwrite it once with zeros.

If you're concerned about physical analysis of the platters, use GNU shred. And look into full-disk encryption next time.

If you want to be absolutely sure that no data can be recovered, then nothing beats smashing the platters with a hammer and throwing the pieces in an incinerator. Only destruction ensures that no future advance in hard disk forensics will allow the "history" of the drive to be recovered.

Steve Jessop
+1  A: 

shred will not wipe everything if you are using a journalling filesystem. Even manpage for shred mentions it:

CAUTION: Note that shred relies on a very important assumption: that the file system overwrites data in place. This is the traditional way to do things, but many modern file system designs do not satisfy this assumption. The following are examples of file systems on which shred is not effective, or is not guaranteed to be effective in all file system modes: ...

dmityugov
I think the warning applies only if you are trying to erase individual files. For erasing the entire device, there's no problem.
Ville Laurikari
This message seems to be incomplete - the list of file systems is missing.
Jonathan Leffler
Full text: http://linux.die.net/man/1/shred
Tim
A: 

shred -vfz -n 100 /dev/hda

rkalajian
+1  A: 

If you want something totally secure, you need to physically destroy the drive.

If you want to use the drive again, use DBAN. It can erase data using a USA department of defense standard.

Rory
A: 

In the past there was enough redundancy on the disc that after one pass of erasing it was possible (using special equipment) to recover data. Probably nothing to worry about for most people but if you had good reason to think people would really want your data then multiple passes were reccommended.

As I understand it, with the densities of modern disks, there really isn't much redundancy and after a single pass there's not really any detectable data left.

Mark Baker
+1  A: 

dd if=/dev/zero of=/dev/sda bs=512 from a LiveCD. Lather, rinse, repeat up to 35 times if you want to be as secure as the Department of Defense.

Then, when you're done with it all, shoot it a few times with a nail gun, go Office Space on it, and then throw it into a volcano.

Andrew Szeto
+3  A: 

A single overwrite will do it (Heise Security)

There's a propability of 56% that one single bit can be correctly recovered. It's just 6 % points better than guessing!

One byte has the propability of 0,97% to be recovered. Calculate for yourself what does this means for a 3 MB word document...

A nice comment were posted in the German Heise Forum:

This recovery method would be as effective as guessing, but guessing would work even if the data haven't even written down yet!

So: Don't panic! :)

furtelwart
A: 

As others have suggested, DBAN is good. Anything which overwrites the entire contents of the disc, just once, is good enough.

There is no evidence that, on a modern disc, there is ANY way of getting anything back that's been overwritten once.

MarkR
A: 

The Register has found the perfect tool for the job...

:->

Chip Uni