查看raid详情:
[root@rhel5 ~]#mdadm --detail /dev/md0
/dev/md0:
Version : 0.90
Creation Time : Mon Nov 12 11:55:51 2012
Raid Level : raid5
Array Size : 10485632 (10.00 GiB 10.74 GB)
Used Dev Size : 5242816 (5.00 GiB 5.37 GB)
Raid Devices : 3
Total Devices : 3
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Nov 12 13:54:18 2012
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 64K
UUID : 23542a8f:14e76650:90c202c4:b0bd7c76
Events : 0.20
Number Major Minor RaidDevice State
0 8 64 0 active sync /dev/sde
1 8 32 1 active sync /dev/sdc
2 8 48 2 active sync /dev/sdd
我们可以使用下列命令向/dev/md0中添加一个设备:
[root@rhel5 ~]#mdadm /dev/md0 --add /dev/sdb
mdadm: added /dev/sdb
再次查看raid详情:
[root@rhel5 ~]#mdadm --detail /dev/md0
/dev/md0:
Version : 0.90
Creation Time : Mon Nov 12 11:55:51 2012
Raid Level : raid5
Array Size : 10485632 (10.00 GiB 10.74 GB)
Used Dev Size : 5242816 (5.00 GiB 5.37 GB)
Raid Devices : 3
Total Devices : 4
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Nov 12 13:54:18 2012
State : clean
Active Devices : 3
Working Devices : 4
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 64K
UUID : 23542a8f:14e76650:90c202c4:b0bd7c76
Events : 0.20
Number Major Minor RaidDevice State
0 8 64 0 active sync /dev/sde
1 8 32 1 active sync /dev/sdc
2 8 48 2 active sync /dev/sdd
3 8 16 - spare /dev/sdb
可以看到/dev/sdb 已经添加完成作为备盘
再次将/dev/sde设为故障,sdb会自动启动并恢复,就此/dev/sde再次成为备盘sdb成为活动盘
如下所示:
[root@rhel5 ~]#mdadm --detail /dev/md0
/dev/md0:
Version : 0.90
Creation Time : Mon Nov 12 11:55:51 2012
Raid Level : raid5
Array Size : 10485632 (10.00 GiB 10.74 GB)
Used Dev Size : 5242816 (5.00 GiB 5.37 GB)
Raid Devices : 3
Total Devices : 4
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Nov 12 14:11:29 2012
State : clean
Active Devices : 3
Working Devices : 4
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 64K
UUID : 23542a8f:14e76650:90c202c4:b0bd7c76
Events : 0.26
Number Major Minor RaidDevice State
0 8 16 0 active sync /dev/sdb
1 8 32 1 active sync /dev/sdc
2 8 48 2 active sync /dev/sdd
3 8 64 - spare /dev/sde
16、监控RAID
mdadm的监控模式提供一些实用的功能,你可以使用下列命令来监控/dev/md0,delay参数意味着检测的时间间隔,这样紧急事件和严重的错误会及时发送给系统管理员
转:
当使用监控模式时,mdadm不会退出,你可以使用下列命令:
[1] 3113
[root@localhost eric4ever]# nohup: appending output to `nohup.out'
