Hard drive shredding on Linux

Antivirus, forensics, intrusion detection, cryptography, etc.
Post Reply
Message
Author
labbe5
Posts: 2159
Joined: Wed 13 Nov 2013, 14:26
Location: Canada

Hard drive shredding on Linux

#1 Post by labbe5 »

https://www.addictivetips.com/ubuntu-li ... -on-linux/

Each time you re-install Linux and format your hard drive partitions, the data on them isn’t fully purged. The reasons for this are complicated, but suffice it to say, anyone that gets their hands on an old hard drive that hasn’t been adequately erased can recover personal files and sensitive data.

The most common method for securely erasing a hard drive (aka zeroing) on Linux is done using the DD command. This method isn’t quick, but given the fact that every Linux and Unix system comes with the DD tool pre-installed, it makes this way of erasing a hard drive very accessible.

Another reliable way to erase a hard drive is with the GNU Shred tool. Like DD, it’s included on all Linux distributions in some form.

If DD and Shred aren’t good enough for securely wiping your hard drive, consider using the Darik’s Boot And Nuke tool. It’s a Linux powered open source tool that will delete anything and everything connected to your PC, as long as its running. Using DBAN requires a USB live disk.

Erasing data using dd
To fill the disk with zeroes :
$ sudo dd if=/dev/zero of=/dev/sdx
To use random data :
$ sudo dd if=/dev/urandom of=/dev/sdx

Further reading :
Hard drive shredding on Linux
https://linuxconfig.org/hard-drive-shredding-on-linux
Last edited by labbe5 on Sat 05 Oct 2019, 21:04, edited 1 time in total.

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

Re: dd, shred, dban

#2 Post by RetroTechGuy »

labbe5 wrote:If DD and Shred aren’t good enough for securely wiping your hard drive, consider using the Darik’s Boot And Nuke tool. It’s a Linux powered open source tool that will delete anything and everything connected to your PC, as long as its running. Using DBAN requires a USB live disk.
Dban is also good when you decide to "refresh" a hard drive -- reformat to use in a different system. I have a machine that I can pull all of the hard drives out, and only insert the one to be "cleaned"...

On old hard drives, this operation sometimes helps the hard drive's onboard controller to identify weak sectors on the platters, and relocates them to new media. (then, of course, a fresh format gives the drive another workout)
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#3 Post by Flash »

Is this a good place to point out that if you encrypt your hard disc drive you don't have to worry about anyone else finding out what's on it, ever? No need to dd, shred or dban it before you sell it or give it away.

peterw
Posts: 430
Joined: Wed 19 Jul 2006, 12:12
Location: UK

Wiping SSDs - Don't use old overwriting tools.

#4 Post by peterw »

Adding to post by Flash. It is considered bad practice to wipe SSDs by zeroing, using DBAN, etc. There are two reasons for this:
1. SSDs have control processes inside them that change the place where data is stored to even out "wear" so that some of it will not be wiped and is available for anyone who wants to go to the trouble of getting it back.
2. Overwriting memory locations is said to "wear out" the SSD cells and unneeded writes should be avoided.

If you do want to wipe a SSD use the manufactures software for the task and since you use Linux you can also use the "hdparm" command. See: https://grok.lsu.edu/article.aspx?articleid=16716 for an explanation.

User avatar
Makoto
Posts: 1665
Joined: Fri 04 Sep 2009, 01:30
Location: Out wandering... maybe.

#5 Post by Makoto »

Don't leave any extra spaces between the tags. For some reason, that causes the forum software to make the entire post look blank.
[ Puppy 4.3.1 JP, Frugal install ] * [ XenialPup 7.5, Frugal install ] * [XenialPup 64 7.5, Frugal install] * [ 4GB RAM | 512MB swap ]
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#6 Post by bigpup »

2. Overwriting memory locations is said to "wear out" the SSD cells and unneeded writes should be avoided.

A one time write of zero to all locations is only a one time write.
If that destroys a SSD. It is a piece of junk and should be destroyed.
Western Digital wrote:SSD endurance is commonly described in terms of full Drive Writes Per Day (DWPD) for a certain warranty period (typically 3 or 5 years). In other words, if a 100GB SSD is specified for 1 DWPD, it can withstand 100GB of data written to it every day for the warranty period.
This is even more proof that one single zero write to all of the SSD drive is no big deal.
Experiment with intent to kill
Write to SSD's until they die! :shock:
https://techreport.com/review/27909/the ... e-all-dead
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#7 Post by Flash »

One big difference between SSDs and spinning HDDs is the "wearout" mechanism causes different failure modes. When a HDD fails, it usually does it suddenly and catastrophically. All its data are lost and gone forever, unrecoverable by normal means. A SSD can fail in the same way of course, but supposedly its "wearout" failure mode will cause increasing read errors, more or less randomly distributed and normally correctable by the error correcting code used by all drives. Eventually the read errors will become so many that they swamp the ECC, but, for a considerable while, a SSD will give plenty of warning that it is wearing out -- if you're paying attention.

Post Reply