Re: safe file systems

Matt Brown (matt@dominion.eigen.co.uk)
02 Oct 1997 14:55:28 +0100


shirsch@ibm.net ("Steven N. Hirsch") writes:

> On Fri, 26 Sep 1997, Harald Milz wrote:
>
> > Steven N. Hirsch (shirsch@ibm.net) wrote:
> > >
> > > At work we use JFS on IBM RS/6k boxes and Advfs on Digital Unix. AFAIK,
> > > they are highly tolerant of the abuse you describe.
> >
> > Not necessarily. Open files are truncated to zero length on power loss or
> > RESET. Only the meta data is handled in a transaction oriented manner to
> > make sure the filesystem is consistent.
>
> Ugh. I never thought that through completely. Only meta data is
> guaranteed?

The problem is that those filesystems mentioned, e.g. JFS, aren't
actually log-structured file systems. What they are, are standard
filesystems with the addition of a transaction log for metadata
updates *only*. This means that it's hard to lose filesystem
integrity, but still just as easy to lose data.

As well as making it less likely that a power failure, hang or
sync-less halt will break your filesystem structure, this also
massively speeds up fsck'ing (since the state of the filesystem just
has to be made to agree with the log; no need to go through the entire
thing checking, just rollback or redo transactions in the log on the
filesystem proper).

Another benefit is that it's no longer necessary to do synchronous
updates to filesystem metadata; all that's required is to append them
to the log and then perform them on the filesystem at a later time,
which is a bit faster.

This is still not a log-structured filesystem like the experimental
one in BSD 4.4. In these, *everything* is treated in this matter. If
you want to know about such things, a good place to start is 'The
Design and Implementation of the 4.4BSD Operating System' which has a
chapter on the 4.4BSD LFS plus references.

-Matt