Page MenuHomeFreeBSD

Add fsck_flags config option
ClosedPublic

Authored by luporl on Mar 16 2020, 4:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 23 2024, 3:28 PM
Unknown Object (File)
Feb 23 2024, 3:27 PM
Unknown Object (File)
Feb 23 2024, 3:27 PM
Unknown Object (File)
Feb 23 2024, 3:27 PM
Unknown Object (File)
Feb 23 2024, 3:11 PM
Unknown Object (File)
Aug 6 2023, 10:00 AM
Unknown Object (File)
Jul 5 2023, 2:28 PM
Unknown Object (File)
Jul 5 2023, 2:27 PM

Details

Summary

On UFS with SU+J, sometimes fsck's default recovery from journal marks the filesystem as clean but some errors remain.

With SU only, default fsck in preen mode sometimes thinks all errors have been fixed but some still remain.

To address the issues above, this change proposes a new config option: fsck_flags.
By default it's set to -p, but the user may change it to -y or -f -y, for instance, to force a full fsck after a system crash.

Test Plan

On a system where the root filesystem is UFS with SU, add fsck_flags="-y" to rc.conf.
Force a panic with:
sysctl debug.kdb.panic=1
Reboot and check that a full fsck is performed.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

With the above suggested changes, I agree with this proposal.

libexec/rc/rc.conf
104 ↗(On Diff #69570)

I suggest adding a comment such as

fsck_flags="-p" # may be changed to -f (or -f -y) to force a full fsck

libexec/rc/rc.d/fsck
28 ↗(On Diff #69570)

Delete (safely?). Background fsck can only be run with -p

41 ↗(On Diff #69570)

Delete (safely?). Background fsck can only be run with -p

This revision now requires changes to proceed.Mar 17 2020, 4:45 AM
This revision is now accepted and ready to land.Mar 17 2020, 11:33 PM
This revision was automatically updated to reflect the committed changes.