From owner-svn-src-head@freebsd.org Wed Mar 18 13:09:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D123C25F974; Wed, 18 Mar 2020 13:09:48 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48j9P848Lpz4HHr; Wed, 18 Mar 2020 13:09:48 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6226D225B9; Wed, 18 Mar 2020 13:09:48 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 02ID9m1e023124; Wed, 18 Mar 2020 13:09:48 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 02ID9me8023122; Wed, 18 Mar 2020 13:09:48 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <202003181309.02ID9me8023122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Wed, 18 Mar 2020 13:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359069 - in head/libexec/rc: . rc.d X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/libexec/rc: . rc.d X-SVN-Commit-Revision: 359069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2020 13:09:48 -0000 Author: luporl Date: Wed Mar 18 13:09:47 2020 New Revision: 359069 URL: https://svnweb.freebsd.org/changeset/base/359069 Log: Add fsck_flags config option 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 adds 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. Submitted by: jhibbits@ (original version) Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D24087 Modified: head/libexec/rc/rc.conf head/libexec/rc/rc.d/fsck Modified: head/libexec/rc/rc.conf ============================================================================== --- head/libexec/rc/rc.conf Wed Mar 18 08:17:24 2020 (r359068) +++ head/libexec/rc/rc.conf Wed Mar 18 13:09:47 2020 (r359069) @@ -101,6 +101,7 @@ geli_autodetach="YES" # Automatically detach on last c root_rw_mount="YES" # Set to NO to inhibit remounting root read-write. root_hold_delay="30" # Time to wait for root mount hold release. +fsck_flags="-p" # May be changed to -f (or -f -y) to force a full fsck fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails. fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y background_fsck="YES" # Attempt to run fsck in the background where possible. Modified: head/libexec/rc/rc.d/fsck ============================================================================== --- head/libexec/rc/rc.d/fsck Wed Mar 18 08:17:24 2020 (r359068) +++ head/libexec/rc/rc.d/fsck Wed Mar 18 13:09:47 2020 (r359069) @@ -25,10 +25,11 @@ fsck_start() trap : 3 check_startmsgs && echo "Starting file system checks:" + # Background fsck can only be run with -p if checkyesno background_fsck; then fsck -F -p else - fsck -p + fsck ${fsck_flags} fi err=$? @@ -37,10 +38,11 @@ fsck_start() "available; retrying" root_hold_wait check_startmsgs && echo "Restarting file system checks:" + # Background fsck can only be run with -p if checkyesno background_fsck; then fsck -F -p else - fsck -p + fsck ${fsck_flags} fi err=$? fi