10:移除,添加分区到阵列
[root@yang ~]# mdadm /dev/md1 -r /dev/hda5
mdadm: hot removed /dev/hda5
[root@yang ~]# mdadm /dev/md1 -a /dev/hda5
mdadm: added /dev/hda5
11:下面重点演示下当阵列出现故障的时候,系统自动发邮件报警的设定
[root@yang ~]# mail -s "just a test for my rhel mail server" ylw6006@163.com
[root@yang ~]# cat /etc/mdadm.conf
ARRAY /dev/md1 level=raid5 num-devices=3 metadata=0.90 spares=1 UUID=df904d25:12be50fb:cf70917a:e15d87d9
MAILADDR ylw6006@163.com //在文件末尾添加这行
[root@yang ~]# service mdmonitor status //启动mdmonitor服务,并确保其开机自启动
mdadm is stopped
[root@yang ~]# service mdmonitor start
Starting mdmonitor: [ OK ]
[root@yang ~]# chkconfig mdmonitor on
[root@yang ~]# mdadm /dev/md1 -f /dev/hda5 //模拟阵列中的两块磁盘故障
mdadm: set /dev/hda5 faulty in /dev/md1
[root@yang ~]# mdadm /dev/md1 -f /dev/hda6
mdadm: set /dev/hda6 faulty in /dev/md1
[root@yang data]# dd if=/dev/zero of=1.txt bs=1k //分区的I/0马上就会出现故障
dd: writing `1.txt': Read-only file system
158922+0 records in
158921+0 records out
162735104 bytes (163 MB) copied, 14.6255 seconds, 11.1 MB/s
[root@yang data]# ll
ls: reading directory .: Input/output error
total 0
在定义的邮箱中就会收到报警邮件,要修复类似的故障,只能先停掉阵列,然后重新新建阵列了,格式化分区了,原来的数据就没有了!