Updated prep_disks to support imsm RAID arrays
Kyle Sheumaker [Fri, 21 Sep 2018 15:14:42 +0000 (10:14 -0500)]
etc/cloner3/prep_disks.sh

index 080ba34..5733ea0 100755 (executable)
@@ -24,6 +24,25 @@ then
        done
        msg ""
        
+        header "Making imsm RAID arrays"
+
+        for i in `ls -1 /cloner/setup/*.raid-imsm 2> /dev/null`
+        do
+               ARRAY=`basename ${i} .raid-msm`
+               msg "Creating arrays for ${ANSI_BLUE}${ARRAY}${ANSI_DONE} "
+
+               while read line
+               do
+                       msg -n "Creating array ${ANSI_BLUE}${line}${ANSI_DONE} "
+                       yes | mdadm ${line} >> /tmp/stdout.log 2>> /tmp/stderr.log
+                       if [ "$?" != "0" ];
+                       then
+                               fail_msg
+                               clone_fatal_error "Failed to create imsm array ${line} check /tmp/stdout.log or /tmp/stderr.log for details"
+                       fi
+                       echo ""
+               done < ${i}
+       done
 
        header "Partition the disk devices"
        
@@ -31,6 +50,7 @@ then
        do
                DEVICE=`basename ${i}`
                DEVICE=`echo ${DEVICE} | sed 's/\..*//g'`
+               DEVICE=`echo ${DEVICE} | sed 's/__/\//g'`
        
        
                server_log "Partition device ${DEVICE}" "${_node}"
@@ -53,6 +73,7 @@ then
        do
                DEVICE=`basename ${i}`
                DEVICE=`echo ${DEVICE} | sed 's/\..*//g'`
+               DEVICE=`echo ${DEVICE} | sed 's/__/\//g'`
        
                msg -n "Partition device ${ANSI_BLUE}${DEVICE}${ANSI_DONE} "
                server_log "Partition device ${DEVICE}" "${_node}"