Linux – Issues with hard disk secure erase

hard drivelinuxsecure-erase

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.

Edit

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.

Best Answer

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.