如何恢复 mdadm raid6 阵列?mount:无法读取超级块。13 个驱动器中有 8 个显示所有驱动器均存在,13 个驱动器中有 5 个显示仅存在 5 个驱动器

如何恢复 mdadm raid6 阵列?mount:无法读取超级块。13 个驱动器中有 8 个显示所有驱动器均存在,13 个驱动器中有 5 个显示仅存在 5 个驱动器

今天我重启了服务器,发现它挂了。我注释掉了 fstab 中加载 /dev/md0 的条目,机器继续启动。在重启之前,raid 可以访问并正常工作,我只是因为系统更新才重启的。

服务器主板是 Supermicro X9SAE,系统有 14 个磁盘、1 个 SSD 启动驱动器和 raid6 阵列中的 13 个磁盘。阵列中的 5/13 个磁盘连接到板载 Sata。阵列中的 8/13 个磁盘连接到 IT 模式 LSI 9211-8i

sudo fdisk -l 显示所有 13 个驱动器,并且所有 13 个驱动器都通过了智能测试

尝试从命令行手动挂载:

sudo mount /dev/md0 /mnt/md0
mount: /mnt/md0: can't read superblock on /dev/md0.

cat /proc/mdstat
md0 : inactive sdh[13](S) sdc[8](S) sdm[0](S) sdb[7](S) sdj[14](S) sdd[9](S) sdk[5](S) sdg[12](S) sda[6](S) sdn[2](S) sdl[1](S) sde[10](S) sdf[11](S)
      76185162872 blocks super 1.2

接下来我尝试:

sudo mdadm --stop /dev/md0
mdadm: stopped /dev/md0

sudo mdadm --assemble /dev/md0 /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdj /dev/sdk /dev/sdl /dev/sdm /dev/sdn
mdadm: /dev/md0 assembled from 5 drives - not enough to start the array.

我觉得很奇怪,它尝试了 5 个驱动器,也就是板载 sdj-sdn 上连接的驱动器数量。所以我尝试只使用卡上的驱动器进行组装:

sudo mdadm --assemble /dev/md0 /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh
mdadm: /dev/md0 assembled from 8 drives - not enough to start the array.

通过这种方式,它试图从 8 个驱动器进行组装。因此,似乎 5 个板载磁盘与卡上连接的 8 个驱动器不同步,但这纯粹是猜测。接下来我检查了每个驱动器。

接下来的部分会相当长,它是 mdadm --检查所有 13 个驱动器的详细信息。我在这里注意到的是,驱动器 sda-​​sdh 都显示所有磁盘都存在,但驱动器 sdj-sdn 显示阵列状态缺少 8 个驱动器,还注意到事件计数,板载驱动器有事件:1913088,而卡上的事件为 1913085:

sudo mdadm --examine /dev/sda
/dev/sda:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250800 sectors, after=11440 sectors
          State : clean
    Device UUID : 344864e7:5e19631d:0b14d41f:58264c67

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:38 2019
  Bad Block Log : 512 entries available at offset 32 sectors
       Checksum : 447ce0e - correct
         Events : 1913085

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sdb
/dev/sdb:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250800 sectors, after=11440 sectors
          State : clean
    Device UUID : 244b3058:6919fa6f:c2499e3d:fb9db6e1

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:38 2019
  Bad Block Log : 512 entries available at offset 32 sectors
       Checksum : 5fdf7e64 - correct
         Events : 1913085

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sdc
/dev/sdc:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250800 sectors, after=11440 sectors
          State : clean
    Device UUID : 9081b898:7782d040:acdcc700:e8621ca2

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:38 2019
  Bad Block Log : 512 entries available at offset 32 sectors
       Checksum : f4cd75b5 - correct
         Events : 1913085

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sdd
/dev/sdd:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250800 sectors, after=11440 sectors
          State : clean
    Device UUID : 1b569018:549dae95:bbd59910:601886e3

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:38 2019
  Bad Block Log : 512 entries available at offset 32 sectors
       Checksum : 1abf13a6 - correct
         Events : 1913085

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sde
/dev/sde:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250800 sectors, after=11440 sectors
          State : clean
    Device UUID : 534b24a4:63d20861:502e4012:53fe2652

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:38 2019
  Bad Block Log : 512 entries available at offset 32 sectors
       Checksum : e1f47c75 - correct
         Events : 1913085

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sdf
/dev/sdf:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250800 sectors, after=11440 sectors
          State : clean
    Device UUID : 0821860a:7b75d1cc:bb512247:3dc34a12

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:38 2019
  Bad Block Log : 512 entries available at offset 32 sectors
       Checksum : a924dd98 - correct
         Events : 1913085

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sdg
/dev/sdg:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250800 sectors, after=11440 sectors
          State : clean
    Device UUID : 0c870013:b577639c:eba5f8d4:10a5fee4

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:38 2019
  Bad Block Log : 512 entries available at offset 32 sectors
       Checksum : e1bb7bdb - correct
         Events : 1913085

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sdh
/dev/sdh:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250800 sectors, after=11440 sectors
          State : clean
    Device UUID : 06713ac7:ab2a7de0:d6e0d447:52ed0231

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:38 2019
  Bad Block Log : 512 entries available at offset 32 sectors
       Checksum : 98ef9bf9 - correct
         Events : 1913085

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sdj
/dev/sdj:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250800 sectors, after=11440 sectors
          State : clean
    Device UUID : d6fb6b75:18fee031:84b97ab4:43ee3754

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:43 2019
  Bad Block Log : 512 entries available at offset 32 sectors
       Checksum : 283bd3b6 - correct
         Events : 1913088

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sdk
/dev/sdk:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250792 sectors, after=11440 sectors
          State : clean
    Device UUID : aa02fdc1:15332b2a:eee48dee:9d6a91df

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:43 2019
  Bad Block Log : 512 entries available at offset 72 sectors
       Checksum : 3283b76b - correct
         Events : 1913088

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sdl
/dev/sdl:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250792 sectors, after=11440 sectors
          State : clean
    Device UUID : 4701d341:4c70e117:8a8d37a0:19f8b474

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:43 2019
  Bad Block Log : 512 entries available at offset 72 sectors
       Checksum : e6dd2971 - correct
         Events : 1913088

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sdm
/dev/sdm:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250792 sectors, after=11440 sectors
          State : clean
    Device UUID : ab1c4435:3c735172:3cf07404:f66f2944

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:43 2019
  Bad Block Log : 512 entries available at offset 72 sectors
       Checksum : 68702233 - correct
         Events : 1913088

         Layout : left-symmetric
     Chunk Size : 512K

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

sudo mdadm --examine /dev/sdn
/dev/sdn:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : 405dae60:c540c726:087bbaaf:a15c79c5
           Name : ubuntu:0  (local to host ubuntu)
  Creation Time : Sat Nov  5 18:56:32 2016
     Raid Level : raid6
   Raid Devices : 13

 Avail Dev Size : 11720794288 (5588.91 GiB 6001.05 GB)
     Array Size : 64464305664 (61477.95 GiB 66011.45 GB)
  Used Dev Size : 11720782848 (5588.90 GiB 6001.04 GB)
    Data Offset : 250880 sectors
   Super Offset : 8 sectors
   Unused Space : before=250792 sectors, after=11440 sectors
          State : clean
    Device UUID : b7465e3e:502defd4:dcf61288:b0f14a84

Internal Bitmap : 8 sectors from superblock
    Update Time : Thu Apr 18 09:07:43 2019
  Bad Block Log : 512 entries available at offset 72 sectors
       Checksum : 97e78eb0 - correct
         Events : 1913088

         Layout : left-symmetric
     Chunk Size : 512K

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

这是 4 月 17 日的时候,当时它还在工作:

/dev/md0: 
           Version : 1.2 
     Creation Time : Sat Nov  5 18:56:32 2016 
        Raid Level : raid6 
        Array Size : 64464305664 (61477.95 GiB 66011.45 GB) 
     Used Dev Size : 5860391424 (5588.90 GiB 6001.04 GB) 
      Raid Devices : 13 
     Total Devices : 13 
       Persistence : Superblock is persistent 

     Intent Bitmap : Internal 

       Update Time : Tue Apr 16 19:14:14 2019 
             State : clean  
    Active Devices : 13 
   Working Devices : 13 
    Failed Devices : 0 
     Spare Devices : 0 

            Layout : left-symmetric 
        Chunk Size : 512K 

Consistency Policy : bitmap 

              Name : ubuntu:0  (local to host ubuntu) 
              UUID : 405dae60:c540c726:087bbaaf:a15c79c5 
            Events : 1913085 

    Number   Major   Minor   RaidDevice State 
       0       8      192        0      active sync   /dev/sdm 
       1       8      176        1      active sync   /dev/sdl 
       2       8      208        2      active sync   /dev/sdn 
      14       8      144        3      active sync   /dev/sdj 
       5       8      160        4      active sync   /dev/sdk 
      13       8      112        5      active sync   /dev/sdh 
      12       8       96        6      active sync   /dev/sdg 
      11       8       80        7      active sync   /dev/sdf 
      10       8       64        8      active sync   /dev/sde 
       9       8       48        9      active sync   /dev/sdd 
       8       8       32       10      active sync   /dev/sdc 
       7       8       16       11      active sync   /dev/sdb 
       6       8        0       12      active sync   /dev/sda

我下一步该怎么做才能使阵列重新上线?

答案1

这是我所做的,阵列重新上线并且似乎正在工作。奇怪的是,最后一条消息是“不足以启动阵列”。但它确实启动了,重新启动后,阵列处于活动状态且干净,并且所有事件计数都匹配。某个地方可能有少量数据损坏,但系统已经闲置了几天而没有问题,所以我怀疑这是我会错过的任何事情。

将密切关注系统一段时间,以及事件计数。

sudo mdadm --stop /dev/md0
sudo mdadm --assemble --scan --force

mdadm: forcing event count in /dev/sdh(5) from 1913085 upto 1913088
mdadm: forcing event count in /dev/sdg(6) from 1913085 upto 1913088
mdadm: forcing event count in /dev/sdf(7) from 1913085 upto 1913088
mdadm: forcing event count in /dev/sde(8) from 1913085 upto 1913088
mdadm: forcing event count in /dev/sdd(9) from 1913085 upto 1913088
mdadm: forcing event count in /dev/sdc(10) from 1913085 upto 1913088
mdadm: forcing event count in /dev/sdb(11) from 1913085 upto 1913088
mdadm: forcing event count in /dev/sda(12) from 1913085 upto 1913088
mdadm: clearing FAULTY flag for device 0 in /dev/md0 for /dev/sdh
mdadm: clearing FAULTY flag for device 1 in /dev/md0 for /dev/sdg
mdadm: clearing FAULTY flag for device 3 in /dev/md0 for /dev/sdf
mdadm: clearing FAULTY flag for device 2 in /dev/md0 for /dev/sde
mdadm: clearing FAULTY flag for device 4 in /dev/md0 for /dev/sdd
mdadm: clearing FAULTY flag for device 5 in /dev/md0 for /dev/sdc
mdadm: clearing FAULTY flag for device 6 in /dev/md0 for /dev/sdb
mdadm: clearing FAULTY flag for device 7 in /dev/md0 for /dev/sda
mdadm: Marking array /dev/md0 as 'clean'
mdadm: /dev/md0 assembled from 13 drives - not enough to start the array.

相关内容