From owner-freebsd-rc@FreeBSD.ORG Wed Oct 25 07:47:51 2006 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3351B16A407 for ; Wed, 25 Oct 2006 07:47:51 +0000 (UTC) (envelope-from pav@FreeBSD.org) Received: from nat-application.b1.lan.prg.vol.cz (nat-application.b1.lan.prg.vol.cz [195.122.204.152]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6063043D68 for ; Wed, 25 Oct 2006 07:47:48 +0000 (GMT) (envelope-from pav@FreeBSD.org) Received: from pav.hide.vol.cz (localhost [127.0.0.1]) by nat-application.b1.lan.prg.vol.cz (8.13.6/8.13.6) with ESMTP id k9P7lUpR081604; Wed, 25 Oct 2006 09:47:31 +0200 (CEST) (envelope-from pav@FreeBSD.org) Received: (from pav@localhost) by pav.hide.vol.cz (8.13.6/8.13.6/Submit) id k9P7lTtf081603; Wed, 25 Oct 2006 09:47:29 +0200 (CEST) (envelope-from pav@FreeBSD.org) X-Authentication-Warning: pav.hide.vol.cz: pav set sender to pav@FreeBSD.org using -f From: Pav Lucistnik To: LI Xin In-Reply-To: <453EE2F8.7030702@delphij.net> References: <1161281431.56486.13.camel@ikaros.oook.cz> <453EE2F8.7030702@delphij.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-qdMHk7CUjhe7ZC1e7Uwh" Date: Wed, 25 Oct 2006 09:47:28 +0200 Message-Id: <1161762448.81527.2.camel@pav.hide.vol.cz> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 FreeBSD GNOME Team Port Cc: freebsd-rc@FreeBSD.org Subject: Re: fsck talk X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pav@FreeBSD.org List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Oct 2006 07:47:51 -0000 --=-qdMHk7CUjhe7ZC1e7Uwh Content-Type: text/plain; charset=ISO8859-2 Content-Transfer-Encoding: quoted-printable LI Xin p=ED=B9e v st 25. 10. 2006 v 12:07 +0800: > Pav Lucistnik wrote: > > I was poking around /etc/rc.d/fsck today, and I figured out a few > > interesting things. > >=20 > > Think three large partitions, for example: > > /dev/aacd0s1e /a > > /dev/aacd1s1e /b > > /dev/aacd2s1e /c > >=20 > > Now, disable background fsck and enable -y flag in rc.conf: > > background_fsck=3D"NO" > > fsck_y_enable=3D"YES" > >=20 > > Now imagine a power failure. On reboot, fsck -p manages to mark /a > > and /b clean, but fails on /c. > >=20 > > Next, fsck -y is executed, which goes over /a again, then over /b and > > then finally over /c. > >=20 > > Two problems here: > >=20 > > 1) fsck -y does not skip filesystems already cleaned in preen run, > > because fsck_ffs only skips clean filesystems in preen mode. > >=20 > > 2) fsck -y runs forever, because fsck does execute the jobs in parallel > > only in preen mode. > >=20 > > Proposed solutions to problem 1: > >=20 > > - change the behaviour of fsck_ffs when executed on clean filesystem, > > like this: > >=20 > > fsck -y /a > >=20 > > to skip it with message 'already clean'. There is a -f flag for > > people who really want to do a fsck. > > - add a new flag to fsck_ffs that will skip clean filesystems in > > non-preen mode >=20 > I think it is reasonable not to check clean file system, since -f means > "force", by not specifying the option, it's supposed that clean file > systems are not being checked, so I vote for the first proposed solution. >=20 > > Plus > >=20 > > - when user sets fsck_y_enable, we can just skip the preen run entirely= , > > under the condition that one of the above was implemented. That's > > another speedup. > >=20 > > Proposed solutions to problem 2: > >=20 > > - change fsck to parallelize jobs in non-preen mode by default > > - add a flag to fsck to parallelize jobs in non-preen mode >=20 > For very large volumes it can be very nasty to do parallelized check, > because one volume can cost a lot of memory, which can in turn cause > fsck to fail. Of course, I think a flag to parallelize the check would > be a nice feature and users can optionally enable it through a rc.conf kn= ob. Thank you for your feedback. I already have patches to implement majority of this at http://people.freebsd.org/~pav/fsck/ Feel free to look at them. --=20 Pav Lucistnik Pilot to Co-Pilot: Boo. --=-qdMHk7CUjhe7ZC1e7Uwh Content-Type: application/pgp-signature; name=signature.asc Content-Description: Toto je =?UTF-8?Q?digit=C3=A1ln=C4=9B?= =?ISO-8859-1?Q?_podepsan=E1?= =?UTF-8?Q?_=C4=8D=C3=A1st?= =?ISO-8859-1?Q?_zpr=E1vy?= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQBFPxaQntdYP8FOsoIRAirsAKCU3z0IXDDfBoSlhkCgAkQcGRhWTwCgrRPv NOyZEuPEvpq31xNSZDJtyz0= =Eof+ -----END PGP SIGNATURE----- --=-qdMHk7CUjhe7ZC1e7Uwh--