summaryrefslogtreecommitdiffstats
path: root/src/etc/pfSense-rc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-01-03 12:27:52 -0200
committerRenato Botelho <renato@netgate.com>2017-01-03 12:27:52 -0200
commitb712dd529e2445fc20e983815a80a4e8ea109760 (patch)
treeb2e2708f68ab0b245a64e1ddf1de556eee63f474 /src/etc/pfSense-rc
parent23adb26ddf2ddc7261254807557411c11743f13d (diff)
downloadpfsense-b712dd529e2445fc20e983815a80a4e8ea109760.zip
pfsense-b712dd529e2445fc20e983815a80a4e8ea109760.tar.gz
Make sure ZFS partiion is mounted read-write before try to change items in filesystem
Diffstat (limited to 'src/etc/pfSense-rc')
-rwxr-xr-xsrc/etc/pfSense-rc28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/etc/pfSense-rc b/src/etc/pfSense-rc
index 4d2c3fb..7658bf8 100755
--- a/src/etc/pfSense-rc
+++ b/src/etc/pfSense-rc
@@ -105,6 +105,20 @@ while [ ${mount_rc} -ne 0 -a ${attempts} -lt 3 ]; do
attempts=$((attempts+1))
done
+# Handle ZFS read-only case
+/sbin/kldstat -qm zfs
+if [ $? -eq 0 ]; then
+ ZFSFSAVAILABLE=$(/sbin/zfs mount 2>/dev/null | wc -l)
+ if [ $ZFSFSAVAILABLE -eq 0 ]; then
+ /sbin/kldunload zfs
+ elif [ -f /usr/bin/grep ]; then
+ ZFSROOT=`/sbin/zfs mount | /usr/bin/grep ' /$' | /usr/bin/cut -d ' ' -f 1`
+ if [ "$ZFSROOT" != "" ]; then
+ /sbin/zfs set readonly=off $ZFSROOT
+ fi
+ fi
+fi
+
# If /conf is a directory, convert it to a symlink to /cf/conf
if [ -d "/conf" ]; then
# If item is not a symlink then rm and recreate
@@ -152,20 +166,6 @@ fi
/bin/rm -f /root/TRIM_set
/bin/rm -f /root/TRIM_unset
-# Handle ZFS read-only case
-/sbin/kldstat -qm zfs
-if [ $? -eq 0 ]; then
- ZFSFSAVAILABLE=$(/sbin/zfs mount 2>/dev/null | wc -l)
- if [ $ZFSFSAVAILABLE -eq 0 ]; then
- /sbin/kldunload zfs
- elif [ -f /usr/bin/grep ]; then
- ZFSROOT=`/sbin/zfs mount | /usr/bin/grep ' /$' | /usr/bin/cut -d ' ' -f 1`
- if [ "$ZFSROOT" != "" ]; then
- /sbin/zfs set readonly=off $ZFSROOT
- fi
- fi
-fi
-
# Disable APM on ATA drives. Leaving this on will kill drives long-term, especially laptop drives, by generating excessive Load Cycles.
if [ -f /etc/rc.disable_hdd_apm ]; then
/etc/rc.disable_hdd_apm
OpenPOWER on IntegriCloud