Linux.com

Feature: Tools & Utilities

Wiping your disk drive clean

By Chad Files on May 30, 2008 (9:00:00 AM)

Share    Print    Comments   

Everybody who owns a computer will someday need to dispose of a disk drive. Before you do, it is a good idea to cleanse the drive, so no one can read your sensitive information. Deleting files and reformatting is not sufficient; determined effort can still reveal data from a drive even after it appears to be gone. To do a more thorough job, I suggest using wipe.

You need to take special pains because files that are "deleted" are not really gone. Most operating systems, including Linux and its ext2 filesystem, just delete the pointer to a deleted file; the data still exists on the drive. It is not effectively removed until every bit of the space it was occupying on the drive has been overwritten. Even then there are ways, albeit difficult, to analyze the drive and extract data. The only way, short of melting the drive, to ensure the data is gone for good is to overwrite the drive several times with random data.

Several Linux utilities can cleanse files and drives, and all do the same thing. Wipe has more options than some of the other tools, including the ability to erase a block of data on a partition.

If the target drive is installed in a working system, the easiest way to clean it is to run wipe off of a Linux live CD. Knoppix, the granddaddy of Linux live distributions, comes with a ready-to-use version of wipe. To get started, download and burn the latest version of Knoppix, then put the CD in the CD drive of the target machine and boot. If all goes well, Knoppix should boot and present the KDE interface.

Launch Konsole, KDE's terminal emulator, using the icon in the bottom toolbar. Find the partition names of the target hard drive by listing all of the disk devices in the /dev directory. For IDE drives, run ls /dev/hd*. For SCSI drives, use ls /dev/sd*. The command should list several items. The primary drive is typically /dev/hda or /dev/sda. There will be an item in the output for every partition on the device.

It should go without saying that running wipe will nuke everything on the target file system. Everything beyond this point is destructive, so make sure anything important is backed up.

Wipe's developers suggest only wiping one partition at a time, so for every partition, including the swap partition, run the command sudo wipe /dev/partition. Use the sudo command so that there are no permission errors. The wipe process will take several hours to complete for a moderate-sized hard drive. If you want it to go faster you can tell it how many passes you want it to make by using the -Q option with a number less than the default of 4. However, the more passes wipe makes, the better the protection, at least in theory.

If the target drive is not in a working machine, you can place it in a USB enclosure and attach that to a Linux machine. Note that most window managers will automatically mount external USB storage devices when they are attached; unmount the drive before running wipe. If wipe is not already installed on the machine, install it using your distribution's package manager. Next, launch a terminal session, find the device, and run wipe on each partition, using the command above.

Using wipe does not absolutely guarantee that data on the drive cannot be recovered, but it goes a long way in making it difficult.

Chad Files, a software developer and writer, has been developing software applications for more than 10 years, and is a contributing developer to many open source projects.

Share    Print    Comments   

Comments

on Wiping your disk drive clean

Note: Comments are owned by the poster. We are not responsible for their content.

Wiping your disk drive clean

Posted by: Anonymous [ip: 127.0.0.1] on May 30, 2008 10:14 AM
I have always found that Darik's Boot and Nuke: http://dban.sourceforge.net/ is much easier to use. It's a tiny download (ISO file), burn to CD, boot with CD, type "autonuke", hit Enter and come back later. It can use the US DoD algorithms, with options for other ones too. There's no need to boot a CPU intensive GUI.

Hamish

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 149.156.71.186] on May 30, 2008 10:24 AM
How about using DBAN? It can rewrite a harddrive 35 times, starts from an Ultimate BootCD and is user-friendly :)

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 64.167.165.248] on May 30, 2008 11:40 AM
Actually, I've found what works best is a ball-peen hammer. It's very easy to turn those platters into dust. It's the only sure way to make information on a drive unretrieveable.

#

Re: Wiping your disk drive clean

Posted by: Anonymous [ip: 204.228.188.6] on May 30, 2008 04:29 PM
Plus you get to recover the magnets and use them for other projects.

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 72.74.123.147] on May 30, 2008 12:15 PM
Where we work, we have some special requirements for disposing of disks. When a customer sends a disk back a couple of things happen.
1. We test the disk to see if it's really bad (sometimes customers screw up) If it's not bad, we immediately run DBAN on it and put the drive back into the "refurbished" lot (it's unlawful to resell used equipment as new)
2. If the disk is bad, we have a device with a pneumatic ram that drives a steel spike at high speed through the platters shattering them. (we've opened a drive that's been "made safe" and it's ugly!

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 69.47.140.231] on May 30, 2008 12:57 PM
What about good old fashioned "dd if=/dev/zero of=/dev/sda bs=1M" ??
Always works for me.

#

Re: Wiping your disk drive clean

Posted by: Anonymous [ip: 192.88.212.43] on May 30, 2008 01:46 PM
Use /dev/random instead of /dev/zero for a random overwrite. If you are paranoid, do it several times.

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 85.147.168.190] on May 30, 2008 01:55 PM
don't use /dev/random, but /dev/urandom

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 83.79.37.122] on May 30, 2008 03:31 PM
just use "shred". It is in many distribution by default. It will do everything mentionned above...

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 66.28.19.105] on May 30, 2008 03:41 PM
I agree with the comments about dban. I used it once on a drive that I couldn't partition due to a hardware failure. It doesn't care, it just overwrites everything on the drive regardless of partitions, file types, etc. The comments about /dev/urandom and /dev/zero are just a couple of the techniques dban uses but it goes a lot farther. Understand that no matter how good you wipe the drive through software (dban, etc.), the data is still recoverable if the information is valuable enough to justify the expense (they wouldn't bother trying to recover your personal data). Destroying the platters is the only technique guaranteed to make the drive unrecoverable.

#

Re: Wiping your disk drive clean

Posted by: Anonymous [ip: 83.229.131.82] on May 30, 2008 03:48 PM
So if I wipe my hard disk clean, will I be able to just to a new, clean Linux install on it afterwards?

Thanks!

Stijn.

#

Re(1): Wiping your disk drive clean

Posted by: Anonymous [ip: 158.72.121.49] on May 30, 2008 04:39 PM
You got it. Probably isn't necessary to completely nuke the disk in this case, as a simple format will do. Unless you REALLY don't want any of the old data to be recovered.

#

Re(2): Wiping your disk drive clean

Posted by: Anonymous [ip: 128.174.112.88] on May 30, 2008 05:09 PM
Actually I have had problems with a simple format particularly on windows partitions. So I religiously zero out my drive before I reinstall an OS for that very reason. Security has nothing to do with it.

#

Re: Wiping your disk drive clean

Posted by: Anonymous [ip: 192.168.1.5] on May 30, 2008 05:49 PM
None of this is try if these guys are right:

http://16systems.com/zero/index.html

#

Re(1): Wiping your disk drive clean

Posted by: Anonymous [ip: 64.252.85.92] on May 30, 2008 08:39 PM
One little point: just because no "reputable" firm or government entity has replied to the challenge does not prove that they are unable to recover the data. Not trying to be paranoid, but anybody that has something that does the impossible is very selective in who they let know about it. At least if they're wise. And any fool that has publicly announced some fool-proof crack or recovery technique had better be prepared to sell it to the gov't or other Big Boys if they don't want to spend the rest of their days looking over their shoulder. It's a very different world post nine-eleven. Even the "Good Guys" wear black hats these days.

#

Re(1): Wiping your disk drive clean

Posted by: Anonymous [ip: 24.5.208.127] on May 31, 2008 06:49 AM
The contest is only four months old but, more critically, the prize is only $40 and an 80 GB drive.

Why on earth would professionals (who regularly receive two orders of magnitude more money for this service) possibly pay any attention to this at all? Free advertising? No--it is a lame godaddy site with little traffic and nobody of significance is running it. There is no guarantee that there aren't either minor shenanigans (improper drive preparation) or fraud (extracting shipping + "deposits" from saps) here. It is suspicious that they charge a deposit and disallow physical tampering--if anything went wrong, the deposit would be lost. Anyway...would risk anything for only $40?

If the entities behind this raise a more significant bounty & can show there are no shenanigans on there part & attract any interest, they should also refine the rules to show no shenanigans by others---they need multiple drives or will need to "reset" the drive (format+add data+dd /dev/zero) after each trial--there is no guarantee that someone before your try didn't write to the drive.

#

Re(1): Wiping your disk drive clean

Posted by: Anonymous [ip: 222.254.137.7] on June 02, 2008 03:29 PM
The challengers specifically state: "You may not ... disassemble the drive." That requirement makes this challenge moot. The reading of the "residual polarisation" of the platters after a single zeroing out requires the disks to be disassembled and the platters taken out for inspection with more sensitive heads than are build into the drive.

Of course you cannot restore the data with the electronics build into the drive :P .

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 198.207.0.5] on May 30, 2008 04:46 PM
Wasn't there an open contest to see if anyone could recover drives written over one time with zeros? And nobody did it?

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 75.83.199.228] on May 30, 2008 05:58 PM
I had occasion last weekend to dispose of a hard drive that contained years of e-mails, financial transactions, etc. Here's what I did:
Drilled through the platter stack (yeah, an old drive!) with a 3/8" drill bit, in each of 4 quadrants
Put platter stack into a gas grille, on "Pre-heat" (it's highest setting - about 750 degrees F) for a half-hour
Dropped hot platter stack into a bucket of cold water to quench.
Pounded the platter stack well out of "true" with a hammer, which broke apart the hub and "unstacked" the platters
Tossed into recycle bin.
Think that was sufficient?

#

Re: Wiping your disk drive clean

Posted by: Anonymous [ip: 76.105.79.64] on May 30, 2008 07:20 PM
What! You must have missed the episode where the guy was convicted based on the evidences recovered from a floppy disk he destroyed by cutting up with a pair of scissors. At the time, no one knew how to recover the data from the cut-up floppy, not even the FBI forensics lab. If they could, it would cost roughly $150,000 or more!

So the investigator did the experiment with Scotch tape and some blank floppy disk. In the end, it cost him roughly $50 dollars or so, for a floppy drive he broke during the experiment, Scotch tape and floppy disks.

Don't under estimate the determination of a criminal investigator.

Now the hard drive is different, but who knows?

:) :) :) :) :) :) ;=)

Anyway, for general purpose HD wiping, a bootable DBAN will do a good job of making it extremely difficult to recover data on the HD.

#

4 pound pony hammer, repeatedly...

Posted by: Anonymous [ip: 96.244.123.232] on May 31, 2008 02:14 AM
...disposing of the pieces in separate recycle bins. A marine magnet (used for retrieving keys and such dropped off of boats) on the pieces if you are paranoid.



#

Wiping your disk drive clean

Posted by: Anonymous [ip: 85.25.138.222] on May 31, 2008 01:41 PM
"If the target drive is installed in a working system, the easiest way to clean it is to run wipe off of a Linux live CD."

Like others already mentioned in the comments on the article, I find dban from a livecd (SystemRescueCD of course for me) to be quite easy.

<a href=http://mus4u.com>MP3 Download, music, mp3 downloads</a>
<a href=http://mus4u.com/genres/>The Best Music MP3 Download Collection</a>


#

Wiping your disk drive clean

Posted by: Anonymous [ip: 88.252.40.9] on May 31, 2008 04:18 PM
None of this is try if these guys are right

#

Ferkrissake! Secure Erase is built into the drive controller!

Posted by: Anonymous [ip: 192.168.1.253] on May 31, 2008 06:49 PM
Unfortunately, few people know this and articles like this one keeps spreading misinformation.

See here: http://cmrr.ucsd.edu/people/Hughes/SecureErase.shtml

All you need to do to securely erase a disk is activate the erase routine that is built into all modern disk drives.

#

Re: Ferkrissake! Secure Erase is built into the drive controller!

Posted by: Joe Barr on May 31, 2008 08:05 PM

All modern disk drives? Is that really true? And how do you tell the drive to erase itself?

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 130.75.184.21] on June 01, 2008 08:09 PM
Just make sure no plaintext data ever was on the harddrive.
Then overwrite with random data once, and you're pretty much good to go.
If they manage to read both overwritten sectors AND break AES or similar, then no data we have is safe anyway...

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 198.151.41.206] on June 02, 2008 02:38 PM
http://www.truecrypt.org/ is a good tool to encrypt your data. It supports both Linux and windows.
http://sourceforge.net/projects/eraser/ It will be good when this windows tool gets ported to Linux.

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 69.215.104.2] on June 02, 2008 06:27 PM
For just a couple bucks, you can buy a nice hammer that you could beat the drive to smithereens with and then use the hammer to hang a picture of your SO on the wall.

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 136.234.228.116] on June 02, 2008 07:56 PM
Seriously, overwriting three times or thirty-three times, it is the same level of difficulty to retrieve the information. Most of the people commenting here have no experience in hard disk forensics. PLEASE READ THIS PAPER:
http://cmrr.ucsd.edu/people/Hughes/DataSanitizationTutorial.pdf

Yes, overwriting a hard drive made sense in 1996, but not in 2008. The paper will help you understand why.

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 71.216.138.49] on June 02, 2008 10:34 PM
I like the "rifle" method, it is much more fun to see the drive explode when you hit it will a nice high-power deer rifle. But then, I do live in a rural area....

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 87.75.165.185] on June 03, 2008 06:22 PM
The info suggesting that drives maintain data even when fully wiped by over-writing is purposely circulated by the US government. Why? Because any meme suggesting that drives ALWAYS have recoverable data discourages users from good casual erasure protocols, making it that much more likely that data that should have been erased has been left pending.

Simple maths... if a drive maintains data after a complete over-write, the actual capacity of that drive has magically DOUBLED. If data survives 33 lots of over-writing (as suggested by some idiot above), the drive now has a reliable capacity of 34x that originally stated by the manufacturer. Of course, tin-foil hat types have long claimed hard-drives are based on tech recovered from an alien crash (and sadly, i'm not kidding). These are the same people that are used to push the nonsense that over-writing is a waste of time.

Of course, the real problem for ordinary users is knowing how to over-write the actual targetted sensitive area of the platter, which at best means trusting utilities, and the truthfulness of control information returned by a hard-drive controller. The electronics in a modern hard-drive has no incentive to guarantee the actual erasure of any given platter area, so long as the ability to accurately record is not compromised. Only by storing new data to fill the entire capacity of a hard drive can one be certain that any given piece of old data has gone.

The hammer destruction of platters is perfect, but really only required in an environment where protocol mistakes can easily mean that data that should have been wiped may not have been because of Human error, or error within the mechanism of the software tools, or electronics. For the individual, and their own PC (who, in reality is MOST unlikely to smash a HD), they must not be put off from using good software erase tools on the basis of those that carefully troll forums like this.

REMEMBER- those that tell you that over-written data can be recovered are trying to discourage you from erasing it in the first place.

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 69.208.75.112] on June 03, 2008 11:36 PM
I can't believe that nobody mentioned the environmental impact of all of the destroyed drives. Sure, papers claim to recover data between the tracks using highly sophisticated equipment: http://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html but the fact is that government agencies are the only ones that can afford the technology to do so.

If you don't have time to run DBAN on everything, use a DeGausser.

Please familiarize yourself with the subject of E-Waste: http://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html
and stop pointlessly shooting and burning your drives (unless they contain military secrets). Your waste is ending up in toothpaste, cat food, and toys.

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 69.208.75.112] on June 03, 2008 11:44 PM
Oops, Meant to throw in the National Geographic quiz in that last post: http://ngm.nationalgeographic.com/2008/01/high-tech-trash/trash-quiz-interactive

#

Wiping your disk drive clean

Posted by: Anonymous [ip: 212.175.33.3] on June 09, 2008 10:28 AM
thanks for this article. It is very useful for us as linux funs.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya