]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/usb/src/scripts/restore/raid
Add new usb rescue key code
[bacula/rescue] / rescue / linux / usb / src / scripts / restore / raid
1 #!/bin/sh
2
3
4                 echo "this disk seems to be a raid device, we will remount raid"
5
6                         
7
8                                         echo "do you want to execute this??"
9                                         echo ""
10                                         echo ""
11                                         cat checkraidtemp 
12                                         echo ""
13                                         echo ""
14                                         echo "y/n"
15                                         read a
16                                                 if [ "$a" = "y" ];then
17                                                 cat checkraidtemp |cut -d"/" -f3|cut -d" " -f1|while read line;do
18
19                                                 mdonlinecheck=`echo $line`
20                                                 mdadm --detail /dev/$mdonlinecheck |grep Active|cut -d":" -f2|cut -c 2-5>/dev/null
21                                                   if [ $? = 0 ];then
22                                                     raidonline=`mdadm --detail /dev/$mdonlinecheck |grep Active|cut -d":" -f2|cut -c 2-5`
23                                                       if [ ! "$raidonline" = "0" ];then
24                                                   echo "this raid array seems to be online, unmounting it"
25                                                   
26                                                         mdadm --stop /dev/$mdonlinecheck
27                                                         
28                                                       fi
29
30                                                   fi
31                                                    
32                                                   done
33
34
35                                                 . ./checkraidtemp
36                                                    fi
37
38
39                                                   
40                                                  
41                                                 
42