I want to completely wipe all the data and both OSes (Ubuntu and Windows 7) from my hard drive. I tried DBAN but it gives me an error and does not run. I am looking for an alternative. After reading some articles online, I came to know that, using a Linux live CD, it can be done using either of following commands.

a) sudo dd if=/dev/zero of=/dev/sda

b) sudo shred -vfz -n 1 /dev/sda

My questions are

1) Which option (a or b) is more secure (wipes everything) and faster?

2) Does either of the options damage the hard drive or anything? I want the hard drive to be usable again for Windows and Ubuntu etc.


I have one more interesting and related question.

3) Options a) and b) write zeros to every bit. Do they do that if the bit is already zero or do they leave it since it is zero.

  • What error did DBAN give? – Indrek Sep 26 '12 at 20:33
  • Why are you worried, if you're going to keep the drive and just reuse it? – Daniel R Hicks Sep 26 '12 at 20:54
  • @Indrek "DBAN finished with non-fatal errors. *ERROR /dev/sdb (process crash) *ERROR /dev/sda (process crash)" – John Watson Sep 26 '12 at 21:02
  • @DanielRHicks All I meant is the hard drive should remain usable for all OS types and purposes. – John Watson Sep 26 '12 at 21:03
  • I was just wondering how paranoid you are. Very simple schemes are more than adequate for anything not involving black helicopters. – Daniel R Hicks Sep 26 '12 at 22:12

1) faster, probably the dd if=/dev/zero command. It just dumps blocks of zeroes to the disk. I can't think of anything faster, since it's a simple block copy and dump.

2) more secure, shred. it writes multiple times. You may debate whether this is overkill or not.

Neither will cause any physical damage to the disk. They're both flinging bits, which is what the drive is supposed to do. The possible exception is SSDs, solid state disks, which have a limited number of writes, which you would use up somewhat with shred.

After either of these, you'd have an empty disk to format, then reinstall whatever OS/data you'd like.

|improve this answer|||||
  • 2
    The shred command you gave, John Watson, will write twice. Once for the -n 1 and once for the -z. If you want to write more times for a more secure wipe, increment the -n 1. – Kasius Sep 26 '12 at 20:50
  • 1
    You can try leaving -n 1 out, but it probably won't let you. I'd stick with using dd if you just want to write zeroes. – Kasius Sep 26 '12 at 20:55
  • 1
    You can try -n0 as well, but like @kasius says, why bother with this if all you want to do is a single wipe of zeros. dd works just as well in this regard. – Rich Homolka Sep 26 '12 at 20:57
  • 2
    In terms of actual security, dd if=/dev/urandom ... might be better, since writing zeroes can leave traces of magnetic bias. Depends how paranoid you are... And to format it, just get a (Linux) boot disk, use fdisk to make the partitions (be sure to set their types properly!) and then run mkfs.TYPE /dev/sdXX (where TYPE is the format you want them in and /dev/sdXX is the partition). – Actorclavilis Sep 26 '12 at 21:42
  • 2
    The "dell utility" partition has got some pre-loaded Dell software; if you want to keep it, then just find out which partition (/dev/sdXN) it's on (using fdisk or df -H) and don't dd it. The dd call only overwrites the partition/disk you specify (so if your HDD is /dev/sda then you can do dd if=/dev/urandom of=/dev/sda to erase the entire thing (multiple times to be extra certain) (this will also destroy the partition table) or if you have the Dell Utility on /dev/sda1 and keep all your data on the partition /dev/sda2, then just use dd if=/dev/urandom of=/dev/sda2) – Actorclavilis Sep 27 '12 at 0:32

Neither of the methods you mention is actually "secure erase". SECURE ERASE is a defined part of the ATA specification, a method for instructing the drive firmware to erase the drive.

If you are in the U.S. government, it's also the currently approved method for securely erasing a modern hard drive (NIST 800-88). The old DoD "standard" that people like to refer to doesn't actually specify any methods; they are specified elsewhere (and they are only degaussing and physical destruction, both of which make the drive unusable). Oops!

Unlike hack solutions such as dd and shred, the drive firmware is able to erase things that you can't, such as reallocated sectors. On self-encrypting drives, it merely destroys the encryption key and replaces it with a new key, making all the data unrecoverable (and only taking a second).

This is also the best method for erasing a SSD since it restores all cells to factory write performance.

You can secure erase your drive using the Linux hdparm command, or by using the DOS utility HDDErase.exe.

See also: How can I reliably erase all information on a hard drive? and my article ATA Security Exposed in the Spring 2009 issue of 2600 Magazine.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.