How to recover mdadm raid6 array? mount: can't read superblock. 8/13 drives show all drives present, 5/13 drives show only 5 drives present

I rebooted my server today to find it hanging. I commented out the entry in fstab that loads /dev/md0 and the machine proceeded to boot. The raid was accessible and working prior to the reboot, I only rebooted because of system updates.

The server motherboard is Supermicro X9SAE, and the system has 14 disks, 1 SSD boot drive and 13 disks in a raid6 array. 5/13 disks in the array are attached to the onboard Sata. 8/13 disks in the array are attached to an IT mode LSI 9211-8i

sudo fdisk -l shows all 13 drives, and all 13 drives pass smart tests

tried to mount manually from the command line:

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

Next I tried:

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.

I thought it was odd that it tried 5 drives which is how many is attached to the onboard, sdj-sdn. So I tried assemble with just the ones on the card:

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.

By doing it that way it tried to assemble from 8 drives. So it seems like the 5 onboard disks are out of sync with the 8 drives attached to the card, but this is purely a guess. Next I examined each drive.

This next bit will be pretty long, its the mdadm --examine details of all 13 drives. The thing that I noticed here is that drives sda-sdh all show all disks as present, but drives sdj-sdn show 8 drives missing for the Array State, also noticed the event count, the onboard drives have Events : 1913088, while the ones on the card are at 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)

THIS IS FROM April 17th when it was still working:

/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

What should be my next step to bring the array back online?


HERE IS WHAT I DID, Array is back online and appears to be working. Strangely the last message was "not enough to start the array." but it did start and after a reboot the array is active and clean, and all event counts match. There might be a small amount of data corruption someplace, but the system had been idle for days without issue so I doubt its anything I will miss.

Will keep a close eye on the system for a while, as well as the event counts.

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.