How to sync a file on FreeBSD? [SOLVED]

Michael Sierchio kudzu at
Fri Jul 22 14:50:52 UTC 2011

On Fri, Jul 22, 2011 at 7:42 AM, Polytropon <freebsd at> wrote:

> But wouldn't sync() (see "man 2 sync") make sure that
> all buffers, even in regards to soft updates, get
> immediately flushed / written?

Apparently not. I think most of Matt Dillon's notes are still relevant.

>> In order to
>> implement a stable queue, it would be best to use a different
>> filesystem.
> What type of filesystem would match those requirements?

I would make a UFS filesystem without Softupdates enabled,  use
fflush() and wait for a proper ack before promising to the caller that
the bits will survive something like pulling the plug.  Softupdates
guarantees metadata consistency. I would probably make decisions about
block and fragment sizes based on knowledge of the physical device's
buffer mechanism, sector sizes, etc.

More information about the freebsd-questions mailing list