Before doing this *PLEASE* make sure you actually want to do it, *AND* make sure you know the device path of the disk that you want to erase. If you have more than one disk a simple mistake like using /dev/sdc instead of /dev/sdd *WILL* mean all data on the wrong disk is wiped.
Even if you quit (CTRL+c) the command a second or two after pressing the Enter button you will have at the least wiped out your partition table and probably some of your data too, and although not totally impossible to recover some of the data, it will certainly need expert knowledge to accomplish.
My advice is: use a live cd and disconnect the power connectors from all disks except the one you want to wipe. That way there will only be one disk available from the live cd environment and you can be 100% certain you are wiping the correct disk.
Now on to the the actual wipe disk part:
This will overwrite all partitions, master boot records, and data. This must be run as the root user, either by using sudo (sudo dd...) or switching user to root (as I did) and then running the commands that way.
Filling the disk with all zeros (This may take a while, as it is making every bit of data on the disk a zero) :
root@dogmatix # dd if=/dev/zero of=/dev/sda bs=1M
If you are wiping your hard drive for security, you should populate it with random data rather than zeros (This is going to take even longer than the previous example.):
root@dogmatix # dd if=/dev/urandom of=/dev/sda bs=1M
The reason one should fill with urandom in case of required security is explained here: http://www.marksanborn.net/howto/wiping-a-hard-drive-with-dd/
P.S. To wipe a 160Gb disk with the urandom method took approximately 9 hours on my system.
No comments:
Post a Comment