diff options
author | Renato Botelho <renato@netgate.com> | 2017-01-12 11:43:54 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-12 11:43:54 -0200 |
commit | cbafa84f5cf4d8972ca67b207f8bfbb98af90f03 (patch) | |
tree | c5a01a4efac5feff81ef9c05943d77a883770eea /src/etc | |
parent | 8c305c801373e0133fa847eb2ab89744b3028882 (diff) | |
download | pfsense-cbafa84f5cf4d8972ca67b207f8bfbb98af90f03.zip pfsense-cbafa84f5cf4d8972ca67b207f8bfbb98af90f03.tar.gz |
Ticket #6340:
- Stop misusing fsck -F parameter, it's supposed to be used when you
plan to run background fsck after filesystems are mounted, what is
not the case on pfSense
- Increase attempts to mount all filesystems as read-write to 10
- If we cannot mount filesystems as read-write, start a recovery shell
and after it finishes, reboot system
Diffstat (limited to 'src/etc')
-rwxr-xr-x | src/etc/rc | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -99,12 +99,12 @@ fi if [ -e /root/force_fsck ]; then echo "Forcing filesystem(s) check..." - /sbin/fsck -y -F -t ufs + /sbin/fsck -y -t ufs fi if [ "${PLATFORM}" != "cdrom" ]; then FSCK_ACTION_NEEDED=0 - /sbin/fsck -p -F + /sbin/fsck -p case $? in 0) echo "Filesystems are clean, continuing..." @@ -122,19 +122,25 @@ if [ "${PLATFORM}" != "cdrom" ]; then if [ ${FSCK_ACTION_NEEDED} = 1 ]; then echo "WARNING: Trying to recover filesystem from inconsistency..." - /sbin/fsck -yF + /sbin/fsck -y -t ufs fi /sbin/mount -a 2>/dev/null mount_rc=$? attempts=0 - while [ ${mount_rc} -ne 0 -a ${attempts} -lt 3 ]; do - /sbin/fsck -yF + while [ ${mount_rc} -ne 0 -a ${attempts} -lt 10 ]; do + /sbin/fsck -y -t ufs /sbin/mount -a 2>/dev/null mount_rc=$? attempts=$((attempts+1)) done + if [ ${mount_rc} -ne 0 ]; then + echo "ERROR: Impossible to mount filesystem, use interactive shell to attempt to recover it" + /bin/sh + /sbin/reboot + fi + if [ "${PLATFORM}" = "nanobsd" ]; then # XXX This script does need all filesystems rw!!!! # Put this workaround for now until better ways are found. |