From owner-freebsd-arch Thu Mar 29 0: 9:56 2001 Delivered-To: freebsd-arch@freebsd.org Received: from beastie.mckusick.com (beastie.mckusick.com [209.31.233.184]) by hub.freebsd.org (Postfix) with ESMTP id 0E1AD37B719 for ; Thu, 29 Mar 2001 00:09:53 -0800 (PST) (envelope-from mckusick@mckusick.com) Received: from beastie.mckusick.com (localhost [127.0.0.1]) by beastie.mckusick.com (8.9.3/8.9.3) with ESMTP id VAA06966 for ; Wed, 28 Mar 2001 21:22:10 -0800 (PST) (envelope-from mckusick@beastie.mckusick.com) Message-Id: <200103290522.VAA06966@beastie.mckusick.com> To: arch@freebsd.org Subject: Background Fsck Date: Wed, 28 Mar 2001 21:22:10 -0800 From: Kirk McKusick Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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