Advanced

How To Securely Destroy/Wipe Data On Hard Drives With shred

Posted by falko on · 7 comments
HowtoForge; By Falko Timme
Mail this story
Print this story

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. Simply deleting data (e.g. with rm) is not enough because that just removes the file system pointer, but not the data, so it can easily be undeleted with recovery software. Even zero'ing out your hard drive might not be enough. Here's where shred comes into play - shred can overwrite the files and partitions repeatedly, in order to make it harder for even very expensive hardware probing to recover the data.

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. Simply deleting data (e.g. with rm) is not enough because that just removes the file system pointer, but not the data, so it can easily be undeleted with recovery software. Even zero'ing out your hard drive might not be enough. Here's where shred comes into play - shred can overwrite the files and partitions repeatedly, in order to make it harder for even very expensive hardware probing to recover the data.

http://www.howtoforge.com/how-to-securely-destroy-wipe-data-on-hard-drives-with-shred

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Linux

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (7)

Quoting: shred -vfz -n 10 /dev/sda5

So this would overwrite /dev/sda5 ten times.


Actually, eleven times, ten times with the -n option and one more pass of all zero's with the -z option.
Although the author points out the caveat that the data must be in a file system that overwrites data _in_place_, rather than just updating the journal for example, I have an additional suggestion.

Anyone this worried about data recover will be technically astute enough to be able to reformat the drive.

So rather than cross one's fingers with an ext3 or ext4 file system, first repartition and reformat the device with one big partition using vfat or ntfs. This also avoids the problem of maybe forgetting the disk has more than one partition, such as swap.

Then there's no question that the shred will, indeed, "do the whole disk".

Just my 1/17.04 oz Ag. (at the spot price in FRNs)
from the article wrote:This is something you need to worry about only if you use shred to wipe files. However, as I want to wipe hard drives, I will use shred for whole partitions or hard drives in this tutorial.
so there is no need to reformat the drive or partition if you want to wipe all of it. and when you want to only wipe a file, formatting is not an option.

greetings, eMBee.
Quoting:Then there's no question that the shred will, indeed, "do the whole disk".
A pair of notably popular and good secure hard-drive data-wiping alternatives to the coreutils package's 'shred' are 'DBAN' and 'wipe'.

For whole-disk wiping and zeroing, one can also use the relatively simple and commonly-used command string
dd if=/dev/zero of=/dev/sda bs=1M
This above 'dd' string is by no means as secure or complete as 'shred', and yet it has the decided advantage of being much quicker for those who perforce require the shortest time possible for wiping a whole disk.

For those who require quickly wiping solely the MBR instead of wiping the entire disk, there is the commonly-used 'dd' command string
dd if=/dev/zero of=/dev/hda bs=446 count=1




You absolutely should run this 11 times. Don't settle for 10, because 11 is one better; it's that extra push over the cliff.
I believe that hdparm allows direct access to modern harddrives built-in Secure Erase utility (it's a bit of a pain, because you have to set a password first, so you can use the password to run Secure Erase, but IIRC, it will really erase * everything * , including stuff most erase/wipe programs never see or can't reach (hidden partitions, space between tracks, etc)

And some Linux Partitioning distros like Parted Magic even provide a GUI
I second the point about writing-in-place, but:

1. Remember that some logging filesystems use the log only for metadata, not file data.

2. A secure overwrite can be accomplished after deleting the file, via "dd if=/dev/zero of=zeros bs=1M" in the same directory that held the deleted file. It fills the filesystem with a zero'd file, which can then be shredded if you wish. This will include the space which held the deleted file data.

2a. Point #2 not advised for SSD or thinly-provisioned filesystems, which have been trimmed. It will allocate all the space in the FS. However, an SSD won't require a shred of the zero file, since it has no residual magnetic flux surrounding the sectors.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post