On Wed, 14 Nov 2012 19:32:46 -0700, Gary Aitken wrote: > It's my understanding that the sequence of numbers one sees output when > shutdown is issued reflect writes of cached items. > Is that correct? > > If so, why does: > sync > shutdown -r now > still show cached items being written?
Issuing the "sync" command simply tells the OS to sync any modified file I/O buffers (cache) that aren't written yet. It does not imply that the OS will do it _exactly now_, and even more, that it will _have done_ it when the command returns. So if you call sync(), the kernel will be instructed to perform the syncing operation. But keep in mind that the actual device drivers (e. g. for the hard disk in question) may delay the transfer to the disk, but tell the kernel that the operation has been completed. This minimal time window can probably be ignored, but from my understanding, syncing is a "multi-staged process". The "shutdown sync" seems to have a specific timeout that makes sure things get written definitely. That's why even the famous # sync ; sync ; sync ; reboot sequence would have the same effect. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"