[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: simple way to securely destroy deleted files in a file system



On 2010-07-15 13:55 -0400, H.S. wrote:
> On 15/07/10 01:38 PM, Perry E. Metzger wrote:
>
> > dd if=/dev/zero of=/dev/scd bs=1M
> 
> Yes, but that would wipe out everything, the OS as well.
> 
> I was looking for just making the already deleted files
> unrecoverable by a casual user. In other words, since a deleted
> file frees the space on disk, by filling up the disk with all
> zeros and then deleting that zeros file would be overwriting the
> earlier deleted files with zero. Am I correct in this?

Yes. The data you write to the new file has to be stored somewhere
and the only sectors available are those previously allocated to
the deleted files.

If you're feeling paranoid, you could fill with junk instead of
NULs to protect against any optimisation at filesystem level.

  perl -e '$bytes = int (1e4 + 1e6 * rand);
    for $n (1..$bytes) { $noise .= chr (int (rand (256))) }
    while (print $noise) {}' >/mnt/sdc1/zeros.bin; sync

-- 
André Majorel <http://www.teaser.fr/~amajorel/>
bugs.debian.org, food for your spambots.


Reply to: