On Sat, 2005-10-22 at 08:31 -0400, Greg Freemyer wrote:
On 10/22/05, Randall R Schulz
wrote: Greg,
On Friday 21 October 2005 13:21, Greg Freemyer wrote:
On 10/20/05, Randall R Schulz
wrote: ...
For those of us that work in UNIX environments in addition to Linux it is safest to do the double sync. i.e In general it takes 2 syncs to ensure data is flushed, but with Linux it is safe to do only one.
Now, what's that expression??
Oh, yeah, that's it: BS!
I'm sorry, but nonsense is nonsense.
At least do a "man 2 sync" and read it before you claim to understand it.
You will see that the UNIX standard calls for a double sync. It is a Linux _choice_ to implement it as a single sync.
You're confusing me as well now! Looking at that page on suse 9.3, I don't see anything about a double sync: man 2 sync "According to the standard specification (e.g., SVID), sync() schedules the writes, but may return before the actual writing is done. However, since version 1.3.20 Linux does actually wait. (This still does not guarantee data integrity: modern disks have large caches.)" But in any case, that man page describes the system call while the thread is discussing the shell command. Its man page says: man 8 sync "The sync program does nothing but exercise the sync(2) system call. ... On Linux, sync is only guaranteed to schedule the dirty blocks for writing; it can actually take a short time before all the blocks are finally written. The reboot(8) and halt(8) commands take this into account by sleeping for a few seconds after calling sync(2). This page describes sync as found in the fileutils-4.0 package; other versions may differ slightly." Which is interesting because it seems to make a weaker guarantee than the underlying system call. So perhaps one source of all our confusion is inconsistent documentation. Seems to me that what they both say in effect is to do a single sync and then *wait for the operations to occur*. I guess typing sync again is as good a way as any other to pass some time. Cheers, Dave