You are not logged in.

#1 2010-12-12 00:32:36

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

[SOLVED] Shredding a Hard Drive

I recently used the shred command on a hard drive like so,

shred -vfz /dev/sda

The whole process took several hours so I assumed it went well, but then afterwards when I looked into the drive with cfdisk I noticed that the partitions were still there. Does that make sense? Or does that mean that shred didn't actually work?

Last edited by tony5429 (2010-12-12 01:52:42)

Offline

#2 2010-12-12 00:48:29

hwkiller
Member
Registered: 2009-07-21
Posts: 56

Re: [SOLVED] Shredding a Hard Drive

Well, another course of action would be to simply dd "zero" or "random" to of=/dev/sda

Wouldn't that work too?

Offline

#3 2010-12-12 00:55:34

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: [SOLVED] Shredding a Hard Drive

The man page for shred says it overwrites files, so I guess it does not deal with the MBR then! Personally I have always just used dd as hwkiller says "dd if=/dev/zero of=/dev/sda bs=1M".

The FUD security types whose job it is to keep their jobs say you should do that 7 times to ensure no stray magnetic signatures remain. I call pure bunk on that one...


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#4 2010-12-12 01:51:23

tony5429
Member
Registered: 2006-03-28
Posts: 1,017

Re: [SOLVED] Shredding a Hard Drive

Thanks for the feedback! Yeah; from what I've read if you are selling a hard drive and are concerned about privacy (which is my case), the advantage to using shred over simply zero-filling with dd is that you can fill with pseudorandom data multiple times and then zero-fill at the end. For example, to fill the drive with pseudorandom data 7 different times and then zero-fill the drive,

shred -vfz -n 7 /dev/sda

Pretty nifty tool. That makes sense about the MBR. Thanks again.

Offline

#5 2010-12-12 02:07:00

darie
Member
From: LE | .de
Registered: 2009-04-22
Posts: 16

Re: [SOLVED] Shredding a Hard Drive

man hdparm

--security-erase PWD
              Erase (locked) drive, using password PWD (DANGEROUS).  Password is given as an ASCII string and is padded with NULs to reach 32 bytes.  Use the special password
              NULL  to  represent  an empty password.  The applicable drive password is selected with the --user-master switch (default is "user" password).  No other options
              are permitted on the command line with this one.

--security-erase-enhanced PWD
              Enhanced erase (locked) drive, using password PWD (DANGEROUS).  Password is given as an ASCII string and is padded with NULs to reach 32 bytes.  The  applicable
              drive password is selected with the --user-master switch (default is "user" password).  No other options are permitted on the command line with this one.

You can use the parted magic boot cd for example. It has a GUI for this erasing method and it's pretty fast :-)

Offline

#6 2010-12-12 02:33:28

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: [SOLVED] Shredding a Hard Drive

Another cute one-liner:

for n in `seq 7`; do dd if=/dev/urandom of=/dev/sda bs=8b conv=notrunc; done

Offline

#7 2010-12-12 09:05:04

briest
Member
From: Katowice, PL
Registered: 2006-05-04
Posts: 468

Re: [SOLVED] Shredding a Hard Drive

One can also use badblocks tool with its write-mode test, maybe with additional -t random. It is slower than wipe-only solutions, but if you're going to sell or reuse a disk, testing it thoroughly seems reasonable anyways...

Offline

#8 2010-12-12 10:03:44

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: [SOLVED] Shredding a Hard Drive


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#9 2010-12-12 10:10:36

CountDuckula
Member
Registered: 2010-02-28
Posts: 151

Re: [SOLVED] Shredding a Hard Drive

If your not going to reuse/sell the drive I find an angle grinder, large hammer and welding torch are good.

Offline

#10 2010-12-13 01:06:11

toofishes
Developer
From: Chicago, IL
Registered: 2006-06-06
Posts: 602
Website

Re: [SOLVED] Shredding a Hard Drive

CountDuckula wrote:

If your not going to reuse/sell the drive I find an angle grinder, large hammer and welding torch are good.

And who buys, let alone sells used hard drives anyway? They are so darn cheap now and anything you are buying is probably going to be undersized and already on its way to failing...

Just open the thing up and run a magnet past it now that it isn't a Faraday cage, and then stab something through it. Game over.

Offline

#11 2010-12-13 01:27:26

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: [SOLVED] Shredding a Hard Drive

CountDuckula wrote:

If your not going to reuse/sell the drive I find an angle grinder, large hammer and welding torch are good.

I prefer an axe or the "Jaws-of-Life":
cut_4055.gif
(The joys of being in the fire brigade wink tongue)

Offline

Board footer

Powered by FluxBB