From 618899ba8f5fda287be7b399e5f4358efc00a990 Mon Sep 17 00:00:00 2001 From: Cody Cook Date: Mon, 1 Apr 2019 11:30:57 -0700 Subject: [PATCH] There are several times where customers are mistakenly creating folders where there should be btrfs subvolumes, so this script will check now to see if it is valid. I plan to add a migrate-to-proper-subvolume feature later. --- share_lun_ui_fix.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share_lun_ui_fix.sh b/share_lun_ui_fix.sh index 6ac36ed..2573da8 100755 --- a/share_lun_ui_fix.sh +++ b/share_lun_ui_fix.sh @@ -172,12 +172,18 @@ else if [[ $? == 2 ]]; then echo "No shares or LUNs found." else - objects=$(echo "$objects" |egrep -v "^.apps\/$|^home\/$|^.purge\/$|^._share\/$|^.timemachine\/$|^.vault\/$|^.TemporaryItems\/$" | sed 's/\/$//;s/\.\///') + objects=$(echo "$objects" |egrep -v "^.apps\/$|^\.\/home\/$|^.purge\/$|^._share\/$|^.timemachine\/$|^.vault\/$|^.TemporaryItems\/$" | sed 's/\/$//;s/\.\///') echo "= Objects found: $(echo $objects | wc -w)" echo $objects backup_configs for item in $objects; do echo "== Reviewing $item" + btrfs subv show /"$volume"/"$item" &>/dev/null + if [[ $? -eq "1" ]]; then + echo "WARNING! /$volume/$item is NOT a valid btrfs subvolume, so it may not appear in the UI." + echo "We will create the configs, but will work on a migration feature later to proper btrfs subvolume." + fi + if ls -QdA /"$volume"/"$item"/.iscsi >/dev/null 2>&1; then iscsi_create else