From 990fa101b6a2ce09e813a8d58f0f43178e54fc45 Mon Sep 17 00:00:00 2001 From: jim-p Date: Sat, 2 Feb 2013 21:36:39 -0500 Subject: Add a means to force a fsck (on rare occasions the fs is not marked dirty, but still needs fsck run to fix errors) --- etc/rc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'etc/rc') diff --git a/etc/rc b/etc/rc index 07ab210..73674ea 100755 --- a/etc/rc +++ b/etc/rc @@ -31,6 +31,14 @@ if [ "$PLATFORM" = "pfSense" ]; then /etc/rc.dumpon fi +if [ -e /root/force_fsck ]; then + echo "Forcing filesystem check..." + /sbin/fsck -fy -t ufs / + if [ "$PLATFORM" = "nanobsd" ]; then + /sbin/fsck -fy -t ufs /cf + fi +fi + TUNEFS_STATUS=`/sbin/tunefs -p / 2>&1 | /usr/bin/grep trim: | /usr/bin/awk '{print $4;}'` if [ -e /root/TRIM_set ] && [ "${TUNEFS_STATUS}" = "disabled" ]; then echo "Enabling TRIM support" @@ -97,6 +105,7 @@ if [ ! "$PLATFORM" = "cdrom" ] ; then fi fi +/bin/rm -f /root/force_fsck /bin/rm -f /root/TRIM_set /bin/rm -f /root/TRIM_unset -- cgit v1.1