How to securely erase or wipe disk drives using bootable Ubuntu Live USB thumb drive

If you are planning of selling off your old hard disk drive (HDD) or even USB drive, you might need to do a secure delete of the contents of your old HDD. This will ensure all your personal data in your HDD is unrecoverable using data recovery software.

The idea behind this secure deletion or erasure of your HDD content is basically overwriting every bytes of your disk drive with either zeros or random data. This way, whoever that tries to recover the data, they will only see zeros or gibberish data (random data).

I like to have a thumb drive preloaded with bootable Live Ubuntu USB thumb drive ready to perform tasks like this. For this post, I am not going to cover the topic of how to setup your USB thumb drive with Ubuntu Live OS. The tutorial is ready available at official Ubuntu website.

Once the Ubuntu Live OS is booted up on your PC, there are already built-in commands you can use to perform such secure deletion or erase of your HDD content. There 2 commands that you can use from the Ubuntu Live OS; they are "dd' and "shred".

Note: Assume that your HDD path is "/dev/sda".

dd

Overwrite the whole HDD with random data with "dd" command:

sudo dd if=/dev/urandom of=/dev/sda bs=$((1024*1024))

Overwrite the whole HDD with zeros with "dd" command:

sudo dd if=/dev/zero of=/dev/sda bs=$((1024*1024))

shred

Overwrite the whole HDD with random data with "shred" command:

sudo shred -v /dev/sda

Overwrite the whole HDD with zeros with "shred" command:

sudo shred -v -z /dev/sda

Note: By default shred will run 3 iterations to overwrite the HDD with random data or zeroes. To control the iteration, use the "-n" argument.

References, Sources and Credits:


  1. http://askubuntu.com/questions/359540/securely-erase-hard-drive-using-the-disk-utility
  2. http://askubuntu.com/questions/17640/how-can-i-securely-erase-a-hard-drive
  3. http://askubuntu.com/questions/206773/how-to-completely-erase-hard-drive



Comments

Popular posts from this blog