mdadm:非正常关机后重新激活 RAID6 阵列

mdadm:非正常关机后重新激活 RAID6 阵列

我在文件服务器上有一个七磁盘 RAID6 阵列。服务器崩溃,需要硬重置,导致非正常关机。请注意,当时阵列上可能正在发生 I/O 活动,因此我假设需要检查阵列以解决任何潜在的不一致问题。我重新启动了服务器,根据 /proc/mdstat,阵列处于非活动状态,但所有驱动器都显示为 (S)。(备用?)无论如何,要重新激活和检查阵列,应采取什么适当的操作?(当然,一旦阵列本身运行并再次一致,我将检查阵列上的文件系统,但我只需要帮助找出让阵列重新工作的正确方法。)

/proc/mdstat

Personalities : 
md0 : inactive sdf1[4](S) sdh1[1](S) sdg1[3](S) sdc1[7](S) sdd1[8](S) sdb1[6](S) sda1[5](S)
      13674579968 blocks super 1.2

unused devices: <none>

mdadm——检查/dev/sd{a,b,c,d,f,g,h}1

/dev/sda1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 05e69c50:388afb83:1418f18e:a393cb21
           Name : dende:0  (local to host dende)
  Creation Time : Sat May 26 17:14:56 2012
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3907022848 (1863.01 GiB 2000.40 GB)
     Array Size : 9767554560 (9315.07 GiB 10001.98 GB)
  Used Dev Size : 3907021824 (1863.01 GiB 2000.40 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
   Unused Space : before=1968 sectors, after=1024 sectors
          State : active
    Device UUID : 14691340:39f90733:090f8d1d:992b9aa7

    Update Time : Sun Nov 23 18:20:24 2014
       Checksum : cd065d9e - correct
         Events : 63764

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 6
   Array State : .AAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdb1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 05e69c50:388afb83:1418f18e:a393cb21
           Name : dende:0  (local to host dende)
  Creation Time : Sat May 26 17:14:56 2012
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3907022848 (1863.01 GiB 2000.40 GB)
     Array Size : 9767554560 (9315.07 GiB 10001.98 GB)
  Used Dev Size : 3907021824 (1863.01 GiB 2000.40 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
   Unused Space : before=1968 sectors, after=1024 sectors
          State : active
    Device UUID : 01c26529:75542d96:c966fe26:f580dcdf

    Update Time : Sun Nov 23 18:20:24 2014
       Checksum : 5b31bee5 - correct
         Events : 63764

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 5
   Array State : .AAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdc1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 05e69c50:388afb83:1418f18e:a393cb21
           Name : dende:0  (local to host dende)
  Creation Time : Sat May 26 17:14:56 2012
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3907022848 (1863.01 GiB 2000.40 GB)
     Array Size : 9767554560 (9315.07 GiB 10001.98 GB)
  Used Dev Size : 3907021824 (1863.01 GiB 2000.40 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
   Unused Space : before=1968 sectors, after=1024 sectors
          State : active
    Device UUID : 24aa47a3:9f0a123e:f0ce78b2:774359bd

    Update Time : Sun Nov 23 18:20:24 2014
       Checksum : e5ef87dc - correct
         Events : 63764

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 4
   Array State : .AAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdd1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 05e69c50:388afb83:1418f18e:a393cb21
           Name : dende:0  (local to host dende)
  Creation Time : Sat May 26 17:14:56 2012
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3907022848 (1863.01 GiB 2000.40 GB)
     Array Size : 9767554560 (9315.07 GiB 10001.98 GB)
  Used Dev Size : 3907021824 (1863.01 GiB 2000.40 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
   Unused Space : before=1968 sectors, after=1024 sectors
          State : active
    Device UUID : e2983a0c:0bc3b3d4:b8d018c7:fb547dff

    Update Time : Sun Nov 23 18:20:24 2014
       Checksum : 3c484254 - correct
         Events : 63764

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 3
   Array State : .AAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdf1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 05e69c50:388afb83:1418f18e:a393cb21
           Name : dende:0  (local to host dende)
  Creation Time : Sat May 26 17:14:56 2012
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3907022848 (1863.01 GiB 2000.40 GB)
     Array Size : 9767554560 (9315.07 GiB 10001.98 GB)
  Used Dev Size : 3907021824 (1863.01 GiB 2000.40 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
   Unused Space : before=1968 sectors, after=1024 sectors
          State : active
    Device UUID : 82f35d80:31b62631:22102161:dda95f56

    Update Time : Sun Nov 23 18:18:13 2014
       Checksum : fdc823df - correct
         Events : 63764

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 0
   Array State : AAAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdg1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 05e69c50:388afb83:1418f18e:a393cb21
           Name : dende:0  (local to host dende)
  Creation Time : Sat May 26 17:14:56 2012
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3907022848 (1863.01 GiB 2000.40 GB)
     Array Size : 9767554560 (9315.07 GiB 10001.98 GB)
  Used Dev Size : 3907021824 (1863.01 GiB 2000.40 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
   Unused Space : before=1968 sectors, after=1024 sectors
          State : active
    Device UUID : 2612c125:cb5d4712:4777122a:46b5e6c7

    Update Time : Sun Nov 23 18:20:24 2014
       Checksum : bec55d2b - correct
         Events : 63764

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 2
   Array State : .AAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdh1:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 05e69c50:388afb83:1418f18e:a393cb21
           Name : dende:0  (local to host dende)
  Creation Time : Sat May 26 17:14:56 2012
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3907022848 (1863.01 GiB 2000.40 GB)
     Array Size : 9767554560 (9315.07 GiB 10001.98 GB)
  Used Dev Size : 3907021824 (1863.01 GiB 2000.40 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
   Unused Space : before=1968 sectors, after=1024 sectors
          State : active
    Device UUID : 8cb08975:ff61e873:997d5d58:0559d0f9

    Update Time : Sun Nov 23 18:20:24 2014
       Checksum : d063a9d5 - correct
         Events : 63764

         Layout : left-symmetric
     Chunk Size : 512K

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

我看到 /dev/sdf1 与其他设备的阵列状态不同,这对我来说一定很有意义,但至于这个意义是什么,我不知道。我非常感谢各位好心的女士们先生们提供的任何帮助。:-)

编辑:尝试了下面评论中关于停止阵列和组装的建议。mdadm 报告它已成功启动了具有 7 个驱动器的 /dev/md0,并且根据 /proc/mdstat,阵列现在正在重新同步(这显然需要一段时间)。我猜这意味着它看到一个设备略微过时并且正在使用其他设备恢复它?这是否意味着 RAID 方面现在应该很好?(在对阵列进行任何操作之前,我仍然会检查文件系统。)

答案1

显然,在阵列组装时,所需的 RAID 6 特性尚未可用,因为模块raid456尚未加载。

停止错误组装的阵列,加载模块并重新组装应该会有所帮助:

mdadm --stop md0
modprobe raid456
mdadm --assemble --uuid=05e69c50:388afb83:1418f18e:a393cb21

UUID 就是输出中列出的数组 UUID mdadm --examine

根据系统的启动方式,您可能需要确保raid456在组装 md 数组之前加载该模块。

提示:在较大的阵列上,向设备添加写入意图位图会很有帮助,这样在发生像您遇到的故障后,不需要重新同步整个阵列;只需同步那些过时的部分即可。您可以使用以下命令执行此操作:

mdadm --grow --bitmap internal /dev/md0

也可以在创建时指定位图,上面的命令是在创建后添加位图。可以通过指定none而不是 来删除位图internal

相关内容