Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Oct 2006 09:47:28 +0200
From:      Pav Lucistnik <pav@FreeBSD.org>
To:        LI Xin <delphij@delphij.net>
Cc:        freebsd-rc@FreeBSD.org
Subject:   Re: fsck talk
Message-ID:  <1161762448.81527.2.camel@pav.hide.vol.cz>
In-Reply-To: <453EE2F8.7030702@delphij.net>
References:  <1161281431.56486.13.camel@ikaros.oook.cz> <453EE2F8.7030702@delphij.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-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 <pav@oook.cz>
              <pav@FreeBSD.org>

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



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