diff options
Diffstat (limited to 'templates/delete')
-rw-r--r-- | templates/delete/raid/node.def | 1 | ||||
-rw-r--r-- | templates/delete/raid/node.tag/member/node.def | 1 | ||||
-rw-r--r-- | templates/delete/raid/node.tag/member/node.tag/node.def | 37 | ||||
-rw-r--r-- | templates/delete/raid/node.tag/node.def | 6 |
4 files changed, 0 insertions, 45 deletions
diff --git a/templates/delete/raid/node.def b/templates/delete/raid/node.def deleted file mode 100644 index 2700b93..0000000 --- a/templates/delete/raid/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Remove a RAID set element diff --git a/templates/delete/raid/node.tag/member/node.def b/templates/delete/raid/node.tag/member/node.def deleted file mode 100644 index 52c411b..0000000 --- a/templates/delete/raid/node.tag/member/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Remove a member of a RAID set diff --git a/templates/delete/raid/node.tag/member/node.tag/node.def b/templates/delete/raid/node.tag/member/node.tag/node.def deleted file mode 100644 index a48fd4a..0000000 --- a/templates/delete/raid/node.tag/member/node.tag/node.def +++ /dev/null @@ -1,37 +0,0 @@ -help: Name of RAID set member to remove - -allowed: - raid_set=${COMP_WORDS[2]} - membership=`cat /proc/mdstat | grep $raid_set | sed -e 's/\[.\]//g' | awk '{ print $5 " " $6 }'` - membership=`echo $membership | sed -e 's/(F)//g'` - echo "$membership" - -run: - raid_set=$3 - member_to_remove=$5 - membership=`cat /proc/mdstat | grep $raid_set | sed -e 's/\[.\]//g' | awk '{ print $5 " " $6 }'` - num_members=`echo $membership | wc -w` - is_in=`echo $membership | grep $member_to_remove` - - if [ -z "$membership" ]; then - echo "$raid_set is not a RAID set" - elif [ -z "$is_in" ]; then - echo "$member_to_remove is not a member of RAID set $raid_set" - echo "actual members are: $membership" - elif [ "$num_members" -eq "1" ]; then - echo "Can't remove last member of a RAID set" - elif [ ! -r /dev/$raid_set ]; then - echo "Must be admin or root to remove RAID set member" - else - echo "removing member $member from RAID set $raid_set" - sudo /sbin/mdadm /dev/$raid_set --fail /dev/$member_to_remove - if [ $? -ne 0 ]; then - echo "Unable to mark member as failed" - else - sleep 1 - sudo /sbin/mdadm /dev/$raid_set --remove /dev/$member_to_remove - if [ $? -ne 0 ]; then - echo "Unable to remove member from RAID set" - fi - fi - fi diff --git a/templates/delete/raid/node.tag/node.def b/templates/delete/raid/node.tag/node.def deleted file mode 100644 index a8d8485..0000000 --- a/templates/delete/raid/node.tag/node.def +++ /dev/null @@ -1,6 +0,0 @@ -help: Name of RAID set to remove object from - -allowed: - local -a array ; - array=`cat /proc/partitions | grep md | awk '{ print $4 }'` - echo -n $array |