X-Git-Url: https://git.sur5r.net/?p=bacula%2Frescue;a=blobdiff_plain;f=rescue%2Flinux%2Fusb%2Fsrc%2Fscripts%2Frestore%2Fraid;fp=rescue%2Flinux%2Fusb%2Fsrc%2Fscripts%2Frestore%2Fraid;h=231304743bbcb5f38f5c264606a40570e68b2a6e;hp=0000000000000000000000000000000000000000;hb=4dd8d7fe401088b31113cd54fc0cc87ae121c971;hpb=fb21b5066e01a80263767f2406829a10dfa58303 diff --git a/rescue/linux/usb/src/scripts/restore/raid b/rescue/linux/usb/src/scripts/restore/raid new file mode 100644 index 0000000..2313047 --- /dev/null +++ b/rescue/linux/usb/src/scripts/restore/raid @@ -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 + + + + + +