手机版
你好,游客 登录 注册
背景:
阅读新闻

VMware Workstation 8.0 RHEL5.6 mdadm 实现软RAID5

[日期:2012-12-23] 来源:Linux社区  作者:totozlj [字体:大 中 小]

查看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参数意味着检测的时间间隔,这样紧急事件和严重的错误会及时发送给系统管理员

转:

[root@localhost eric4ever]# mdadm --monitor --mail=eric4ever@localhost --delay=300 /dev/md0



当使用监控模式时,mdadm不会退出,你可以使用下列命令:

[root@localhost eric4ever]# nohup mdadm --monitor --mail=eric4ever@localhost --delay=300 /dev/md0 &
[1] 3113
[root@localhost eric4ever]# nohup: appending output to `nohup.out'
linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款