Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to erase data?

  1. Feb 28, 2018 #1
    I have read in several places, I don't remember exactly where, that to effectively and securely erase stored date from most modern digital storage devices, it is necessary (or at least this is one often-used technique) to repeatedly, in several, maybe dozens, of passes, write randomly selected strings of 0's and 1's over the data. My Bitdefender antivirus app now has what is called a "file shredder" to do just that. (I imagined from the name that it used this technique, and a call to Bitdefender indicated that it probably did.)

    My question is: Why is it necessary to use such a time-consuming technique, when, it seems, just writing all 0's (or all 1's) would be quicker and even more effective? It is true that the ultimate limit set by quantum mechanics on the accuracy with which the state of every atom, free electron, etc. in the storage device after writing the 0's could be known would allow, at least in some situations and for some storage locations, the determination of whether a 0 or a 1 had been stored there before writing the 0's, but this could not be done with present technology, or any likely future technology. I could be wrong about this. Am I wrong, or were instead the descriptions I read of erasing techniques, and the Bitdefender phone tech person, both wrong, or, more unlikely, are the erasing techniques used generally, including by Bitdefender, obviously needlessly complicated and time-consuming?
  2. jcsd
  3. Feb 28, 2018 #2


    User Avatar

    Staff: Mentor

    For magnetic storage devices, such as hard disks, there is residual magnetism that can be measured. So even if all bits are set to 0 or 1, with the proper tools one can still read the information that was there before. Cycling many times between 0's and 1's reduces this residual magnetism, making it harder to find the previous state of each bit.

    I do not know if the same is true of other types of memory, like SSD, but I assume it could be. You have to remember that each bit is not held by a single atom/molecule, but by a huge bunch of them, such that writing a new bit doesn't change completely the state of the underlying medium (most atoms/molecules change their state, not all of them).

    As for Bitdefender's approach of using random strings, I don't know if this is more efficient than just cycling 0's and 1's.
  4. Feb 28, 2018 #3


    Staff: Mentor

    When data is written to a hard disk, it is streamed to a magnetic head while the disk spins underneath it. An actuator moves the head from track to track as it writes your data. Each track has a predefined width that the head travels in. Because of vibration the head doesn't travel in a simple circle but randomly wiggles back and forth a bit.as the track is written.


    Whether you writing zeros or ones there will still be some residual data because the head never passes over the same spot on the track to completely overwrite/erase the prior data written there meaning it could be read back so multiple writes of random data obscure it more completely.

    The other part is that when you delete files on your hard disk they aren't actually deleted. The file is unlinked from the filename to disk sector mapping but the data will still be there for awhile (hence recovery programs can often bring back deleted files in the near term). In the longer term, the OS will begin to reuse the deleted tracks once its cycled thru its free tracks.

    Imagine having a column of names on a whiteboard new names are added to the bottom of the list and deleted names are simply erased. Once you hit the bottom of the whiteboard writing new names then you go back to the top and fill in the blanked/erased rows with new names. That's kind of how a hard disk works. THis strategy also benefits the hard disk in not reusing the some areas more than others which could lead to faster hard disk failures as the head may scrap the disk surface slightly with each pass and and disk shock.


    SSDs and USB sticks are electronic memory based with different operating characteristics from hard drives. I don't think they have the same issue when overwrites are done. However, they do practice the notion of minimal writes to a given location to preserve the SSD.

  5. Mar 6, 2018 #4
    DrClaude and jedishrfu,

    Thank you for your answers. Since I read them I've been looking online for more articles about erasing data, and found, as is often the case online, considerable differences of opinion about what techniques are best in different situations. Without going into tedious details, the consensus, to the extent it exists, seems to be that to erase moderately sensitive data on magnetic drives that are going to be resold or junked, several, but not dozens, of passes writing randomly selected 0's and 1's is desirable and also sufficient. For highly confidential information, destruction of the drives is advisable. For personal computers being resold or junked, maybe just writing all 0's or all 1's is good enough.

    Actually what I had in mind by my "most modern digital storage devices" were SSD's and USB flash drives. For them, although it's not entirely clear, writing all 0's or all 1's may always be sufficient in those cases where it can be done, but often the construction and programming of such drives makes the overwriting of certain data on them about impossible, so different techniques, such as encryption of the data before storage or destruction of the drives, should be used. You probably already know more about this than I do.

    Wiggling of the write head on a hard disk is something I hadn't thought about.
  6. Mar 6, 2018 #5


    Staff: Mentor

    I think you summarized the state of data erasure well.

    If the computer has been used to conduct online banking, shopping, home finance, tax preparation... then I'd be inclined to remove the hard drive.

    There are folks who buy junk computers just to see what they can find on the hard drive.

    I wouldn't want to risk that scenario so I remove the drive and destroy it instead.
  7. Mar 6, 2018 #6
    There was some experiments where overwritten data could be restored based on residual magnetism, but that was back in the MFM era. Around 30 (or more) years ago.
    These days, it's true that with complicated instruments remnants of previous data can be identified, but that's all. It can be identified, and things stops at this point. Like a skeleton can be identified - it is a skeleton, see?

    Overwriting is completely safe for sensitive data too. What makes the difference is, that for sensitive data the staff who does the overwriting is not to be trusted, so it is a requirement to identify the wreck of the drive before disposing it.

    The very point is, that for magnetic storage it has to be physical overwriting. Just logical 'delete' won't do.
  8. Mar 6, 2018 #7

    Vanadium 50

    User Avatar
    Staff Emeritus
    Science Advisor
    Education Advisor
    2017 Award

    I think you need to decide who you want to keep from reading your stuff. A random tech-savvy criminal? Or a major world government? That will determine the steps you need to take in protecting it. For me, a secure erase followed by a few hammer blows is plenty.

    The more interesting question is what to do with a failed drive that used to have sensitive data on it.
  9. Mar 6, 2018 #8
    For my failed drives, I crack the drive open using a hammer, and for drives with platters, I grind the surfaces down with a belt sander. I physically break up the rest of the drive and put the pieces into a crock pot full of salty brine overnight. I let them cool in the brine after that until it's trash day, then throw the parts out. Any working drive I am disposing of, I tend to follow the above steps for as well. I work in IT. The last thing I want is someone one-upping me on drive security.

    I second Vanadium's response - in general you are probably good with even a basic secure erase that overwrites the drive with random data 1-3 times. If you're a bit paranoid, or a perfectionist, overwrite ten times.

    I would add one more thing - if you are truly worried about your data being taken, encrypt your drive - both because if the drive is stolen it cannot be read, and because if you later wipe the drive, the data you are obscuring is encrypted - if someone did get the data, it wouldn't be much good to them.
  10. Mar 13, 2018 #9


    User Avatar
    Science Advisor

    CCleaner has a Drive Wiper tool.
    So does the Paragon Hard Disk Suite.
    I seem to remember several freeware tools that do the same thing.
  11. Mar 14, 2018 #10


    User Avatar

    I don't believe CCleaner can erase your Local Disk, though...?
    It won't on my computer, anyway...


  12. Mar 14, 2018 #11
    Then get a Linux stick and use the BADBLOCKS program in destructive mode.

    Better to have some cooling for the drive, because it'll get some heat...
  13. Mar 14, 2018 #12

    Vanadium 50

    User Avatar
    Staff Emeritus
    Science Advisor
    Education Advisor
    2017 Award

    No Windows program can erase the boot drive since the code it needs to run is on that drive.
  14. Mar 14, 2018 #13


    User Avatar

    :check:... Those were my thoughts too.
    Last edited: Mar 14, 2018
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted