👋 Hello! I'm Alphonsio the robot. Ask me a question, I'll try to answer.

On Linux, how to securely erase data on a hard drive?

On Linux the best way to definitively erase data on a hard drive is to use the command-line utility shred. It will overwrite all the blocks on the device with random data three times:

sudo shred /dev/sdxx

Here are some useful options:

  • -v verbose;
  • -n N overwrite N times instead of the default (3);
  • -z set all bits to zero after the last iteration.
More