mdadm:哪个磁盘正在重build?

我注意到我的软件RAID1性能下降了,并且想知道arrays中的哪个磁盘正在被重build/重新同步,因为它们都显示为正在运行。 我希望有人能够指出这一点,如果甚至有可能找出软件RAID1中的哪个磁盘被降级并正在被重build。

# cat /proc/mdstat md1 : active raid1 sda2[0] sdb2[1] 955789176 blocks super 1.0 [2/2] [UU] [==============>......] resync = 72.2% (690357504/955789176) finish=4025.9min speed=1098K/sec md0 : active raid1 sda1[0] sdb1[1] 20970424 blocks super 1.0 [2/2] [UU] unused devices: <none> # mdadm --detail /dev/md1 /dev/md1: Version : 1.0 Creation Time : Fri Dec 7 04:55:25 2012 Raid Level : raid1 Array Size : 955789176 (911.51 GiB 978.73 GB) Used Dev Size : 955789176 (911.51 GiB 978.73 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Update Time : Fri Mar 29 23:41:16 2013 State : active, resyncing Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Resync Status : 72% complete Name : UUID : Events : 222 Number Major Minor RaidDevice State 0 8 2 0 active sync /dev/sda2 1 8 18 1 active sync /dev/sdb2 

提前致谢!

我只需要提供iostat提供的信息,因为除了软件RAID以外,没有别的东西可以访问单独的磁盘:

 # iostat avg-cpu: %user %nice %system %iowait %steal %idle 15.35 0.00 1.81 0.27 0.00 82.57 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn sdb 219.27 996.77 19033.92 90847986 1734799374 sda 233.08 17037.32 3364.78 1552824003 306674334 

看起来像/ dev / sdb是在这里降级的驱动器:)

在执行实际重build时, mdadm --detail的输出显示哪个磁盘处于活动状态,哪个磁盘正在重build(在底部):

 # mdadm --detail /dev/md4 /dev/md4: Version : 0.90 Creation Time : Wed May 4 17:27:03 2016 Raid Level : raid1 Array Size : 1953511936 (1863.01 GiB 2000.40 GB) Used Dev Size : 1953511936 (1863.01 GiB 2000.40 GB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 4 Persistence : Superblock is persistent Update Time : Thu May 5 10:32:11 2016 State : clean, degraded, recovering Active Devices : 1 Working Devices : 2 Failed Devices : 0 Spare Devices : 1 Rebuild Status : 5% complete UUID : ef8e2106:7247b48b:06921ed9:9b69639a Events : 0.4788 Number Major Minor RaidDevice State 2 8 65 0 spare rebuilding /dev/sde1 1 8 81 1 active sync /dev/sdf1 

在这种情况下,我们可以看到正在从/ dev / sdf1(主动同步)重build/ dev / sde1(备份重build)。

两个磁盘显示为up( U )的事实意味着它们都不会退化到md。 你确定这不仅仅是一个常规的数组检查操作吗? 如果数组正在从故障中恢复,那么我期望它说recovery ,而不是重新resync

https://raid.wiki.kernel.org/index.php/Resync

AFAIK md认为是“up”的任何设备都可以接收读/写。