On Tue, 14 Jun 2005 17:58:36 +0200, Jesper Juhl said: > actually written. Thus it was common in ages past to run sync ; sync > ; halt when shutting down a system since even though the first sync > might return before writing was done Actually, it was: # sync # sync # sync # halt If you enter 'sync;sync;sync' all 3 will get scheduled almost on top of each other when you hit return. If you hit return on each one, the first one starts running when you hit return, and hopefully completes while you're typing the second and third ones..... 'sync' on recent Linux kernels appears to be synchronous and not return until the data is out the door. If you're seeing 'sync; unmount; sync' being needed, the most likely cause is that the *first* sync is bogus (as unmount will flush the buffers too) - and the *second* sync is flushing out blocks from some file that was opened in the directory *before you did the mount*: # cd /usr/local (with nothing mounted on it, so it's an empty dir in /usr) # touch foo # tail -f foo & # mount /usr/local Now that 'foo' is an open but unreachable file on the /usr filesystem, and will likely cause the need for a sync *for /usr* after unmounting /usr/local at system shutdown.
Attachment:
pgpEaKah2snN5.pgp
Description: PGP signature
- References:
- Why is one sync() not enough?
- From: Nico Schottelius <[email protected]>
- Re: Why is one sync() not enough?
- From: Martin Waitz <[email protected]>
- Re: Why is one sync() not enough?
- From: Jesper Juhl <[email protected]>
- Why is one sync() not enough?
- Prev by Date: Re: [patch] Real-Time Preemption, -RT-2.6.12-rc6-V0.7.48-00
- Next by Date: 2.6.12-rc6-mm1: kernel BUG at fs/inode.c:1106
- Previous by thread: Re: Why is one sync() not enough?
- Next by thread: Re: Why is one sync() not enough?
- Index(es):