Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Given the fact shred will not be effective on ext3, I wonder what are the available alternatives right now.

$ man shred
...

   CAUTION: Note that shred relies on a very  important  assumption:  that
   the  file system overwrites data in place.  This is the traditional way
   to do things, but many modern file system designs do not  satisfy  this
   assumption.   The following are examples of file systems on which shred
   is not effective, or is not guaranteed to be effective in all file sys‐
   tem modes:

   * log-structured or journaled file systems, such as those supplied with
   AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)
...
share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

shred is fine if you want to shred an entire partition, and most will probably be destroyed if you shred a single file, but possibly not all. If you shred the entire partition then you work below the level of the filesystem (and will have to recreate a filesystem after the fact). This will delete everything so should only be done after making a copy of all valuable data, and having reinstall disks to hand. So if you have data on /dev/sda1 you could unmount the partition, or boot from a live disk, and do

$ sudo shred /dev/sda1

I normally use srm - part of the secure-delete package - for deleting files as it can recursively delete files, unlike shred. I accept it may miss bits, but then I also encrypt my files, so the missed bits should be impossible to decrypt. (I use ecryptfs which encrypts each file with a different key, so provided the first part of the file with the key is properly overwritten, the rest of the file will be impossible to recover. ecryptfs is what is used if you select "encrypt my files" on installation).

share|improve this answer
1  
Summarizing: Either shred on the entire partition (good enough for me) or srm on a single file if file was encrypted in first place. –  Tzury Bar Yochay Oct 18 '10 at 4:21
add comment

Forget shred (which doesn't work in all cases: no matter what the filesystem is, concurrent activity can throw it off), and encrypt any sensitive file. See these questions:
http://askubuntu.com/questions/1081/how-do-i-encrypt-my-home-partition
http://askubuntu.com/questions/4796/how-can-i-simply-password-protect-a-file
http://askubuntu.com/questions/6604/is-there-a-filevault-alternative-for-ubuntu

share|improve this answer
add comment

As far as I can tell there are no alternatives to shred for journaled file systems. However you can turn your ext3 partition into ext2 temporarily, though it can be a pain. For more information take a look at this article.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.