MDADM 使用 3 个“故障”驱动器重建 raid 6

MDADM 使用 3 个“故障”驱动器重建 raid 6

我遇到了以下问题:

我的 Raid 6 (/dev/md6) 在 3 个磁盘从阵列中掉出后发生故障。其中一个磁盘肯定已经掉出一段时间了(在 SMART 中,6 个磁盘中的 5 个正常运行时间为 1 年,另一个正常运行时间为 8 个月 21 天)

我首先尝试将 3 个丢失的驱动器添加回阵列,但 sdf1 处于“忙”状态。我可以添加另外两个。

它说 sdf1 正忙(或类似的情况)所以我重新启动并再试一次。

现在的输出是:

root@server:~# mdadm --assemble --run --force --update=resync /dev/md6 /dev/sd[abcdef]1
mdadm: ignoring /dev/sdd1 as it reports /dev/sda1 as failed
mdadm: ignoring /dev/sde1 as it reports /dev/sda1 as failed
mdadm: ignoring /dev/sdc1 as it reports /dev/sda1 as failed
mdadm: Marking array /dev/md6 as 'clean'
mdadm: failed to RUN_ARRAY /dev/md6: Input/output error
mdadm: Not enough devices to start the array.

其他线索:

mdadm --examine /dev/sd[a-f]1 | egrep 'Event|/dev/sd'
/dev/sda1:
         Events : 523989
/dev/sdb1:
         Events : 523989
/dev/sdc1:
         Events : 523989
/dev/sdd1:
         Events : 523989
/dev/sde1:
         Events : 523989
/dev/sdf1:
         Events : 0

root@server:~# mdadm --examine /dev/sd[abcdef]1
/dev/sda1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : f0f7a964:3a8f5f80:a539aff3:cab7a6a5
           Name : fileserver:6  (local to host fileserver)
  Creation Time : Mon Mar 16 15:07:55 2015
     Raid Level : raid6
   Raid Devices : 6

 Avail Dev Size : 7813774957 (3725.90 GiB 4000.65 GB)
     Array Size : 15627548672 (14903.59 GiB 16002.61 GB)
  Used Dev Size : 7813774336 (3725.90 GiB 4000.65 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
          State : active
    Device UUID : 839401fb:04c596d0:78eca459:78d3d7fc

Internal Bitmap : 8 sectors from superblock
    Update Time : Tue Dec 15 12:46:10 2015
       Checksum : f1607072 - correct
         Events : 523989

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 4
   Array State : AAA.AA ('A' == active, '.' == missing)
/dev/sdb1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : f0f7a964:3a8f5f80:a539aff3:cab7a6a5
           Name : fileserver:6  (local to host fileserver)
  Creation Time : Mon Mar 16 15:07:55 2015
     Raid Level : raid6
   Raid Devices : 6

 Avail Dev Size : 7813774957 (3725.90 GiB 4000.65 GB)
     Array Size : 15627548672 (14903.59 GiB 16002.61 GB)
  Used Dev Size : 7813774336 (3725.90 GiB 4000.65 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : a887f904:144d0e39:b306b3a6:29f0a22b

Internal Bitmap : 8 sectors from superblock
    Update Time : Mon Jan  4 19:43:04 2016
       Checksum : dfc3e244 - correct
         Events : 523989

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 0
   Array State : AAA.AA ('A' == active, '.' == missing)
/dev/sdc1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : f0f7a964:3a8f5f80:a539aff3:cab7a6a5
           Name : fileserver:6  (local to host fileserver)
  Creation Time : Mon Mar 16 15:07:55 2015
     Raid Level : raid6
   Raid Devices : 6

 Avail Dev Size : 7813775360 (3725.90 GiB 4000.65 GB)
     Array Size : 15627548672 (14903.59 GiB 16002.61 GB)
  Used Dev Size : 7813774336 (3725.90 GiB 4000.65 GB)
    Data Offset : 258048 sectors
   Super Offset : 8 sectors
          State : active
    Device UUID : 87c811fc:b96d2e28:459ae3a6:917b380e

Internal Bitmap : 8 sectors from superblock
    Update Time : Mon Jan  4 20:03:32 2016
       Checksum : a8c5591f - correct
         Events : 523989

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 5
   Array State : .AA..A ('A' == active, '.' == missing)
/dev/sdd1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : f0f7a964:3a8f5f80:a539aff3:cab7a6a5
           Name : fileserver:6  (local to host fileserver)
  Creation Time : Mon Mar 16 15:07:55 2015
     Raid Level : raid6
   Raid Devices : 6

 Avail Dev Size : 7813774957 (3725.90 GiB 4000.65 GB)
     Array Size : 15627548672 (14903.59 GiB 16002.61 GB)
  Used Dev Size : 7813774336 (3725.90 GiB 4000.65 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
          State : active
    Device UUID : 18880035:fc631ea4:ee518ad5:b94d2720

Internal Bitmap : 8 sectors from superblock
    Update Time : Mon Jan  4 20:03:32 2016
       Checksum : 9e3a0a2d - correct
         Events : 523989

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 1
   Array State : .AA..A ('A' == active, '.' == missing)
/dev/sde1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : f0f7a964:3a8f5f80:a539aff3:cab7a6a5
           Name : fileserver:6  (local to host fileserver)
  Creation Time : Mon Mar 16 15:07:55 2015
     Raid Level : raid6
   Raid Devices : 6

 Avail Dev Size : 7813774957 (3725.90 GiB 4000.65 GB)
     Array Size : 15627548672 (14903.59 GiB 16002.61 GB)
  Used Dev Size : 7813774336 (3725.90 GiB 4000.65 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
          State : active
    Device UUID : 6da68475:bc853f0f:b05e6cd1:43f28656

Internal Bitmap : 8 sectors from superblock
    Update Time : Mon Jan  4 20:03:32 2016
       Checksum : 7c20988f - correct
         Events : 523989

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 2
   Array State : .AA..A ('A' == active, '.' == missing)
/dev/sdf1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : f0f7a964:3a8f5f80:a539aff3:cab7a6a5
           Name : fileserver:6  (local to host fileserver)
  Creation Time : Mon Mar 16 15:07:55 2015
     Raid Level : raid6
   Raid Devices : 6

 Avail Dev Size : 7813774957 (3725.90 GiB 4000.65 GB)
     Array Size : 15627548672 (14903.59 GiB 16002.61 GB)
  Used Dev Size : 7813774336 (3725.90 GiB 4000.65 GB)
    Data Offset : 262144 sectors
   Super Offset : 8 sectors
          State : active
    Device UUID : bef4edfe:272fcf21:2f23e64d:b811cb04

Internal Bitmap : 8 sectors from superblock
    Update Time : Mon Jan  4 19:43:04 2016
       Checksum : 42cc70aa - correct
         Events : 0

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : spare
   Array State : AAA.AA ('A' == active, '.' == missing)

总共 6 个 4TB 硬盘。如能提供任何帮助,我们将不胜感激

答案1

假设磁盘上的数据完好无损(即驱动器因瞬时故障而被踢出阵列),您可以重建阵列。由于六个驱动器中有五个具有相同的事件计数,因此您可能不会丢失任何数据。

有两种方法可以实现此目的:

  1. 快速、高风险的方法:mdadm --assemble --force --run /dev/sd[abcde]1。如果可行,这将为您提供一个以降级模式运行的阵列(缺少一个磁盘),等待您重新添加/dev/sdf并重建它。

  2. 缓慢而安全的方法:按照修复程序Linux RAID 维基。完整的分步过程太长,无法在此重现,但关键在于您使用dmsetup为 RAID 阵列的每个组件卷创建覆盖,让您可以进行试运行修复尝试以查看哪些有效,而无需实际写入磁盘。同样,您将使用驱动器/dev/sda1/dev/sde1降级模式下重新组装阵列。

相关内容