Clearing the hard drive
Solution 1:
Using your Ubuntu installation media (USB since optical drive doesn't work), boot up and choose try Ubuntu.
Identify the drive by issuing the command sudo fdisk -l
once you've identified it you can choose one of the following options (in both cases change X to the drive designation obtained using the above command) :
Option 1
sudo dd if=/dev/zero of=/dev/sdX
and on completion
sync
Note: You can substitute /dev/random or /dev/urandom for /dev/zero in the above command if you prefer what some consider a more secure method.
/dev/random should be suitable for uses that need very high quality randomness such as one-time pad or key generation. When the entropy pool is empty, reads from /dev/random will block until additional environmental noise is gathered. A read from the /dev/urandom device will not block waiting for more entropy and for this reason is likely to be faster than /dev/random.
This process can take quite a while and will produce no progress report until it's complete.
It's useful to note that you may be able to speed up the process by setting a larger block size with the bs or obs options. For more details on these and other available options see man dd
Option2 If you want a progress report install dc3dd
sudo apt-get install dc3dd
then issue the command
sudo dc3dd wipe=/dev/sdX
dc3dd
will provide output throughout the process on speed and completion.
The wipe option defaults to using zeros, but can be modified with the following switches for those who believe that overwriting with a pattern is preferable.
pat=HEX Use pattern as input, writing HEX to every byte of the output. This option can only be used once and cannot be combined with if=, ifs=, or tpat=. tpat=TEXT Use text pattern as input, writing the string TEXT repeatedly to the output. This option can only be used once and cannot be combined with if=, ifs=, or pat=.
dc3dd doesn't appear to install a man page by default, for more information on this program see one of the following pages:
http://www.linuxcertif.com/man/1/dc3dd/
https://plus.google.com/+KarlBernard/posts/CFzGx6kNaHR