Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Oct 2001 19:57:17 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Carl Schmidt <carl@slackerbsd.org>
Cc:        questions@freebsd.org
Subject:   Re: accidently pulled the plug...
Message-ID:  <15289.4333.907347.872523@guru.mired.org>
In-Reply-To: <93236649@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Carl Schmidt <carl@slackerbsd.org> types:
> On Mon, Oct 01, 2001 at 09:26:29PM +1000, Edwin Groothuis wrote:
> > If you have softupdates enabled on your filesystems, then you will probab=
> ly
> > have the least problems.
> Just a quick point regarding softupdates...softupdates is not the cure for
> cancer many people like to make it out to be. It protects metadata and that=
>  is
> all it protects. You are much more likely to lose data (NOTE: not metadata -
> data) using softupdates if you are doing something disk intensive at the ti=
> me
> of the plug pulling or whatever other event causes a not-normal shutdown.

Right. I was going to say something about that myself. There are
actually *four* modes that you can mount file systems in. softupdates
is the third safest. Safest first, it's:

1) sync. All data is written to disk synchronously.

2a) softupdates: Metadata is written synchronously, but ordered to
   increase performance and insure the integrity of the metadata. Data
   is still written asynchronously.

2b) noasync. Metadata is written synchronously, data
   asynchronously. This is the default mode.

3) async. Data and metadata are both written asynchronously. This is
   the default (and maybe only mode) for Linux.

sync, noasync and async are flags at mount time. softupdates is a
property of the file system. If softupdates is enabled, those flags
are ignored.

softupdates and noasync are both 2 because ordering the metadata
writes takes a bit of time, increasing the danger of losing
metadata. In doing so it makes sure the metadata on disk is in a
consistent state, which means your disk is actually less likely to be
damaged. Given those tradeoffs, some people consider softupdates more
dangerous than noasync. I put it at 2a because it's nearly as fast as
async.

As a final note, if you are running a disk with write caching but not
tagged queuing, the *drive* is running in async mode. It may be less
safe, because Unix uses an algorithm that prevents a buffer kept
indefinitely, but some drives don't. On the other hand, some drives
make sure they have enough spare power around to guarantee the cache
will be flushed if they lose power, so it's no problem. I have no idea
how to tell which is which.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Q: How do you make the gods laugh?		A: Tell them your plans.

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




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