Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Mar 2001 21:22:10 -0800
From:      Kirk McKusick <mckusick@mckusick.com>
To:        arch@freebsd.org
Subject:   Background Fsck
Message-ID:  <200103290522.VAA06966@beastie.mckusick.com>

next in thread | raw e-mail | index | archive | help
I now have the capability in fsck_ffs to run a background fsck on an
active filesystem. The question is how to deploy this capability in
the system. I have discussed how best to deploy it with several folks
and have put together the following proposal. I am now soliciting
input from the larger `arch' audience.

The default will be automatic background fsck of filesystems
running with soft updates. It will be possible to override this
default by adding the letter `F' to the passno in /etc/fstab
(e.g., saying `2F' means do it in the second pass before going
multiuser).

The implementation will be to add a new option, -B, to the
front end, fsck. The startup scripts will invoke fsck twice, once
at the current location without -B to do all the foreground checks,
and once towards the end of the startup script with -B to start
the background checks.

When called the first time without -B to do the foreground checks,
the front end will call each back end (e.g., fsck_ffs, fsck_ifs,
etc) without -B. Filesystems that are able and prefer to do background
checks will just print out a current summary and note that the
check is being deferred (the output will look much like the output
from a clean filesystem today). The fsck front end will understand the
new `2F' style passno and invoke the back end with -f to force a
foreground check. Also, anything listed as passno 1 will always be
done in foreground (which principally means that the root will
always be done in foreground). It will still be necessary to have
the `2F' designation rather than just using a passno of 1 to indicate
foreground checking because everything marked pass 1 is done
serially. The front end running in foreground will start up as many
passno 2's in parallel as it can (using its current algorithm).

The second invocation of fsck with -B will go through all the
filesystems marked with passno 2 (but not the 2F's) invoking their
backend with the -B option. Those that are already clean or do not
do background checks will simply return having done nothing. Unlike
the foreground varient the filesystems will be done one at a time.
It would also be possible to have the children nice'd down to a
low priority to reduce their CPU demands (though note that it would
not affect their I/O demands). The output would be piped to the
logger program rather than being dribbled out on the console.

Comments please.

	Kirk McKusick

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




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