]>
Commit | Line | Data |
---|---|---|
5e7519fa NB |
1 | |
2 | case $1 in | |
3 | raid* | linear ) | |
4 | grep -s "active $1 " /proc/mdstat > /dev/null || { | |
5 | echo >&2 "ERROR active $1 not found" ; cat /proc/mdstat ; exit 1;} | |
6 | ;; | |
7 | resync | recovery ) | |
8 | sleep 0.1 | |
9 | grep -s $1 /proc/mdstat > /dev/null || { | |
10 | echo >&2 ERROR no $1 happening; cat /proc/mdstat; exit 1; } | |
11 | ;; | |
12 | ||
13 | nosync ) | |
14 | sleep 0.5 | |
15 | grep -s 're[synccovery]* =' > /dev/null /proc/mdstat && { | |
16 | echo >&2 "ERROR resync or recovery is happening!"; cat /proc/mdstat ; exit 1; } | |
17 | ;; | |
18 | ||
19 | wait ) | |
20 | sleep 0.1 | |
21 | while grep 're[synccovery]* =' > /dev/null /proc/mdstat | |
22 | do sleep 2; | |
23 | done | |
24 | ;; | |
25 | ||
26 | state ) | |
27 | grep -s "blocks.*\[$2\]\$" /proc/mdstat > /dev/null || { | |
28 | echo >&2 "ERROR state $2 not found!"; cat /proc/mdstat ; exit 1; } | |
29 | sleep 0.5 | |
30 | ;; | |
31 | ||
32 | * ) echo >&2 ERROR unknown check $1 ; exit 1; | |
33 | esac | |
34 | ||
35 | exit 0 |