# Secure delete on journaling filesystem?

## befortin

I'm using Reiserfs and I'm looking for a way to securely delete file on this filesystem (and fill the empty space on the drive). The secure-delete package, from THC, doesn't work for journaling filesystems. And I don't want to delete ALL the data on the drive  :Wink: 

Anyone knows a package that could do this??

----------

## codergeek42

Perhaps you can just fill it with random meaningless data, then rm it like normal?

```
# dd if=/dev/urandom of=/path/to/file

# dd if=/dev/urandom of=/path/to/file

# dd if=/dev/urandom of=/path/to/file

(...do it a few more times...)

# dd if=/dev/zero of=/path/to/file

# rm -f /path/to/file

```

You may also want to unmount the filesystem to be sure that the transactions are removed from the journal and flushed to disk.

----------

## PowerFactor

 *codergeek42 wrote:*   

> Perhaps you can just fill it with random meaningless data, then rm it like normal?

 

Doesn't work on a journaled filesystem, for the same reasons secure-delete, shred and others don't work.

----------

## Roguelazer

Switch to ext3 and mount it as ext2?  :Razz: 

----------

## codergeek42

 *PowerFactor wrote:*   

>  *codergeek42 wrote:*   Perhaps you can just fill it with random meaningless data, then rm it like normal? 
> 
> Doesn't work on a journaled filesystem, for the same reasons secure-delete, shred and others don't work.

 Ok this is going slightly off-topic, I apologize; but why wouldn't this work on a journalled filesystem if you force it to flush all transactions to the filesystem by unmounting it instead of simply letting them possibly remain in the journal? Wouldn't it have the same effect as a non-journalled filesystem that the filesystem itself is immediately altered? What about mounting the filesystem with synchronous I/O (adding the 'sync' moun option to /etc/fstab, for example)?

----------

## befortin

OMG! Next time I'll use the good ol' ext2!!

----------

## PowerFactor

 *codergeek42 wrote:*   

>  *PowerFactor wrote:*    *codergeek42 wrote:*   Perhaps you can just fill it with random meaningless data, then rm it like normal? 
> 
> Doesn't work on a journaled filesystem, for the same reasons secure-delete, shred and others don't work. Ok this is going slightly off-topic, I apologize; but why wouldn't this work on a journalled filesystem ...

 

See the shred manpage for a brief description of the problem.

----------

