Problems unmounting/fssyncking extern UFS filesystem

Chuck Swiger cswiger at mac.com
Tue Nov 28 11:38:06 PST 2006


On Nov 27, 2006, at 8:41 AM, Kevin Oberman wrote:
>> As far as I know, that's not different from calling "sync"
>> just once.  It might make more sense to put a little sleep
>> between the sync calls, though.
>
> The traditional mantra was
> sync
> sync
> sync
> and not sync;sync;sync. The reason was timing. By entering the sync
> command three times as fast as anyone could type, the sync could
> reliably complete.

Agreed.  Although I've heard rumors that some systems treated 3 syncs  
as some sort of special case, but I've never seen anything in code to  
support the notion.

> That mantra is about 25 years old, so its validity on modern  
> hardware is
> questionable, but the need for a delay is very real. I would suggest
> something like: sync && sleep 5

The other choice would be to make sync [or the sync(2) system call,  
more precisely] blocking, so that it does not return until the buffer  
cache has been flushed and all dirty pages in VM have been written to  
disk.

-- 
-Chuck



More information about the freebsd-stable mailing list