]>
Commit | Line | Data |
---|---|---|
aff78c96 CS |
1 | #!/bin/sh |
2 | ######################################################################## | |
3 | # Begin $rc_base/init.d/mdadmraid | |
4 | # | |
5 | # Description : This script controls software Raid | |
6 | # | |
7 | # Authors : Dirk Hoefle <dhoefle@gmx.net> | |
8 | # | |
9 | # Version : 01.00 | |
10 | # | |
11 | # Notes : | |
12 | # | |
13 | ######################################################################## | |
14 | ||
15 | . /etc/sysconfig/rc | |
16 | . ${rc_functions} | |
17 | ||
18 | case "${1}" in | |
19 | start) | |
20 | ||
21 | if [ -f /etc/mdadm.conf ] | |
22 | then | |
23 | boot_mesg "Starting Raid devices..." | |
24 | ||
25 | modprobe md | |
26 | modprobe raid0 | |
27 | modprobe raid1 | |
28 | modprobe raid5 | |
29 | ||
30 | sleep 1 | |
31 | ||
32 | mdadm --assemble --scan | |
33 | else | |
34 | boot_mesg "Skipping raid devices, no config found..." | |
35 | exit 1 | |
36 | fi | |
37 | ;; | |
38 | ||
39 | stop) | |
40 | boot_mesg "Stopping Raid devices..." | |
41 | mdadm --stop --scan | |
42 | ;; | |
43 | ||
44 | restart) | |
45 | ${0} stop | |
46 | sleep 1 | |
47 | ${0} start | |
48 | ;; | |
49 | ||
50 | status) | |
51 | cat /proc/mdstat | |
52 | ;; | |
53 | ||
54 | *) | |
55 | echo "Usage: ${0} {start|stop|restart|status}" | |
56 | exit 1 | |
57 | ;; | |
58 | esac | |
59 | ||
60 | # End $rc_base/init.d/mdadmraid |