Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Aug 1999 14:15:15 +0900
From:      "Daniel C. Sobral" <dcs@newsguy.com>
To:        Larry Lile <lile@stdio.com>
Cc:        hackers@FreeBSD.ORG, dlane@yahoo.com
Subject:   Re: async v. sync v. default mode on ufs
Message-ID:  <37BB92E3.3CE11E86@newsguy.com>
References:  <Pine.BSF.4.05.9908181057480.8913-100000@heathers.stdio.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Larry Lile wrote:
> 
> It was pointed out to me by a co-worker that FreeBSD has actually
> three modes of operation for mounting ufs filesystems.  Could someone
> please explain to me, and him, the differences between the three.

There are two kinds of stuff written to the fs: data and metadata.
Data is what goes inside files, metadata are things like filenames
and sizes (gross simplification, emphasis on gross).

Default for FreeBSD is async data and sync data. Sync and Async
modes go full sync/async for both metadata and data (in theory,
anyway :).

The advantage with sync metadata is that the fs never gets "too"
damaged. With async metadata writes, the fs can get in a state that
fsck won't be able to get back to life. Sync metadata writes will be
restricted to recoverable inconsistencies (ie, you may lose files
and directories, but not the filesystem).

> Also does anyone knows how these compare to sync and async on Linux?

Sync and async modes on Linux, last I checked, are like full sync
and full async modes on FreeBSD.

Then, there is softupdates, which is a whole new ball game.
Softupdates is async, but it will order, delete, collapse and expand
metadata writes so the file system will never get in an inconsistent
state. 

> 
> Just a btw, you seem to be able to set sync and async on a filesystem
> at the same time.  What gives?

Beats me.

> dlane# mount -u -o sync,async,noatime /var dlane-printer# mount
> /dev/wd0s1a on / (local, noatime, synchronous, writes: sync 405 async 23)
> /dev/wd0s1e on /usr (local, noatime, synchronous, writes: sync 118365
> async 83882)
> /dev/wd0s1f on /var (asynchronous, local, noatime, synchronous, writes:
> sync 93 async 216) procfs on /proc (local)
> dlane#
> 
> /var looks questionable...

Indeed. :-)

> I would never try that on purpose, but it just kinda happened, and when I
> looked at it I though "wow that's broken"!

Looks that way. Try opening a PR. :-)

--
Daniel C. Sobral			(8-DCS)
dcs@newsguy.com
dcs@freebsd.org

	- Can I speak to your superior?
	- There's some religious debate on that question.




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37BB92E3.3CE11E86>