# securely cleansing a hard drive/partition [answered]

## robgrady

I know there have been a few threads on how to securely clean a partition or hard drive, but none of them seem to reach conclusions for my question (if I missed one, please just point me to it).  I need to wipe all the data from my hard drive because it contains proprietary data.  However, I cannot physically destroy the drive.  So what is the next best option?  I have seen shred, but I am using ext3.  This is what the shred info page has to say:

 *Quote:*   

>    *Please note* that `shred' relies on a very important assumption:
> 
> that the filesystem overwrites data in place.  This is the traditional
> 
> way to do things, but many modern filesystem designs do not satisfy this
> ...

 

So it would seem that shred wouldn't work for me.  But if I want to shred an entire partition or even the entire hard drive, is the problem eliminated?

In short, can I use shred to clean an entire hard drive or ext3 partition, or is there a better way?

----------

## pjp

Moved from Other Things Gentoo.

----------

## robgrady

Thanks pjp, I wasn't sure if this would be the right forum or not.

----------

## barbar

AFAIK shred is designed to erase single files. Your question how to securely delete a partition depends how you define secure.

I use wipe (part of the knoppix-std boot cd): www.knoppix-std.org

There is also a bootable floopy named autoclave: http://staff.washington.edu/jdlarios/autoclave/

but I haven't used it so far.

----------

## robgrady

Well, I checked the man page on wipe and it says pretty much the same thing as shred:

 *Quote:*   

> Wiping over NFS or over a journalling filesystem (ReiserFS etc.) will most probably not work.

 

It also says:

 *Quote:*   

> In particular : don't wipe a whole harddisk (eg. wipe -kD /dev/hda is bad) since this will destroy your master boot record. Bad idea.

 

So from these two quotes, it seems that wipe won't really work for me since I use ext3 which is a journaling filesystem.

As for autoclave, that sounds like it is exactly what I am looking for, but they don't mention anything about journaling filesystems.  That wouldn't worry me, except that every other utility I have considered has at least brought up the topic.  Also, they don't mention any updates after April 2002.  Does anyone have experience with autoclave?

By the way, by secure I mean that this drive contains proprietary data which would be very bad to fall into a competitor's hands.  Essentially, I would prefer to just melt it, but I am not allowed to do so.  Therefore, I am looking for the next best thing.

----------

## TheCoop

shredding a block device (shred /dev/hda or whatever) will clear the disk surface, which is what you want if you want a blank disk to sell on

----------

## codergeek42

```
# dd if=/dev/urandom of=/dev/BLAH

# dd if=/dev/zero of=/dev/BLAH
```

Repeat as many times as needed. =)

----------

## robgrady

Just one more question. I read that shredding the entire drive would be a bad idea since it would destroy the master boot record.

 *robgrady wrote:*   

>  *Quote:*   In particular : don't wipe a whole harddisk (eg. wipe -kD /dev/hda is bad) since this will destroy your master boot record. Bad idea. 

 

That was from the wipe manpage.  Is that true?

----------

## infiniteedge

i definitely agree with using dd and urandom.  ive done some light forensics work in the past and even one pass of urandom is more than enough to screw certain things up.  if all else fails boot to a livecd and use that.

----------

## nevynxxx

 *robgrady wrote:*   

> 
> 
> That was from the wipe manpage.  Is that true?

 

Obviously its true, it wouldn't be there if it wasn't.

Your question is does it matter?

1) If you don't boot off the drive: No.

2) If you install a bootloader(even windows!) it will be able to re-create the MBR: so No.

----------

## robgrady

 *nevynxxx wrote:*   

> Your question is does it matter?
> 
> 1) If you don't boot off the drive: No.
> 
> 2) If you install a bootloader(even windows!) it will be able to re-create the MBR: so No.

 

That is exactly what I thought, so what where they talking about?  And yes, that is my question, not whether the MBR gets deleted.

----------

## nevynxxx

 *robgrady wrote:*   

> 
> 
> That is exactly what I thought, so what where they talking about?  And yes, that is my question, not whether the MBR gets deleted.

 

At a guess they are saying "You do this on your bootable partition and your computer wont boot. If you don't know how to recover from that (*Ahem* Knoppix *Ahem*) then don't do it, and don't whinge at us when you get your system reinstalled.

----------

## robgrady

Ah, I guess that makes sense.

Thanks everyone for you're suggestions.  In case anyone is interested, I plan on using a combination of both shred and dd.  I like that shred will automatically make several (25+) passes, but I also like knowing exactly what I am doing with dd.  Again, thanks.

----------

