Completely erasing a hard disk before resale or throwing away

I quite often get older computers donated either for recycling, passing on to less fortunate or simply for the scrap yard.

Before these leave me for another life or home I try hard to erase all posibilities of data theft or discovery of images, documents etc. I dont believe there is anything unsuitable on them but links to bank, credit cards, or personal details I want to make sure its not possible.

Many years ago with dos or windows, you formatted the disk, but in truth it did not do much just killed the FAT so you could get somethings back. Recovera from pirifom was excellent.

Now it tends to be older windows boxes I get, so I do a format to Linux format using the disk program, in mint 2 options rapid (5 mins) or deep couple of hours, all depends on size of disk.

I also convert it to linux ext4 format not FAT.

I will then install a clean new copy of mint.

Do you consider that secure ?
Do you do different ?

Apple have several pages on the site on how to clean a mac before resale.

I know answer, take disk out and distroy physically, I know societies exist for data recovery…

Just a general discussion topic.

2 Likes

zero every byte on the disk

dd if=/dev/null of=/dev/sdx

replace ‘sdx’ with your own disk name
Dont get the name wrong or you may erase your own computers disk.
It does not matter how the disk was formatted, ‘dd’ overwrites everything, even the MBR

6 Likes

Used to be part of my job - data wiping hard drives from decommissioned Sun Solaris servers.

The Solaris “format” (not dissimilar to Linux fdisk) menu system, available when booting off a Solaris ISO - offered several choices - one was four passes of writing 0’s and 1’s - that was considered as satisfactory by the US military…

So - I guess - in Linux would could just - several times, use dd to dump /dev/random onto the physical media - over several (e.g. 4) passes…

Me - I’ve never done it for my personal stuff…

4 Likes

I used to use /dev/zero, but the effect is the same I guess.

3 Likes

I think badblocks -svw /dev/sdX will do this, and as a bonus you’ll get information about bad sectors, if there are any.

4 Likes

Wow powerful command !
Just as an aside to that when linux formats the disk it marks bad sectors to not be used, If you use the write zero what does it do with bad sectors ?

Would it be different for ssd ?

And thanks dan for your story always adds colour

1 Like

Does anyone know which is the best?
/dev/zero
/dev/random
/dev/null
or
badblocks -svw /dev/sdX

3 Likes

I think today the disk controller looks after bad sectors, regardless of how or what you
write to the disk.
That was not always the case. You used to do it by hand .

powerful command

Not called ‘data destroyer’ without reason.
BTW dd is one of the oldest Unix commands. It was one of the few Unix commands stolen from earlier systems… hence its strange non-standard syntax

4 Likes

In case of ssd drives, I would ask the firmware to do it. Doing it manually via de os (for example sending an infinite amount of zeroes marching to that disk) may actually harm the disk

2 Likes

Thanks for the warning. I don’t have any SSD so cannot check. Where would a user find this info to do it ?

One would hope not, but better to be safe.
Thanks for warning.

2 Likes

Oddly enough, your friendly local hdparm ought to be able to help. However, to actually do anything with the ssd, you’ll need sdparm iirc.

1 Like

Found this interesting article on formatting a SSD.

https://www.makeuseof.com/tag/securely-erase-ssd-without-destroying/

3 Likes

The erase methods given in that article tell the SSD to flag each block as erased.
They do not erase every byte, they set set every block up as available for writing.
I imagine someone could still read the block contents?

3 Likes

Hi Xander,

Sorry for the question, but just so I understand: isn’t constantly sending “0” or a full copy of an SSD that is completely full to another SSD the same thing? Isn’t it all data?

Thank you for your help

Jorge

1 Like

@Tech_JA

 isn’t constantly sending “0” or a full copy of an SSD that is completely full to another SSD the same thing? Isn’t it all data?

I have been asking myself the same question.
Yet, one can read numerous articles which say dont erase an SSD by writing zeros
It does not make sense.
Surely an SSD can endure one complete write without seriously degrading its expected lifetime?
Neville

4 Likes

Hi Neville,
For me, as a layman, SSD memories are non-volatile memories (flash memories) and, from my point of view, there are only two ways to test the memories (I’m talking about the integrated circuits, or “chips” as some people call them) and the factory date retention: set the data of the memories to zero, analyze, set the data to 1 and analyze again or use a pattern between 0 and 1, but the memory has to be written and read and analyzed.

There is a problem with limiting writes to memory. I’ve read articles, but I haven’t been able to find the technical reason for this.

Jorge

3 Likes

Glad i asked this …

I understand writing to ssd wears them out quicker than normal hard disks, but not sure. Hence I dont use them prefer read physical disks. But know my phone tablet are ssd.

1 Like

I am no expert, but from my reading, any SSD the size of 240 GB or larger will probably last at least 5 years and maybe more for a home user. Today a disk of 240 GB is consider a small disk.

There was a lot of hype (some justified) about SSD wearing out when they first came out. But these early SSD where 60 GB or a lot smaller. Fewer cells meant the cell were being used more often.

To make a SSD last longer, I read that leaving about 25 to 30% of the disk space free. This allow “wear leveling” to be used.

I visited an SSD manufacture of a 240 GB SSD. Their guarantee was “3 years or 100 TBW, whichever comes first.” So if a home use wrote 50 GB a day to this SSD?
1 TB = 1000 GB — 100 TB x 1000 = 100,000 — 100,000 / 50 GB per day = 2000 days

2000 days equal about 5 1/2 years. I believe for a home user writing 50 GB per day seems high.
Is my math correct?

5 Likes

Well, from what I read there was no way any data could be recover. One person said “Secure Erase (in most instances) doesn’t tell the SSD to write anything, it literally just tells the SSDs “open all the gates and let the voltage dump out to ground”. Which generally makes it much faster then attempting to re-write.”

I am assuming he means that all the cells with “0” would stay that way and all the cells with “1” would now be “0”. With all cell setting at “0” that would mean no data and nothing to recover.

I could be wrong and it would not be the first time.

I still don’t understand why not writing all “1” or “0” to a SSD would not format it properly. In my earlier example about SSD usage, writing 240 GB of data to a 240 GB disk would only account for 5 days usages out of 2000 days.

4 Likes