Thursday, August 11, 2011

How to Securely "Wipe" a Hard Drive Using Ubuntu 11.04

When you sell or pass on a hard drive to another person, it is a very good idea to make sure all of your data is removed from the drive. In doing so, you basically have two options: format the drive or wipe the drive. Wiping a hard drive is far more aggressive than a simple format and it ensures that you securely remove all data on that hard drive. The process is somewhat simple and requires some use of the Terminal. Unfortunately, with Ubuntu's new Unity interface, this process takes a little longer than is necessary due to some curious changes to the way a user is to access applications. To begin, download Ubuntu and put the image on bootable media* (instructions are on the Download page of the Ubuntu website), and then follow the steps below.

Before you begin, your computer will need to have Internet access in order to install the wipe command. Also, please make sure you have all important data on the drive backed up. Wiping a drive will permanently remove the data, leaving no possibility of data recovery. Finally, this method of wiping a drive is only meant for magnetic storage media of hard disk drives and not solid state storage media, such as SSD drives or USB flash drives.
  1. Boot your computer to the media with Ubuntu.
  2. When prompted, choose the option to "Try Ubuntu."
  3. When the Ubuntu desktop appears, you will first open GParted. Click the Ubuntu logo in the upper-left corner of the screen to activate the Dash. When the Dash paarears, type "gparted" (without quotes) into the Search field and press the Enter key. Note: if only one partition exists on the drive, you may skip steps 4 and 5, except to take note of the partition location (e.g., /dev/sda1) and close GParted.
  4. Mark all partitions for deletion and apply the changes. (A guide to steps 4 and 5 can be found in the Intermediate Partition Actions section of the GParted Manual.)
  5. Create a new partition with the default settings and apply the changes. Take note of the partition location, as it will be required for wiping the drive. It will be in the form of /dev/hda1 or /dev/sda1. Close GParted.
  6. Next, you need to enable the Universe software source. Using the Dash again, type "synaptic" into the Search field and press the Enter key.
  7. When the Synaptic Package Manager opens, dismiss the introduction pop-up. From the Synaptic main window, click the Settings menu and then choose the Repositories option.
  8. In the Software Sources window, check the box to enable "Community-maintained Open Source software (universe)." (A visual can be found in the Repositories section of the Ubuntu Help site.) Click the Close button.
  9. You will be notified that you need to reload the sources. Do so by clicking the Reload button in the Synaptic Package Manager window. It may take a few minutes to reload. Close the window.
  10. Now, you will install the wipe command. Using the Dash, type "terminal" in the Search field and press the Enter key.
  11. At the prompt, type, sudo apt-get update and press the Enter key (wait a few moments for the prompt).
  12. Next, type, sudo apt-get install wipe and press the Enter key (wipe will take only a minute or two to install depending on your Internet connection speed).
Now that you have the wipe command installed, you are ready to wipe your hard drive. There are a host of options for wiping a drive, but to keep this post aimed at a relatively simple approach, I will mention two different ways to wipe your hard drive. You can either choose to perform a thorough wipe or a quick wipe of your drive. The thorough wipe will of course take considerable more time to complete (based on my usage of the wipe command, a thorough wipe could take roughly one hour per 4GB of data, which means a 500GB hard drive might take a little longer than 5 days to complete).

To perform a thorough wipe, enter this command in the Terminal:
  • sudo wipe /dev/[partition location from step 5 above] (example: sudo wipe /dev/sda1)
  • If asked to wipe a special file, type, Yes, to do so.
To perform a quick wipe, enter this command in the Terminal:
  • sudo wipe -q /dev/[partition location from step 5 above] (example: sudo wipe -q /dev/sda1)
  • If asked to wipe a special file, type, Yes, to do so.
And now you wait...

After the wiping process completes, a partition will need to be recreated on the drive. To create a new partition on the drive, simply repeat steps 3-5 above. You now have a hard drive that has had all of the data stored on it securely removed. It is safe to be passed on to the next user.

NOTES:
* As an alternative to downloading Ubuntu and putting it on bootable media, you can install the hard drive you need to wipe into your existing computer (via SATA or IDE cable) and begin with step 3 above.

0 comments:

Post a Comment