Sometimes you need to destroy or wipe data from hard drives (for example, before you sell your old hard drives on eBay) so that nobody else can access them
shred can be used to wipe files and also partitions and hard drives. If you take a look at shred’s man page…
2 Using shred
If you want to wipe your system partition, you must boot into a live system (such as Knoppix, the Ubuntu Live-CD, your hoster’s rescue system, etc.). This is not needed if you don’t want to wipe your system partition.
shred should already be installed (you can check with
); if it isn’t you can install it as follows (Debian/Ubuntu/Knoppix):
As I said before, I want to use shred on partitions and hard drives. So, for example, to wipe the partition /dev/sda5, you can use
-v: show progress
-f: change permissions to allow writing if necessary
-z: add a final overwrite with zeros to hide shredding
-n: overwrite N times instead of the default (3)
So this would overwrite /dev/sda5 ten times.
You can also use shred for RAID partitions, e.g.
And to wipe a full hard drive like /dev/sda, you can use
Please note that shred can take a long time, depending on the size of your partitions/hard drives and the number of runs (-n).