当 RAID 未显示在 /proc/mdstat 中时,如何监控 RAID10 重建磁盘的进度?

当 RAID 未显示在 /proc/mdstat 中时,如何监控 RAID10 重建磁盘的进度?

我有一个非活动的 RAID 10,其输出mdadm --assemble --scan -v |& tail -17为:

mdadm: /dev/sdn1 is identified as a member of /dev/md/10, slot 5.
mdadm: /dev/sdk1 is identified as a member of /dev/md/10, slot 1.
mdadm: /dev/sdm1 is identified as a member of /dev/md/10, slot 3.
mdadm: /dev/sds1 is identified as a member of /dev/md/10, slot 7 replacement.
mdadm: /dev/sdl1 is identified as a member of /dev/md/10, slot 2.
mdadm: /dev/sdp1 is identified as a member of /dev/md/10, slot 4.
mdadm: /dev/sdj1 is identified as a member of /dev/md/10, slot 0.
mdadm: added /dev/sdk1 to /dev/md/10 as 1
mdadm: added /dev/sdl1 to /dev/md/10 as 2
mdadm: added /dev/sdm1 to /dev/md/10 as 3
mdadm: added /dev/sdp1 to /dev/md/10 as 4
mdadm: added /dev/sdn1 to /dev/md/10 as 5
mdadm: no uptodate device for slot 6 of /dev/md/10
mdadm: no uptodate device for slot 7 of /dev/md/10
mdadm: added /dev/sds1 to /dev/md/10 as 7 replacement
mdadm: added /dev/sdj1 to /dev/md/10 as 0
mdadm: /dev/md/10 assembled from 5 drives and 2 rebuilding - not enough to start the array.

cat /proc/mdstat显示:

Personalities : [raid1] [raid10] 
md0 : active raid10 sdf1[5] sdh1[7] sde1[4] sdc1[2] sda1[0] sdd1[3] sdg1[11] sdb1[9]
      11720531968 blocks super 1.2 512K chunks 2 near-copies [8/8] [UUUUUUUU]
      bitmap: 0/88 pages [0KB], 65536KB chunk

md5 : active raid1 sdo1[0] sdr1[1]
      2930132992 blocks super 1.2 [2/2] [UU]
      bitmap: 0/22 pages [0KB], 65536KB chunk

unused devices: <none>

也就是说,/dev/md10不存在。

但是,它被列在/etc/mdadm.conf

ARRAY /dev/md/0  metadata=1.2 UUID=3d7b58f8:29553a3d:fbbc536e:8bb95424 name=24port:0
ARRAY /dev/md/5  metadata=1.2 UUID=b697a18a:140b0e19:9ef11e04:9f715e52 name=24port:5
ARRAY /dev/md/10  metadata=1.2 UUID=c4ef5c1f:22203248:eaa04b2c:71de0df3 name=24port:10
   spares=1

我的问题是:
有没有办法监控两个重建磁盘的进度?

答案1

尽管mdadm --assemble --scan -v命令报告两个磁盘正在重建,但半天之后却没有任何变化。

因此,我执行了

mdadm --create /dev/md10 -n 8 -l 10 /dev/sd[nkmslpjt]

即我使用了原来的 RAID 10 磁盘(包括热备盘 - /dev/sds1),并添加了另一个空白磁盘(/dev/sdt1),因此 RAID10 中的磁盘总数就是预期的 8 个。

瞧,mdadm它发挥了神奇的作用,并通知了我:

mdadm: array /dev/md10 started.

确实,现在,/dev/sd10 处于活动状态并正在重新同步:

# cat /proc/mdstat 
Personalities : [raid1] [raid10] 
md10 : active raid10 sdt[7] sds[6] sdp[5] sdn[4] sdm[3] sdl[2] sdk[1] sdj[0]
      11720536064 blocks super 1.2 512K chunks 2 near-copies [8/8] [UUUUUUUU]
      [>....................]  resync =  0.0% (1856704/11720536064) finish=1367.4min speed=142823K/sec
      bitmap: 88/88 pages [352KB], 65536KB chunk

md0 : active raid10 sdf1[5] sdh1[7] sde1[4] sdc1[2] sda1[0] sdd1[3] sdg1[11] sdb1[9]
      11720531968 blocks super 1.2 512K chunks 2 near-copies [8/8] [UUUUUUUU]
      bitmap: 0/88 pages [0KB], 65536KB chunk

md5 : active raid1 sdo1[0] sdr1[1]
      2930132992 blocks super 1.2 [2/2] [UU]
      bitmap: 0/22 pages [0KB], 65536KB chunk

unused devices: <none>

相关内容