Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jan 2002 17:45:47 -0600
From:      "Mike Meyer" <mwm-dated-1012866347.c6a6f0@mired.org>
To:        tim.borgeaud@genie.co.uk
Cc:        questions@freebsd.org
Subject:   Re: Softupdates ( why not to use on / fs )
Message-ID:  <15448.34219.325331.975819@guru.mired.org>
In-Reply-To: <71134799@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
tim.borgeaud@genie.co.uk types:
> I have little knowledge of filesystems but as I understand it, 
> although softupdates is not synchronous, it tries to make sure that
> you have a valid filesystem on disk at any point. 

Correct.

> An asynchronous system is at greater risk of corruption when there are 
> crashes etc, because the file system on disk alone is often not valid, 
> much of the changes still being cached in memory.

Correct.

> Softupdates should be nearly as safe as a plain synchronous system.
> Someone with a better understanding should clarify this. 

Without softupdates, writes to disk happen in an order that's
optimized by location on the disk. This means you can wind up with
things like a file being written to the disk and the data is there,
but the directory that holds the only link hasn't been updated yet, or
having an inode updated to indicate that a file is in place, but the
file isn't on the disk yet, meaning you have pointers to garbage
blocks, some of which may be blocks of pointers. This is all very bad,
and hoses your file system in incredible ways. Note that this applied
whether the file system is mounted sync or async, although the dangers
are different and not as severe with sync.

Softupdates orders the writes so that the filesystem on disk is
valid. This avoids all those problems, and the only thing you'll find
are disks blocks that have been allocated for a write, but aren't yet
part of the file system. This means that you are at greater risk of
losing data than with a synchronious mount, but not as great as with
an asynchronious mount. On the other hand, the possibility of having a
fried file system is less with softupdates than with either sync or
async.

I think the real reason that softupdates is disabled on root is that
there has been a history of kernel installs failing in that
configuration. Softupdates can cause the space occupied by a deleted
file to not become available for as much as 30 seconds after the
delete happens. If you are tight on space on root, this can make
removing the kernel and a bunch of kld's and then copying new ones
into place fail.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

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?15448.34219.325331.975819>