summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-02-02 21:36:39 -0500
committerjim-p <jimp@pfsense.org>2013-02-02 21:36:39 -0500
commit990fa101b6a2ce09e813a8d58f0f43178e54fc45 (patch)
tree2dafe2bc621a896fc8bc3a2e9bfda1e981e92b84
parent2085c6de5de1d9cd8864f85628f775bce5853012 (diff)
downloadpfsense-990fa101b6a2ce09e813a8d58f0f43178e54fc45.zip
pfsense-990fa101b6a2ce09e813a8d58f0f43178e54fc45.tar.gz
Add a means to force a fsck (on rare occasions the fs is not marked dirty, but still needs fsck run to fix errors)
-rwxr-xr-xetc/rc9
1 files changed, 9 insertions, 0 deletions
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
OpenPOWER on IntegriCloud