6762213 We should not snapshot swap or dump devices by default

This commit is contained in:
Tim Foster
2008-10-22 00:23:37 +01:00
parent ceca9c4764
commit dfe567b41f

View File

@@ -882,12 +882,39 @@ function auto_include {
*false | false*) *false | false*)
;; ;;
*) *)
$PFZFS set com.sun:auto-snapshot=true $pool FIRSTRUN_POOLS="$pool $FIRSTRUN_POOLS"
;; ;;
esac esac
fi fi
done done
fi fi
for pool in ${FIRSTRUN_POOLS} ; do
# This is the first time the service has run on this pool,
# set appropriate zfs user properties on it
$PFZFS set com.sun:auto-snapshot=true $pool
# check for swap and dump devices and disable snapshots there
SWAP=$(swap -l | grep "/dev/zvol/dsk/$pool/" | awk '{print $1}')
for swap in $SWAP ; do
vol=$(echo $swap | sed -e 's#/dev/zvol/dsk/##')
echo "Disabling snapshots for swap device $vol"
$PFZFS set com.sun:auto-snapshot=false $vol
done
# can't run dumpadm as a non-root user, so check for dumpadm.conf
if [ -r /etc/dumpadm.conf ] ; then
DUMP=$(grep "^DUMPADM_DEVICE=" /etc/dumpadm.conf |\
grep "/dev/zvol/dsk/$pool/" |\
awk -F= '{print $2}')
if [ -n "$DUMP" ] ; then
vol=$(echo $DUMP | sed -e 's#/dev/zvol/dsk/##')
echo "Disabling snapshots for dump device $vol"
$PFZFS set com.sun:auto-snapshot=false $vol
fi
fi
done
} }