]> git.sur5r.net Git - bacula/rescue/blobdiff - rescue/linux/usb/src/scripts/restore/raid
Add new usb rescue key code
[bacula/rescue] / rescue / linux / usb / src / scripts / restore / raid
diff --git a/rescue/linux/usb/src/scripts/restore/raid b/rescue/linux/usb/src/scripts/restore/raid
new file mode 100644 (file)
index 0000000..2313047
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+
+               echo "this disk seems to be a raid device, we will remount raid"
+
+                       
+
+                                       echo "do you want to execute this??"
+                                       echo ""
+                                       echo ""
+                                       cat checkraidtemp 
+                                       echo ""
+                                       echo ""
+                                       echo "y/n"
+                                       read a
+                                               if [ "$a" = "y" ];then
+                                               cat checkraidtemp |cut -d"/" -f3|cut -d" " -f1|while read line;do
+
+                                               mdonlinecheck=`echo $line`
+                                               mdadm --detail /dev/$mdonlinecheck |grep Active|cut -d":" -f2|cut -c 2-5>/dev/null
+                                                 if [ $? = 0 ];then
+                                                   raidonline=`mdadm --detail /dev/$mdonlinecheck |grep Active|cut -d":" -f2|cut -c 2-5`
+                                                     if [ ! "$raidonline" = "0" ];then
+                                                 echo "this raid array seems to be online, unmounting it"
+                                                 
+                                                       mdadm --stop /dev/$mdonlinecheck
+                                                       
+                                                     fi
+
+                                                 fi
+                                                  
+                                                 done
+
+
+                                               . ./checkraidtemp
+                                                  fi
+
+
+                                                 
+                                                
+                                               
+