From 358fe207ca40077b6e22a7c9e0966a39d3114b0c Mon Sep 17 00:00:00 2001 From: heavybullets8 Date: Wed, 26 Oct 2022 20:12:59 -0600 Subject: [PATCH] turn readonly zfs property off --- functions/backup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/functions/backup.sh b/functions/backup.sh index ccf662bc..c13847f0 100644 --- a/functions/backup.sh +++ b/functions/backup.sh @@ -152,10 +152,11 @@ do read -rt 120 -p "Would you like to proceed with restore? (y/N): " yesno || { echo -e "\nFailed to make a selection in time" ; exit; } case $yesno in [Yy] | [Yy][Ee][Ss]) + pool=$(cli -c 'app kubernetes config' | grep -E "pool\s\|" | awk -F '|' '{print $3}' | tr -d " \t\n\r") # Set mountpoints to legacy prior to restore, ensures correct properties for the are set echo -e "\nSetting correct ZFS properties for application volumes.." - for pvc in $(zfs list -t filesystem -r "$(cli -c 'app kubernetes config' | grep -E "pool\s\|" | awk -F '|' '{print $3}' | tr -d " \t\n\r")" -o name -H | grep "/ix-applications/" | grep "volumes/pvc") + for pvc in $(zfs list -t filesystem -r "$pool"/ix-applications -o name -H | grep "volumes/pvc") do if zfs set mountpoint=legacy "$pvc"; then echo "Success for - \"$pvc\"" @@ -163,6 +164,10 @@ do echo "Error: Setting properties for \"$pvc\", failed.." fi done + + # Ensure readonly is turned off + zfs set readonly=off "$pool"/ix-applications + echo "Finished setting properties.." # Beginning snapshot restore