mirror of
https://github.com/zfsonlinux/zfs-auto-snapshot.git
synced 2025-08-20 17:11:00 +02:00
4644 time-slider tags filesystems before enabling core service
This commit is contained in:
@@ -922,28 +922,29 @@ function auto_include {
|
|||||||
# This is the first time the service has run on this pool,
|
# This is the first time the service has run on this pool,
|
||||||
# set appropriate zfs user properties on it
|
# set appropriate zfs user properties on it
|
||||||
$PFZFS set com.sun:auto-snapshot=true $pool
|
$PFZFS set com.sun:auto-snapshot=true $pool
|
||||||
|
done
|
||||||
|
|
||||||
# check for swap and dump devices and disable snapshots there
|
# check for swap devices using zvols
|
||||||
SWAP=$(swap -l | grep "/dev/zvol/dsk/$pool/" | awk '{print $1}')
|
SWAP=$(swap -l | grep "/dev/zvol/dsk/" | awk '{print $1}')
|
||||||
|
SWAPVOLS=""
|
||||||
for swap in $SWAP ; do
|
for swap in $SWAP ; do
|
||||||
vol=$(echo $swap | sed -e 's#/dev/zvol/dsk/##')
|
SWAPVOLS="$SWAPVOLS $(echo $swap | sed -e 's#/dev/zvol/dsk/##')"
|
||||||
echo "Disabling snapshots for swap device $vol"
|
|
||||||
$PFZFS set com.sun:auto-snapshot=false $vol
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# can't run dumpadm as a non-root user, so check for dumpadm.conf
|
# can't run dumpadm as a non-root user, so check for dumpadm.conf
|
||||||
if [ -r /etc/dumpadm.conf ] ; then
|
if [ -r /etc/dumpadm.conf ] ; then
|
||||||
DUMP=$(grep "^DUMPADM_DEVICE=" /etc/dumpadm.conf |\
|
DUMP=$(grep "^DUMPADM_DEVICE=" /etc/dumpadm.conf |\
|
||||||
grep "/dev/zvol/dsk/$pool/" |\
|
grep "/dev/zvol/dsk/" |\
|
||||||
awk -F= '{print $2}')
|
awk -F= '{print $2}')
|
||||||
if [ -n "$DUMP" ] ; then
|
if [ -n "$DUMP" ] ; then
|
||||||
vol=$(echo $DUMP | sed -e 's#/dev/zvol/dsk/##')
|
DUMPVOL=$(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
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
|
|
||||||
|
if [ -n "${SWAPVOLS}${DUMPVOL}" ] ; then
|
||||||
|
# disable snapshots on our swap and dump devices
|
||||||
|
$PFZFS set com.sun:auto-snapshot=false $SWAPVOLS $DUMPVOL
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user