Re: Erasing File Data



Ertugrul Soeylemez wrote:

"Sebastian G." <seppi@xxxxxxxxx> (07-05-14 15:54:54):

So why don't you simply use /dev/zero?
Because there is no point in doing so.
There is, and I've already told: shred does a very bad job.

But in what way?


shred doesn't care for journaling file systems. dd simply ignores any journal and writes to the raw partition or drive.

shred doesn't care for caches. dd only hits the kernel buffers, with guarantees of write commitment.

And for simply overwriting files or free space, there are serious alternatives which do the job right.


Next thing is, I don't know how my hard-disk deals with zero-writes,
when there is already a zero in its internal cache. It may well be
that it's intelligent enough not to write another zero in that case.
What a nonsense. The controller nor the cache logic cares for
full-zero blocks.

That wasn't meant to be special for zeroes. What if the cache contains
a block N with the value X and you want to write the same block X to the
same position N again? I don't know, but it would make sense to just
ignore it.


If N wasn't written to the platers yet, the same would be true for 'shred', and a simply 'sync' would resolve the issue - and the command merging would be justified anyway. If N was already written, then there's simply no need to write it again.
.



Relevant Pages

  • Re: PG_zero
    ... Other freeing is assumed cache hot and LRU ordered on the hot ... > contents are not zero anymore by the time you free it, ... > (more cpus will make it more memory bound somewhat). ...
    (Linux-Kernel)
  • Re: what happened to page_mkwrite? - was: Re: page_mkwrite seems broken
    ... I am stuck with ntfs at the moment at ... >> former is not nice as it means we allocate space even when only reading ... When you say "zero pages" you mean just normal page cache pages that are ... If your answer above is that the pages are normal page cache pages, ...
    (Linux-Kernel)
  • Re: libCrun symbol "zero_ints"
    ... somewhat obvious answer that "zero_ints" simply initializes integer ... variables to zero. ... I guess the problem is I don't know if I care. ... values of SPARC registers at the time of the crash, ...
    (comp.unix.solaris)
  • Re: More number theory tidbits, paper?
    ... On Sun, 1 Aug 2004, James Harris wrote: ... >> How many odd composites less than N are divisible by 3? ... Why would I care, unless someone told me to derive it, as you did? ... close to zero in all cases. ...
    (sci.math)
  • Re: libCrun symbol "zero_ints"
    ... somewhat obvious answer that "zero_ints" simply initializes integer ... variables to zero. ... Why do you care? ...
    (comp.unix.solaris)