LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-16-2007, 07:34 PM   #1
airman99
LQ Newbie
 
Registered: Aug 2004
Distribution: Gentoo
Posts: 26

Rep: Reputation: 15
Hard disk wipe software suggestions [SOLVED]


Any suggestions on Linux software to securely wipe an entire disk? I know I can always "dd if=/dev/random|if=/dev/zero of=/dev/sda" or the likes to overwrite the drive. And I know I could use DBAN if I wanted to dedicate my box to wiping for the several hours/days that it takes. But there should be some software out there that does the same thing as DBAN, but doesn't require a LiveCD to run, i.e. can run as a utility on an existing Linux install.

I just want to securely wipe a drive in the background on my existing Linux box.

Any ideas?

Last edited by airman99; 11-19-2007 at 09:01 AM. Reason: issue solved
 
Old 11-16-2007, 07:42 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
There are a few - what's the problem with "dd" ???. I use it to wipe leased laptops before I send them back. Put a decent blocksize on the command, and use /dev/urandom instead - it's non-blocking.

Will still take a while.
 
Old 11-16-2007, 07:46 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Secure wipe can take a long time---regardless of where it is run from. I imagine you can put DBAN into an existing Linux install, but I've never done it.

I assume you are talking about Linux running on drive X, while you are wiping drive Y.

dd will do it in the background, but if you are doing something else, everything might get really slow.
 
Old 11-16-2007, 09:59 PM   #4
tagno25
Member
 
Registered: Jun 2007
Posts: 53

Rep: Reputation: 15
if you do not want to keep the drive a sledge hammer/ax works wonders
 
Old 11-17-2007, 09:23 AM   #5
airman99
LQ Newbie
 
Registered: Aug 2004
Distribution: Gentoo
Posts: 26

Original Poster
Rep: Reputation: 15
dd
DD works fine, but my complaints, and they are mild ones, are twofold:

1. It does not comply with any sort of "standard" that one can tell one's boss the drive was wiped with. For example, stating that a drive was wiped according to a 7-pass DoD standard carries much more weight sometimes than telling your boss that it was wiped, trust me. Granted, the end result in all reality may be exactly the same.

2. While the command is running, dd provides no progress feedback. This may be a function of my lean knowledge of dd, and if anybody knows a way to have dd give you progress, let me know.

/dev/urandom
Thanks to syg00, I looked up the difference between /dev/random and /dev/urandom. Seems that /dev/urandom will spit out more bits than it has generated randomly, by reusing them. That solves one of my complaints, and that was that /dev/random was extraordinarily slow. Of course I have yet to try using /dev/urandom, so don't know how much faster it will be, and how it will compare to /dev/zero. I suspect it will be somewhat slower than the latter. Maybe I will be surprised.

Axe/Sledgehammer
Ah, my favorite way of data destruction. This one lets me sleep soundly at night, confident that there is no reasonable way that my data can be stolen. Of course, it does sort of make the reusing of the drive a bit difficult. :-)


It just seems that what with the popularity of security among Linux buffs, and the usefulness and popularity of DBAN, that there would be a command-line utility that did the same thing as DBAN but did not require a boot and tying up a complete box during the process.

Last edited by airman99; 11-18-2007 at 04:28 PM.
 
Old 11-17-2007, 01:30 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
If you want security, you don't get convenience.
For some of the issues, see the wipe homepage - here
 
Old 11-18-2007, 04:28 PM   #7
airman99
LQ Newbie
 
Registered: Aug 2004
Distribution: Gentoo
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
If you want security, you don't get convenience.
For some of the issues, see the wipe homepage - here
Fair enough. But it seems that there would be no technical difficulty in implementing a DBAN-type utility without having to use a boot disk. Of course, maybe I'm just not understanding some important thing that's occurring in the background of the boot CD that requires a specialized OS implementation.
 
Old 11-18-2007, 04:55 PM   #8
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
A shell script running whatever dd commands you feel necessary?

DBAN on a separate PC is really the best option if you are doing this much. No possibility of accidentally wiping the wrong disk if only drives needing to be wiped are plugged in. Make him spring for a second hand PC for the job if nothing else is available.
 
Old 11-18-2007, 04:59 PM   #9
airman99
LQ Newbie
 
Registered: Aug 2004
Distribution: Gentoo
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by 2damncommon View Post
A shell script running whatever dd commands you feel necessary?

DBAN on a separate PC is really the best option if you are doing this much. (snip)
You've summed it up nicely and I suppose that these are the two options that I'm going to be left with.
 
Old 11-18-2007, 05:10 PM   #10
ultramancool
Member
 
Registered: Jul 2004
Location: Hell
Distribution: Gentoo 2005.1 r1
Posts: 92

Rep: Reputation: 15
GNU shred.
Code:
$ man shred
No need to make a dd shell script just to overwrite something with randomness a bunch, GNU shred can do that just fine It can even 0 the drive on the last run.

Last edited by ultramancool; 11-18-2007 at 05:12 PM.
 
Old 11-18-2007, 05:28 PM   #11
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by ultramancool View Post
GNU shred.
Code:
$ man shred
No need to make a dd shell script just to overwrite something with randomness a bunch, GNU shred can do that just fine It can even 0 the drive on the last run.
From "man shred":

CAUTION: Note that shred relies on a very important assumption: that the file system overwrites data in
place. This is the traditional way to do things, but many modern file system designs do not satisfy this
assumption. The following are examples of file systems on which shred is not effective, or is not guar‐
anteed to be effective in all file system modes:

* log-structured or journaled file systems, such as those supplied with AIX and Solaris (and JFS, Reis‐
erFS, XFS, Ext3, etc.)


I believe this is not the case using "dd" on a drive or partition.

EDIT:Okay I'll add the edit myself: Also from "man shred":
Generally speaking, it is more reliable to shred a device than a file, since this bypasses the problem of filesystem design mentioned above. However, even shredding devices is not always completely reliable. For example, most disks map out bad sectors invisibly to the application; if the bad sectors contain sensitive data, shred won't be able to destroy it.

I am guessing "dd" cannot bypass the hard drive "bad sector" issue either.

Last edited by 2damncommon; 11-18-2007 at 05:34 PM.
 
Old 11-18-2007, 07:30 PM   #12
airman99
LQ Newbie
 
Registered: Aug 2004
Distribution: Gentoo
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by 2damncommon View Post
From "man shred":

(snip)

For example, most disks map out bad sectors invisibly to the application; if the bad sectors contain sensitive data, shred won't be able to destroy it.

I am guessing "dd" cannot bypass the hard drive "bad sector" issue either.
Then again, if the drive locks out the bad sectors, then the data that the erase program can't get to, the casual bad guy can't get to either. Only by hacking the drive software or disasembling the drive will the locked-out sector data be accessible. Unless there's a way to reset the bad sector table on the drive.

Of course! I didn't realize that shred would overwrite entire devices. Duh! That may be the way to go, a few passes of random data, maybe a pass of zeros, all done.
 
Old 11-19-2007, 09:00 AM   #13
airman99
LQ Newbie
 
Registered: Aug 2004
Distribution: Gentoo
Posts: 26

Original Poster
Rep: Reputation: 15
Played with shred some, and it looks like it's going to do the trick. It's got an update of its status real-time, and does a user-definable number of random passes without having to dedicate a machine.

Thanks for the tips.
 
Old 11-19-2007, 09:25 AM   #14
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by airman99 View Post
dd
DD works fine, but my complaints, and they are mild ones, are twofold:

1. It does not comply with any sort of "standard" that one can tell one's boss the drive was wiped with. For example, stating that a drive was wiped according to a 7-pass DoD standard carries much more weight sometimes than telling your boss that it was wiped, trust me. Granted, the end result in all reality may be exactly the same.

2. While the command is running, dd provides no progress feedback. This may be a function of my lean knowledge of dd, and if anybody knows a way to have dd give you progress, let me know.
See http://dcfldd.sourceforge.net/. It was written by a guy who worked at the Department of Defense Computer Forensics Lab.
 
Old 11-19-2007, 09:47 AM   #15
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Thanks for updating me (that shred can deal with devices too, not just on the filesystem level; I never had time to read the full man-page..). I too would have voted for either dd or shred; dd would have been the first, but now that I'm aware of shred being able to work on devices..all the same.

It would be interesting to know if these commercial, possibly expensive, data destroying software suites (licenced, patented, packaged and cashed) are able to deal with the already mentioned bad blocks that the drive can "hide". If not, it would be a serious problem unless there was no way of getting hands on the blocks anyway; if there really was no way to get hands on the bad blocks, then it wouldn't be mentioned in the manpages I guess..so this leads me to think that either the commercial software isn't telling you it can't do the job 100% securely, or then they know something dd/shred writers don't. I might be inspecting this case later..interesting, really.

Overwriting data takes time. In the optimal case the drive writes with full speed, and the drive size (along with the write speed) determines how long it takes to deal with the whole disk. If one solution is considerably faster than another, then doesn't it mean it's doing it's job less well than the other? For example if one dd run only overwrote the disk once, but you wanted it to be done 5 times to "be sure", and had shred run five times, wouldn't shred then take approximately five times longer to do it than dd? Or am I missing something here? I haven't tested (just noticed that erasing USB sticks with either one takes some time these days..), but again would like to know..

The goal, in the end, is to have the disk in a state where no earlier information can be read. The drives of today use magnetism to write bits on the medium, so in the end it boils down to re-writing ("touching" magnetically) every bit of the disk that has ever been written to, which means every bit of the disk if you want to be sure. So it doesn't matter which algorithm you use to calculate fancy words to be written on the device, as far as I understand it matters that you write something everywhere - zeros, nonsense, your name, something. Therefore the fastest way probably is to write something that doesn't take time to be calculated, like zeros. If one run of that may possibly leave some areas still unwritten, then another run is needed - but if the filesystem is not considered (i.e. work is done on the device, ignoring filesystems), then one run should be enough (right?), because the filesystem doesn't get to choose where to write, possibly jumping over some areas of important data, but everything is re-written to something.

So..if your boss is not satisfied with you saying you've shredded or dd'ed the disk, maybe ask him to buy brains and spend ten minutes with Google and the appropriate web pages to get an idea how they work. If I'm not mistaken, the point in using a commercial erasing software is that you may get a nice (graphical?) interface to work with -- not just a commandline, you can use a boot disc so you don't need to have an operating system installed to do the thing, you're given a dozen nice ads that say the product is good in what it does, that you don't have to think about the matter (just click the button) and that you can tell the job is done "with professional software" if some fool asked. Just like with cars: it's not enough that it's moving, it has to have some glamour, sense of something greater than life, a long number in the price paper and something that your neighbour doesn't have.

Sorry for writing all that irrelevant garbage..
 
  


Reply

Tags
file



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenBSD] safe disk wipe out noir911 *BSD 2 03-08-2007 03:53 AM
MacOS 8.6 -- disk detect problem after a disk wipe BinJajer Other *NIX 2 02-05-2006 03:24 AM
Hard Disk Imaging software neouto General 6 09-07-2005 07:01 PM
Hard disk synchronisation software? timread Linux - Software 3 06-17-2004 03:14 AM
rescue disk software suggestions? suse7.1user Linux - Software 1 10-16-2003 05:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration