Full Disclosure mailing list archives

Re: Reality, humor, and history (was Re: MORE CRITICAL FLAWS IN MS WINDOWS EXPLORER


From: Dave Horsfall <dave () horsfall org>
Date: Thu, 13 Jan 2005 21:34:55 +1100 (EST)

On Wed, 12 Jan 2005 Valdis.Kletnieks () vt edu wrote:

(*) My all-time favorite "Close, but no ceee-gar" was the advice column for a
Unix journal where the author *remembered* the old "3 syncs before halt"
adage - but got it Very Wrong by advising "sync;sync;sync;halt".  Bonus
points if you can remember (a) the *original* reason for the advice *and* 
(b) how this version was Very Wrong (there's *multiple* answers for this one ;)

Early Unixes -- especially those with slow disks such as the RK05 -- could 
take several seconds to flush the buffered data to disk.  The sync() call 
only *scheduled* the flush and returned right away, thus the disk data 
(especially the meta-data such as inodes etc) may not be up to date when 
you hit the switch (early Unixes did not have a halt command).

By typing:

# sync
# sync
# sync

i.e. by waiting for the command to return, thrice, you were reasonably 
sure that the buffers were flushed, especially if you could see the disk 
activity lamps (not LEDs in those days).

By using "sync; sync; sync" the operator did not have to wait, and so was 
lulled into a false sense of security.

This was really important in those days, because the filesystem simply was 
not as resilient as it is now; a power failure *guaranteed* that you would 
lose files, and it was time for "check" (in Edition 5, and which became 
ncheck/dcheck/icheck and eventually fsck) and "clri".

-- Dave, who had creamed several PDP-11 Unixes in his time
_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.netsys.com/full-disclosure-charter.html


Current thread: