我刚刚搬家,需要拆卸服务器并重新连接。此后,我的一个 MDADM RAID5 阵列显示为非活动状态:
root@mserver:/tmp# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10]
md1 : active raid5 sdc1[1] sdh1[2] sdg1[0]
3907023872 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]
md0 : inactive sdd1[0](S) sdf1[3](S) sde1[2](S) sdb1[1](S)
3907039744 blocks
unused devices: <none>
在我看来,好像它找到了所有磁盘,但由于某种原因不想使用它们。
那么 (S) 标签是什么意思,我如何告诉 MDADM 再次开始使用该阵列?
[编辑]我刚刚尝试停止并使用以下命令组装阵列-v
:
root@mserver:~# mdadm --stop /dev/md0
mdadm: stopped /dev/md0
root@mserver:~# mdadm --assemble --scan -v
mdadm: /dev/sde1 is identified as a member of /dev/md0, slot 2.
mdadm: /dev/sdf1 is identified as a member of /dev/md0, slot 3.
mdadm: /dev/sdd1 is identified as a member of /dev/md0, slot 0.
mdadm: /dev/sdb1 is identified as a member of /dev/md0, slot 1.
mdadm: added /dev/sdd1 to /dev/md0 as 0 (possibly out of date)
mdadm: added /dev/sdb1 to /dev/md0 as 1 (possibly out of date)
mdadm: added /dev/sdf1 to /dev/md0 as 3 (possibly out of date)
mdadm: added /dev/sde1 to /dev/md0 as 2
mdadm: /dev/md0 assembled from 1 drive - not enough to start the array.
..进入猫/proc/mdstat
看起来没什么不同。
[编辑2]不确定是否有帮助,但这是检查每个磁盘的结果:
root@mserver:~# mdadm --examine /dev/sdb1
/dev/sdb1:
Magic : a92b4efc
Version : 0.90.00
UUID : 2f331560:fc85feff:5457a8c1:6e047c67 (local to host mserver)
Creation Time : Sun Feb 1 20:53:39 2009
Raid Level : raid5
Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
Array Size : 2930279808 (2794.53 GiB 3000.61 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 0
Update Time : Sat Apr 20 13:22:27 2013
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Checksum : 6c8f71a3 - correct
Events : 955190
Layout : left-symmetric
Chunk Size : 64K
Number Major Minor RaidDevice State
this 1 8 17 1 active sync /dev/sdb1
0 0 8 113 0 active sync /dev/sdh1
1 1 8 17 1 active sync /dev/sdb1
2 2 8 97 2 active sync /dev/sdg1
3 3 8 33 3 active sync /dev/sdc1
root@mserver:~# mdadm --examine /dev/sdd1
/dev/sdd1:
Magic : a92b4efc
Version : 0.90.00
UUID : 2f331560:fc85feff:5457a8c1:6e047c67 (local to host mserver)
Creation Time : Sun Feb 1 20:53:39 2009
Raid Level : raid5
Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
Array Size : 2930279808 (2794.53 GiB 3000.61 GB)
Raid Devices : 4
Total Devices : 2
Preferred Minor : 0
Update Time : Sat Apr 20 18:37:23 2013
State : active
Active Devices : 2
Working Devices : 2
Failed Devices : 2
Spare Devices : 0
Checksum : 6c812869 - correct
Events : 955205
Layout : left-symmetric
Chunk Size : 64K
Number Major Minor RaidDevice State
this 0 8 113 0 active sync /dev/sdh1
0 0 8 113 0 active sync /dev/sdh1
1 1 0 0 1 faulty removed
2 2 8 97 2 active sync /dev/sdg1
3 3 0 0 3 faulty removed
root@mserver:~# mdadm --examine /dev/sde1
/dev/sde1:
Magic : a92b4efc
Version : 0.90.00
UUID : 2f331560:fc85feff:5457a8c1:6e047c67 (local to host mserver)
Creation Time : Sun Feb 1 20:53:39 2009
Raid Level : raid5
Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
Array Size : 2930279808 (2794.53 GiB 3000.61 GB)
Raid Devices : 4
Total Devices : 2
Preferred Minor : 0
Update Time : Sun Apr 21 14:00:43 2013
State : clean
Active Devices : 1
Working Devices : 1
Failed Devices : 2
Spare Devices : 0
Checksum : 6c90cc70 - correct
Events : 955219
Layout : left-symmetric
Chunk Size : 64K
Number Major Minor RaidDevice State
this 2 8 97 2 active sync /dev/sdg1
0 0 0 0 0 removed
1 1 0 0 1 faulty removed
2 2 8 97 2 active sync /dev/sdg1
3 3 0 0 3 faulty removed
root@mserver:~# mdadm --examine /dev/sdf1
/dev/sdf1:
Magic : a92b4efc
Version : 0.90.00
UUID : 2f331560:fc85feff:5457a8c1:6e047c67 (local to host mserver)
Creation Time : Sun Feb 1 20:53:39 2009
Raid Level : raid5
Used Dev Size : 976759936 (931.51 GiB 1000.20 GB)
Array Size : 2930279808 (2794.53 GiB 3000.61 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 0
Update Time : Sat Apr 20 13:22:27 2013
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Checksum : 6c8f71b7 - correct
Events : 955190
Layout : left-symmetric
Chunk Size : 64K
Number Major Minor RaidDevice State
this 3 8 33 3 active sync /dev/sdc1
0 0 8 113 0 active sync /dev/sdh1
1 1 8 17 1 active sync /dev/sdb1
2 2 8 97 2 active sync /dev/sdg1
3 3 8 33 3 active sync /dev/sdc1
我有一些记录表明驱动器最初的组装方式如下:
md0 : active raid5 sdb1[1] sdc1[3] sdh1[0] sdg1[2]
2930279808 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
[编辑3]
查看日志似乎发生了以下情况(基于Update Time
结果--examine
):
- sdb 和 sdf 在 20 日 13:22 后被淘汰
- sdd 在 20 日 18:37 后被淘汰
- 服务器于 1 日 14:00 后关闭
鉴于两个磁盘(显然)同时发生故障,我认为可以合理安全地假设该阵列在该点之后不会被写入(?),因此应该是相对地强制以正确顺序恢复是否安全?执行此操作最安全的命令是什么?有没有办法在不写入任何更改的情况下执行此操作?
答案1
标签S
表示磁盘被视为“备用”。您应该尝试停止并重新启动阵列:
mdadm --stop /dev/md0
mdadm --assemble --scan
重新组装阵列,如果不起作用,您可能需要更新您的mdadm.conf
,例如参见这个问题了解有关如何执行此操作的详细信息。
答案2
这个问题有点老了,但答案可能会对面临类似情况的人有所帮助。从mdadm——检查您提供的输出,它们似乎足够接近(955190 - 对于 sdb1 和 sdf1,955219 对于 sde1,对于 sdd1,您得到 955205)。如果它们低于 40-50,则没问题,在这种情况下,建议的操作方案是手动组装阵列,强制 mdadm 接受驱动器,尽管事件计数存在差异:
停止阵列:
mdadm --stop /dev/md0
然后尝试手动重新组装阵列:
mdadm --assemble --force /dev/md0 /dev/sdb1 /dev/sdd1 /dev/sde1 /dev/sdf1
检查阵列的状态,检查驱动器列表/结构是否正常(命令输出的底部将显示哪个驱动器处于什么状态以及在阵列中的哪个位置):
mdadm --detail /dev/md0
如果结构正确,检查重建进度:
cat /proc/mdstat
答案3
您可以使用以下命令激活 Raid md0
mdadm -A /dev/md0
并使用这个命令来更新 mdadm.conf 文件
mdadm --examine --scan >> /etc/mdadm/mdadm.conf