更换故障磁盘后无法组装 raid1 阵列

更换故障磁盘后无法组装 raid1 阵列

我遇到了一个奇怪的 mdadm 情况。

我的 raid1 阵列中的一个驱动器坏了。我关闭了机器,更换了磁盘,从旧的未发生故障的驱动器执行了 ddrescue(成功且无错误)到新驱动器。

现在,当我尝试组装时,我得到:

% sudo mdadm --verbose --assemble /dev/md3 /dev/sdg1 /dev/sdf1
mdadm: looking for devices for /dev/md3                       
mdadm: /dev/sdg1 is identified as a member of /dev/md3, slot 0.
mdadm: /dev/sdf1 is identified as a member of /dev/md3, slot 0.
mdadm: no uptodate device for slot 1 of /dev/md3
mdadm: added /dev/sdg1 to /dev/md3 as 0
mdadm: /dev/md3 assembled from 0 drives and 1 rebuilding - not enough to start the array.

我的cat /proc/mdstat

md3 : inactive sdf1[0](S)
      7813894144 blocks super 1.2

检查输出

% sudo mdadm --examine /dev/sd[fg]1                                                                                                       21-08-21 - 12:13:27
/dev/sdf1:                         
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x2
     Array UUID : 1a5dd664:54cdc95a:f0de5ce2:c8ea58f9
           Name : arcana:3  (local to host arcana)
  Creation Time : Wed Jan 18 14:06:34 2017
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 15627788288 (7451.91 GiB 8001.43 GB)
     Array Size : 7813893952 (7451.91 GiB 8001.43 GB)
  Used Dev Size : 15627787904 (7451.91 GiB 8001.43 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
Recovery Offset : 0 sectors
   Unused Space : before=261864 sectors, after=384 sectors
          State : clean
    Device UUID : 5501a6d9:dfef5dbf:aae0b1cb:4692e6ec

    Update Time : Fri Aug 13 11:19:08 2021
  Bad Block Log : 512 entries available at offset 264 sectors
       Checksum : 2b596499 - correct
         Events : 2777


   Device Role : Active device 0
   Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdg1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x2
     Array UUID : 1a5dd664:54cdc95a:f0de5ce2:c8ea58f9
           Name : arcana:3  (local to host arcana)
  Creation Time : Wed Jan 18 14:06:34 2017
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 15627788288 (7451.91 GiB 8001.43 GB)
     Array Size : 7813893952 (7451.91 GiB 8001.43 GB)
  Used Dev Size : 15627787904 (7451.91 GiB 8001.43 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
Recovery Offset : 0 sectors
   Unused Space : before=261864 sectors, after=384 sectors
          State : clean
    Device UUID : 5501a6d9:dfef5dbf:aae0b1cb:4692e6ec

    Update Time : Fri Aug 13 11:19:08 2021
  Bad Block Log : 512 entries available at offset 264 sectors
       Checksum : 2b596499 - correct
         Events : 2777


   Device Role : Active device 0
   Array State : AA ('A' == active, '.' == missing, 'R' == replacing)

我想修复这个问题(希望不会丢失任何数据)。对于插槽,似乎一个应该是0,另一个应该是1。我该怎么做?我的谷歌搜索失败了,我不想“随便尝试”,因为我有点害怕破坏数据。

相关内容