[ale] Need an iso to wipe hard drives.

Doug McNash dmcnash at charter.net
Wed Apr 21 21:11:42 EDT 2010


---- JK <jknapka at kneuro.net> wrote: 
> On 4/17/2010 8:20 PM, Doug McNash wrote:
> >
> > ---- Chris Fowler<cfowler at outpostsentinel.com>  wrote:
> >> I also used to have a program that I wrote which would open a file for RW and fill it with
> >> random stuff.  If would seek back to the beginning and repeat a few times then close and
> >> finally delete.
> >
> > Unless this file is much bigger than the RAM used for file buffer caching (which on linux is
> > quite a large percentage) not much is actually being written to the magnetic media unless you do
> > a sync, fsync or unmount the drive.
> 
> 
> Except that there's a kernel thread that writes dirty buffers
> to disk periodically.  The semantics of the "sync" system call
> are, "Write all dirty buffers to disk and don't return until you're
> done". But in normal operation I'd be astonished if most dirty
> buffers weren't written out within a few seconds, even without an
> explicit sync.  Only if something was writing data faster than
> it could be sent to disk, would there be much danger of having
> a lot of dirty buffers in RAM for any length of time.
> 
> Don't know about hardware disk caches, but that's what happens
> in the kernel. (Unless things have changed a whole lot since
> 2.4.)
> 
> -- JK
> 

Yep, but Chris says he did an lseek to write over the file again which is probably fast enough to only write over the buffer, not the disk.

Speaking of sync, in the old days we would sync three times (The syncing will be three - like the Monty Python Holy Hand Grenade) to make sure the data got to disk. I was perusing the linux code the other day and saw that the VM code was going back over the dirty buffer list a second time after the first pass. I found it pretty amusing that a third of my efforts at syncing have been wasted on linux.
--
doug mcnash




More information about the Ale mailing list