MDADM 重建

MDADM 重建

我目前正在重建一个 RAID6 MDADM 阵列,从 5 个设备到 9 个设备。

cat /proc/mdstat

Personalities : [raid6] [raid5] [raid4] 
md0 : active raid6 sde1[0] sdg1[9](F) sdh1[8](F) sdi1[6](F) sdj1[7](F) sdd1[4] sdc1[3] sdb1[5] sdf1[1]
      2926751232 blocks super 1.2 level 6, 512k chunk, algorithm 2 [9/5] [UUUUU____]
      [>....................]  reshape =  0.0% (112640/975583744) finish=142795.3min speed=113K/sec

unused devices: <none>

mdadm --detail /dev/md0

/dev/md0:
        Version : 1.2
  Creation Time : Sun Apr  8 18:20:33 2012
     Raid Level : raid6
     Array Size : 2926751232 (2791.17 GiB 2996.99 GB)
  Used Dev Size : 975583744 (930.39 GiB 999.00 GB)
   Raid Devices : 9
  Total Devices : 9
    Persistence : Superblock is persistent

    Update Time : Tue Dec  3 08:34:44 2013
          State : active, FAILED, reshaping 
 Active Devices : 5
Working Devices : 5
 Failed Devices : 4
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

 Reshape Status : 0% complete
  Delta Devices : 4, (5->9)

           Name : ares:0  (local to host ares)
           UUID : 97b392d0:28dc5cc5:29ca9911:24cefb6b
         Events : 7020

    Number   Major   Minor   RaidDevice State
       0       8       65        0      active sync   /dev/sde1
       1       8       81        1      active sync   /dev/sdf1
       5       8       17        2      active sync   /dev/sdb1
       3       8       33        3      active sync   /dev/sdc1
       4       8       49        4      active sync   /dev/sdd1
       9       8       97        5      faulty spare rebuilding   /dev/sdg1
       8       8      113        6      faulty spare rebuilding   /dev/sdh1
       6       8      129        7      faulty spare rebuilding   /dev/sdi1
       7       8      145        8      faulty spare rebuilding   /dev/sdj1

现在它显示我的新设备有故障。我是否应该担心它正在构建一个不可用的阵列?

答案1

以下是重建 raid 阵列需要遵循的步骤:首先,删除标记为“故障备用重建”的分区。使用 fdisk 创建新的 raid 分区

然后执行以下命令

mdadm --manage /dev/md0 --add /dev/sdg1
mdadm --manage /dev/md0 --add /dev/sdh1
mdadm --manage /dev/md0 --add /dev/sdi1
mdadm --manage /dev/md0 --add /dev/sdj1

监控重建过程cat /proc/mdstat

相关内容