Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion why three syncs?

Path: gmdzi!unido!mcsun!hp4nl!nikhefk!tom
From: t...@nikhefk.UUCP (Tom Ploegmakers)
Newsgroups: alt.folklore.computers,comp.sys.dec
Subject: Re: why three syncs?
Keywords: bellman sync three
Message-ID: <1738@nikhefk.UUCP>
Date: 5 Sep 91 08:01:53 GMT
References: <1991Sep04.194822.22074@uvmark.uucp>
Sender: Tom Ploegmakers <t...@nikhefk.nikhef.nl>
Reply-To: t...@nikhefk.UUCP (Tom Ploegmakers)
Organization: Nikhef-K, Amsterdam (the Netherlands).
Lines: 28

In article <1991Sep04.194822.22...@uvmark.uucp> t...@uvmark.uucp (Tom Rauschenbach) writes:
>I've noticed that most Un*x folks type the sync command three times before
>shutting down a system.  Is there a folkloric reason for this ?  A technical
>one.  I have a guess, and I wonder if it can be confirmed or refuted.

The reason i know for doing more  than a single sync is that sync
is  performed  asynchonously  by  the kernel.  When  the  command
returns the  sync operation is not  yet finished. So If  you halt
immediatly after that you  would still have incorrect filesystems
on disk. When memories were small  the sync would be completed by
the time you had typed anything, so why not a second sync?

A second sync would not  make your filesystems any better because
there will not be found any  blocks in the buffer cache that need
syncing.

When  memories,  and  buffer  caches, grew  bigger  this  was  no
guarantee  anymore. I  heard about  a Convex  that spend  tens of
seconds syncing after doing lots of installaion work single user.
Modern unixes,  at least bsd's,  always sync when you  halt them,
even when they  panic. But i still have the  old sync, sync, jalt
on my fingertips.


tom ploegmakers		NIKHEF/K-CSG	(t...@nikhefk.nikhef.nl)	

			po.box 4395, 1009 AJ Amsterdam, the Netherlands.
			phone: -31 20 5922035