Kill the power faster than poweroff?

Jakob Oestergaard jakob at unthought.net
Thu Sep 11 16:03:45 EDT 2003


On Thu, Sep 11, 2003 at 03:27:11PM -0400, Donald Becker wrote:
> On Thu, 11 Sep 2003 alan at dasher.wustl.edu wrote:
> >     I've read in other places that you need to repeat the sync command a
> >     number of times (I seem to remember the article saying 3 times in
> >     particular, though I can't remember how they arrived at that number) in
> >     order to guarantee writing.  Even then it seems like there ought to be
> >     race-condition like issues.
> 
> I was told over two decades ago.  The principle was that the first sync
> queued the pages to write, and the second sync didn't start until the
> first write list had finished.  The third was just to make sure.  You
> know: if two is good, three must be better.

The story I heard was, that sync could complete before all data had
actually reached the platters (hardware write buffers or whatever...).

Therefore, you had to *type* sync three times.  No cheap scripting
tricks - the whole idea of the two last syncs is to get some delay
before you actually power off.

> 
> I don't believe that a second 'sync' will have any beneficial effect
> with Linux, or any modern Unix.

And there is no state. Thus, the second sync must do exactly the same as
the first sync. There is no way that it can have another effect.

If you type sync three times, whatever write buffers there may be which
the sync commands cannot sync, will have had time to flush.

You could also type
]$ sync
]$ my
]$ disks
]$ please

It just gives errors and makes you look stupid, if someone is watching
over your shoulder  ;)

-- 
................................................................
:   jakob at unthought.net   : And I see the elder races,         :
:.........................: putrid forms of man                :
:   Jakob Østergaard      : See him rise and claim the earth,  :
:        OZ9ABN           : his downfall is at hand.           :
:.........................:............{Konkhra}...............:
_______________________________________________
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf



More information about the Beowulf mailing list