Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email firstname.lastname@example.org
Re: [Full-Disclosure] Reality, humor, and history (was Re: MORE CRITICAL FLAWS IN MS WINDOWS EXPLORER
From: Dave Horsfall (davehorsfall.org)
Date: Thu Jan 13 2005 - 04:34:55 CST
On Wed, 12 Jan 2005 Valdis.Kletnieksvt.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).
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.