Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There are a lot of secure erasing algorithms in erasing softwares. What's the best of these algorithms?

share|improve this question

closed as not constructive by Dave M, EBGreen, rob, Tanner Faulkner, Breakthrough Feb 25 '13 at 22:08

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

The ATA spec has a Secure Erase command, which will potentially erase your hard drive more thoroughly than any software that operates at the block or filesystem level. – rob Feb 25 '13 at 20:32
Other than a hammer? :) – Nicole Hamilton Feb 25 '13 at 21:00
up vote 3 down vote accepted

Disclaimer: Most of this advice applies to spinning metal (conventional HDDs) with unencrypted data.

How paranoid do you want to be? An unsophisticated attacker is unlikely to be able to overcome even a single pass of zeroes. A three-letter-agency might have the capability to recover some data even after overwrites with patterns or random data. Or not. Who knows, they don't talk about their capabilities that I know of.

Even if you made dozens of passes with a mix of various patterns and random data, you might have some data fragments sitting on reassigned bad sectors. You probably won't be able to wipe those without being able to talk to the drive firmware and help from the manufacturer / custom tools. If sensitive data has ever been on the drive unencrypted, the only way to guarantee it's gone is total drive destruction (mechanical shredding, etc). Outfits that deal with classified data usually have special warranty arrangements with drive manufacturers such that they only have to return the top cover of the drive.

IMHO, the best you can do nowadays for spinning metal is to overwrite with at least one pass of random bits. If full drive encryption has been used, that's probably more than good enough. If sensitive data was on the drive unencrypted and you're worried about a sophisticated attacker, you can consider total destruction.

As folks are pointing out (rob), there is an ATA secure erase command. It's probably fine against an unsophisticated attacker.

SSDs are a totally different type of critter, as Hennes has pointed out. If the software the manufacturer provides has some kind of erase capability, use it (or the ATA command, hopefully they provided a custom implementation suited to their device). Overwriting with patterns is going to eat into the life of the device, and who knows what the heck is actually happening at the physical level, the firmware is going to do what it wants (wear leveling, spare cells, write optimization, etc), so no guarantee you've cleared all the cells.

As for implementations, DBAN (see ioSamurai's post) is probably the easiest cross platform solution, depending on how the target device is attached. On Windows, I've used Eraser (, but there are many options. Same for OS X. Linux is a bit more limited, but if nothing else you can get the job done with dd and /dev/urandom on the raw device (or, for increased paranoia, use the RNG of your choice, I've used ISAAC, OS X /dev/random uses Yarrow).

share|improve this answer
Second that for most spinning hard disks. For a SSD use the 'secure erase' command of the drive. Both because it is more efficient and because non all NAND is exposed the the user. – Hennes Feb 25 '13 at 20:31
"An unsophisticated attacker is unlikely to be able to overcome even a single pass of zeroes": I have yet to see a sophisticated attacker recover a single file on an HDD manufactured less than 10 years ago zeroed out. Just a single one. Even with a SEM... I could not find any paper claiming that so far. – user183734 Sep 6 '13 at 12:56
@Gael I am presuming a Three Letter Agency may have capabilities and successes they do not brag about. – Mark Johnson Sep 9 '13 at 16:06
@Mark Johnson Just as you said: you are presuming. ;) It is not possible to recover usable data using smaller HDD heads with current drives. This is only a question of physical space: HDD manufacturers are trying to densify on-plate data and shrink IO heads as much as possible. If the information between sectors was usable, this would have already been used by the manufacturers already. As well, contiguous sectors are erase all at once, so there is no gap in between. Also, when I say current drives are zeroed out, they are: there is no deterministic persistence. This is needed to avoid errors – user183734 Sep 9 '13 at 16:36
@Gael Technology gets better and black budgets can be virtually unlimited. Regardless, please go read my answer again, especially these two bits: "How paranoid do you want to be?" and "A three-letter-agency might have the capability to recover some data even after overwrites with patterns or random data. Or not. Who knows, they don't talk about their capabilities that I know of." I think the case can be made that overestimating your opponents is less likely to screw you than underestimating them. If you choose to wield Occam's Razor I won't say you are wrong, just that you are not paranoid. – Mark Johnson Sep 9 '13 at 19:28

Old drives used to have common faults which is why many legacy security HDD erasing programs include options like 'multiple passes', etc. Drives of today are not prone to this issue and a single pass of zero/random bytes should be sufficient.

Check out boot & nuke:

share|improve this answer

To my knowledge there is no "best" algorithm. Simply overwrite with random bytes once should be sufficient for hard drives (not necessarily SSD). Even overwriting it several times has not been proven to be any more useful than doing it once. In particular also check out the Criticism article under Gutmann method.

The claim that a disk should be overwritten multiple times stems from the times of tape drives. So this may well be applicable to your backup tapes, still.

You should check out "The Great Zero Challenge" via your favorite search machine. Basically it is true that there is a chance to guess the original contents of a single bit right. But if you are even slightly familiar with probability you know what that means if we're talking about eight bits (i.e. one Byte), let alone Gibibytes of data.

share|improve this answer

The best possible method is "(enhanced) secure erase" it was developed for that purpose. Since it is part of the ATA feature set it works for HDDs aswell as SSDs. If you are paranoid you can run (enhaced) secure erase multiple times.

The easiest way to use it is to make a Live CD/USB of your favourite Linux distro and then run hdparm. It is quite easy. You can follow this guide:


Secure erase overwrites all user data areas with binary zeroes. Enhanced secure erase writes predetermined data patterns (set by the manufacturer) to all user data areas, including sectors that are no longer in use due to reallocation.

share|improve this answer
Sez the manufacturer, who is firmly seated in the pocket of Three Letter Agency. -- Professional Paranoid. – vonbrand Feb 26 '13 at 1:53
If you're that paranoid you can destroy the drive otherwise (enhaced) secure erase is your choice. – kschurig Feb 26 '13 at 15:49
As far as the disk plates are concerned, "(enhanced) secure erase" will just zero out the data. Which is enough unless you can prove me wrong. – user183734 Sep 6 '13 at 12:59

Not the answer you're looking for? Browse other questions tagged .