Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.