summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2015-05-27 10:49:01 +0200
committerErmal LUÇI <eri@pfsense.org>2015-05-27 10:51:38 +0200
commit427d36b4a8e32a1692ee59c0f7db3a660492f90f (patch)
tree05c0aaac4b8ba6d69b705b0e1127894ff3168a7f /etc/rc
parentfc123231da1bd74525beddf7948ee8037c47bfe6 (diff)
downloadpfsense-427d36b4a8e32a1692ee59c0f7db3a660492f90f.zip
pfsense-427d36b4a8e32a1692ee59c0f7db3a660492f90f.tar.gz
Ticket #4523 Major changes to how fsck is done.
Follow best practice of using fsck from FreeBSD rc.d/fsck script. This means run preen mode first and later on try forcefully to fix issues. Try to give as much information during boot on the status of the filesystem. Follow best practice of using fsck from FreeBSD rc.d/fsck script. This means run preen mode first and later on try forcefully to fix issues. Try to give as much information during boot on the status of the filesystem. Conflicts: etc/inc/services.inc
Diffstat (limited to 'etc/rc')
-rwxr-xr-xetc/rc26
1 files changed, 22 insertions, 4 deletions
diff --git a/etc/rc b/etc/rc
index 5340e23..e2b6222 100755
--- a/etc/rc
+++ b/etc/rc
@@ -42,15 +42,33 @@ if [ -e /root/force_fsck ]; then
fi
if [ ! "${PLATFORM}" = "cdrom" ]; then
- /sbin/fsck -y -C -F
- # Mount memory file system if it exists
- echo "Mounting filesystems..."
+ /sbin/fsck -p -F
+ FSCK_ACTION_NEEDED=0
+ case $? in
+ 0)
+ echo "Filesystems are clean, continuing..."
+ echo "Mounting filesystems..."
+ ;;
+ 8)
+ echo "Preen mode recommended running a check that will be performed now."
+ FSCK_ACTION_NEEDED=1
+ ;;
+ *)
+ echo "Stopping boot is recommended due to filesystem manual action needed, nevertheless it will be tried to repair the filesystem."
+ FSCK_ACTION_NEEDED=1
+ ;;
+ esac
+
+ if [ ${FSCK_ACTION_NEEDED} = 1 ]; then
+ echo "WARNING: Trying to recover filesystem from inconsistency..."
+ /sbin/fsck -yF
+ fi
/sbin/mount -a 2>/dev/null
mount_rc=$?
attempts=0
while [ ${mount_rc} -ne 0 -a ${attempts} -lt 3 ]; do
- /sbin/fsck -yF /
+ /sbin/fsck -yF
/sbin/mount -a 2>/dev/null
mount_rc=$?
attempts=$((attempts+1))
OpenPOWER on IntegriCloud