Skip to content

zero out your drive or "delete it for good"

So you’re selling (or trashing) your computer and want to make sure there’s nothing left on the hard disk afterwards, right?  No problem.  Going from built-in to hand-crafted, try these options...

  1. Use the “Secure Empty Trash” option on your Mac.  It will write zeros over the data 35 times.
  2. Perform an erase/zero out option to wipe the entire disk.  Of course, then you’ll have to install all over.
  3. Use the ‘dd’ command... You can fill up all of your free space using the ‘dd’ command using either /dev/zero for zero-writing or /dev/random for random/garbage-writing. Just copy/paste this part if you want things to go a little faster... (on a 1.67GHz PowerBook G4 it takes under 2 hours).
    1. Open up ‘terminal’. Sudo into root and start a lot of ‘dd’ processes.
      sudo bash
      dd if=/dev/zero of=/tmp/zeroout0 &
      dd if=/dev/zero of=/tmp/zeroout1 &
      dd if=/dev/zero of=/tmp/zeroout2 &
      dd if=/dev/zero of=/tmp/zeroout3 &
      dd if=/dev/zero of=/tmp/zeroout4 &
      dd if=/dev/zero of=/tmp/zeroout5 &
      dd if=/dev/zero of=/tmp/zeroout6 &
      dd if=/dev/zero of=/tmp/zeroout7 &
      dd if=/dev/random of=/tmp/zeroout8 &
      dd if=/dev/random of=/tmp/zeroout9 &
      (the last two random ones are just thrown in for good measure, but are totally unnecessary, a zero is just as good as a machine-generated random number to write over your old data, right?)
    2. Let it run for a while and when you’ve got zero space left, kill off the ‘dd’ processes with something simple... Better yet, when your drive does fill up, the processes will die naturally, so this step may not be necessary.
      ps ax | grep dd | grep zeropart | cut -d ‘ ‘ -f1-2 | xargs kill -9
    3. And finally delete the temporary files.
      rm /tmp/zeropart*
    4. Lather, rinse, and repeat as your paranoia demands

By the way, what’s up with people on craigslist trying to barter for everything.  An exchange, if explicitly allowed, is one thing, but since when is it okay to short-change someone for a back-rub?  Or perhaps, the true question is, what can I get for “free” by helping someone set up their computer?  Just another question that needs to be tabled until a time machine is practical.

Post a Comment

Your email is never published nor shared. Required fields are marked *