How to shred/wipe disks/partitions

This post is over 3 years old, so please keep in mind that some of its content might not be relevant anymore.

If I decide to sell or when I have to return a hard drive I want to make sure not everyone can access my data.
To do that I've often used the command shred this way:

shred -vzf -n 5 /dev/sdb

where:
-v; show progress
-z; add an extra pass of zeros to hide shredding
-f; change permissions to allow shredding (when needed)
-n; overwrite N times instead of 3 (the default)

NB: Make sure to replace "sdb" with the correct hard drive you want to wipe.

I often leave the -n parameter to 3 as that is enough for my needs.

Furthermore, you can also shred a single partition replacing /dev/sdb with /dev/sdb3 for example and also a raid partition (eg: /dev/md0).

Enjoy!

Leave a Reply

Your email address will not be published.