遇到类似 mdadm 的问题简单的 mdadm RAID 1 未激活备用:
- 已更换 RAID 10 中的故障硬盘
- fdisked 并将新硬盘添加到 mdadmn
- mdam 重新同步阵列
之后我看到以下内容:
...
/dev/md2:
Version : 0.90
Raid Level : raid1
Array Size : 683792000 (652.11 GiB 700.20 GB)
Used Dev Size : 683792000 (652.11 GiB 700.20 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 2
Persistence : Superblock is persistent
State : clean, degraded
Active Devices : 1
Working Devices : 2
Failed Devices : 0
Spare Devices : 1
UUID : e8ba8727:1b7ba76c:2f2051f8:e6dff55c
Events : 0.94996850
Number Major Minor RaidDevice State
0 8 34 0 active sync /dev/sdc2
2 8 50 1 spare rebuilding /dev/sdd2
cat /sys/block/md2/md/sync_action
idle
是否可以在不停止阵列的情况下将备用驱动器转换为活动驱动器?
更新 1
发布重建日志。这里没什么有趣的东西……
grep md /var/log/messages
Jul 19 10:30:19 xen kernel: md: unbind
Jul 19 10:30:19 xen kernel: md: export_rdev(sdd2)
Jul 19 10:32:07 xen kernel: md: bind
Jul 19 10:33:31 xen kernel: md: unbind
Jul 19 10:33:31 xen kernel: md: export_rdev(sdd2)
Jul 19 10:35:01 xen kernel: md: bind
Jul 19 10:35:01 xen kernel: md: recovery of RAID array md2
Jul 19 10:35:01 xen kernel: md: minimum guaranteed speed: 1000 KB/sec/disk.
Jul 19 10:35:01 xen kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for recovery.
Jul 19 10:35:01 xen kernel: md: using 128k window, over a total of 683792000 blocks.
...
Jul 19 17:22:36 xen kernel: md: md2: recovery done.
尝试过:
- 从阵列中删除除第一个驱动器之外的所有驱动器(mdadm --grow /dev/md2 --raid-devices=1 --force)
- 删除了“已移除”和“已分离”的驱动器
- 在新驱动器的分区上将超级块归零(mdadm --zero-superblock /dev/sdd2)
- 将阵列扩大到 raid-devices=2
- 重新添加新驱动器 mdadm /dev/md2 --add /dev/sdd2
一切都一样 :(
mdadm --detail /dev/md2
/dev/md2:
Version : 0.90
Raid Level : raid1
Array Size : 683792000 (652.11 GiB 700.20 GB)
Used Dev Size : 683792000 (652.11 GiB 700.20 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 2
Persistence : Superblock is persistent
Update Time : Thu Jul 19 18:13:46 2018
State : clean, degraded
Active Devices : 1
Working Devices : 2
Failed Devices : 0
Spare Devices : 1
Events : 0.95212006
Number Major Minor RaidDevice State
0 8 34 0 active sync /dev/sdc2
2 8 50 1 spare rebuilding /dev/sdd2