From 444922d1dfb5f9b4ee622cd8b4fdcc01a0e4f03d Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Thu, 11 Feb 2016 14:54:30 +0100 Subject: [PATCH] Possible fix for issue #1534 --- .../Snapshots/lvm-scripts/create-lvm-snapshot.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Duplicati/Library/Snapshots/lvm-scripts/create-lvm-snapshot.sh b/Duplicati/Library/Snapshots/lvm-scripts/create-lvm-snapshot.sh index 259368463..a83c0b605 100644 --- a/Duplicati/Library/Snapshots/lvm-scripts/create-lvm-snapshot.sh +++ b/Duplicati/Library/Snapshots/lvm-scripts/create-lvm-snapshot.sh @@ -82,8 +82,17 @@ then exit $EXIT_CODE fi -LV_SNAPSHOT=`lvdisplay "$LV_GROUP/$NAME" | grep "LV (Name|Path)" | awk '{ print $NF}'` -if [ "$?" -ne 0 ] +# +# Get the path to the volume snapshot +# The cases are here to support various versions of lvdisplay +# +LV_SNAPSHOT=`lvdisplay "$LV_GROUP/$NAME" | grep "LV Path" | awk '{ print $NF}'` +if [ "$?" -ne 0 ] || [ -z "$LV_SNAPSHOT" ] || [ ! -e "$LV_SNAPSHOT" ] +then + LV_SNAPSHOT=`lvdisplay "$LV_GROUP/$NAME" | grep "LV Name" | awk '{ print $NF}'` +fi + +if [ "$?" -ne 0 ] || [ -z "$LV_SNAPSHOT" ] || [ ! -e "$LV_SNAPSHOT" ] then EXIT_CODE=$? echo "Error: Unable to determine LV path for volume $LV_GROUP/$NAME"