I'm planning on selling a USB external hard drive that currently contains an old Ubuntu installation with stored passwords and banking information.
How can I securely erase the drive before selling it?
|
I'm planning on selling a USB external hard drive that currently contains an old Ubuntu installation with stored passwords and banking information. How can I securely erase the drive before selling it? |
|||||||||||||
|
Securely erasing a storage deviceThere's a command-line utility called First of all, you need to identify the name of the device. This might be something like N.B. Make sure it is the correct device, picking the wrong device will wipe it. Unmount all currently mounted partitions on that device, if any.
Then run the following, replacing
This will overwrite all the blocks on the device with random data three times, the You can add the option You can also set all bits to zero after the last iteration by adding the option
After this, you would have to repartition the device. The easiest way is to install GParted and use it:
Choose your device in the upper-right corner list. Then select Then add a single partition that uses all of the unallocated space on the device, choosing Tips
|
|||||||||||||||||||||
|
|
Just 'zero' it using the
This will overwrite the whole disk with zeros and is considerably faster than generating gigabytes of random data. Like all the other tools this won't take care of blocks that were mapped out for whatever reason (write errors, reserved, etc.), but it's highly unlikely your buyer will have the tools and the knowledge to recover anything from those blocks. PS: Before you Bruce Schneier fanboys downvote me: I want proof that it's possible to recover data from a non-ancient rotational hard drive that has been overwritten with zeros. Don't even think about commenting otherwise! :P |
|||||||||||||||||||||
|
|
Have a look at this definitive question on Security Stack Exchange How can I reliably erase all information on a hard drive This discusses various secure deletion options, along with physical destruction and wiping so you can decide which option may be your best bet. Remember though that the current recovery status for different storage is as follows:
|
||||
|
|
|
I generally use a destructive read-write test using
Note that if the report indicates a problem, I'd no longer sell the disk as it is likely to fail soon. Usage example (if your disk is
(added |
||||
|
|
|
you can use wipe Installation
You can use that software or use the following command:
Were the "?" is, put the number of times you wan to shred the drive, then for were "(drive)" is, put the drive that you want to shred. Once your done, do whatever you want with it. I think that this method is more effective since you can control what is done to your drive and have immediate results. Links |
|||||
|
For your information: See the following links,
Note:
|
|||||
|
|
|||
|
|
|
Now, Disks (
|
||||
|
|
|
One more advantage of shred over dd in this scenario: I have a faulty disk that I need to return to the vendor for an exchange. dd halts at the first bad block, and fails to clobber the rest (unless I painfully use skip=... to jump ahead each time it stops). shred ignores write errors and happily continues in this case. |
|||
|
|
|
DBAN is an open source Boot CD to wipe the hard disk. Down load from burn it and boot the machine from CD, that's all. |
|||||
|
|
Go root and
Be certain you've got the right drive! |
|||||||||||||
|
|
Easiest way to do that is use :
where xxx is device, to ensure what device you have, type :
The device are indicated after disk word and to the colon char :, like this :
Don't mount file systems of your disk you want wipe etc. Shred will do what you want in part of time. -z option is for last run with 0 to hide wipe and is not necessary to wipe data. Best way is to use dd like wrote previous users:
use urandom device as it is more modern and better way to obtain random pattern. Other tools at this moment can be older and by less people develop. Shred is in core application of Linux. Look at this example: wipe 2009 http://lambda-diode.com/software/wipe/. But it is known app. It is possible to use bleachbit but as I tried it took long time. |
||||
|
|
|
If the dd cmd is not working, you can use the redirection method to wipe out the data. Like,
or alternatively you can use cp (copy cmd) to overwrite the previous data.
|
||||
|
|
|
Those recommending to use shred are giving bad advice. Shred's own man page says it's effectively useless on journaled filesystems, which Ubuntu is almost guaranteed to be using if you don't change its filesystem defaults (ext3 and ext4 are journaled. As is resierfs and Reiser4 as well as many MANY other common Linux filesystems.). Not to mention shred is completely useless for completely blanking or randomizing a disk, as it only works on individual files or sets of files (On the filesystem level, not a raw data level.). If you want to securely wipe a disk, you gotta use dd on the drive's main device node (For example: /dev/sdc instead of /dev/sdc1) while nothing is mounted on it. It WILL take a while, but unlike shred it will completely and IRREVERSIBLY wipe a hard disk from MBR to final sector. Also, BIG WARNING on dd, make sure you are using it on the correct device or you'll at least PARTIALLY wipe the wrong disk. This could be disastrous if you accidentally use dd on a system drive, which will not only make it unbootable, but may irreversibly corrupt any given partition on the drive. This has given it the nickname "disk destroyer." Shred is NOT a reliable tool for securely wiping a drive. If you're selling or giving your computer away the CORRECT way to empty the drive is to zero or randomize it with dd and never, ever use shred, as filesystem journals will effectively restore shredded files with no effort at all. |
|||||||||
|