fsck talk
LI Xin
delphij at delphij.net
Wed Oct 25 04:08:08 UTC 2006
Pav Lucistnik wrote:
> I was poking around /etc/rc.d/fsck today, and I figured out a few
> interesting things.
>
> Think three large partitions, for example:
> /dev/aacd0s1e /a
> /dev/aacd1s1e /b
> /dev/aacd2s1e /c
>
> Now, disable background fsck and enable -y flag in rc.conf:
> background_fsck="NO"
> fsck_y_enable="YES"
>
> Now imagine a power failure. On reboot, fsck -p manages to mark /a
> and /b clean, but fails on /c.
>
> Next, fsck -y is executed, which goes over /a again, then over /b and
> then finally over /c.
>
> Two problems here:
>
> 1) fsck -y does not skip filesystems already cleaned in preen run,
> because fsck_ffs only skips clean filesystems in preen mode.
>
> 2) fsck -y runs forever, because fsck does execute the jobs in parallel
> only in preen mode.
>
> Proposed solutions to problem 1:
>
> - change the behaviour of fsck_ffs when executed on clean filesystem,
> like this:
>
> fsck -y /a
>
> 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
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.
> Plus
>
> - 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.
>
> Proposed solutions to problem 2:
>
> - change fsck to parallelize jobs in non-preen mode by default
> - add a flag to fsck to parallelize jobs in non-preen mode
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 knob.
Cheers,
--
Xin LI <delphij at delphij.net> http://www.delphij.net/
FreeBSD - The Power to Serve!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20061025/7d4b7823/signature.pgp
More information about the freebsd-rc
mailing list