在将驱动器添加到 raid-6 后,如何在重新启动后启动非活动的 mdadm RAID?

在将驱动器添加到 raid-6 后,如何在重新启动后启动非活动的 mdadm RAID?

我多年来一直使用 webmin 来管理我的 RAID 阵列,但我从来没有任何理由mdadm在终端中使用这些命令。

然而,几天前,我向我的六个驱动器的 RAID6 阵列添加了一个磁盘,并且重塑没有任何进展。我以为如果我重新启动计算机,问题就会解决,但重新启动后,我现在遇到了更大的问题。

虽然阵列在重新启动后处于干净状态,但我无法在 /dev/md3 上启动阵列。请参阅命令和附加的 webmin 屏幕截图。

MD RAID 的 Webmin 屏幕截图

/dev/md3 的 Webmin 屏幕截图

250:~ # cat /etc/os-release
NAME="openSUSE Tumbleweed"
# VERSION="20161112"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="20161112"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20161112"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"


250:~ # uname -a
Linux 250 4.8.6-2-default #1 SMP PREEMPT Thu Nov 3 13:00:34 UTC 2016 (1d89b44) x86_64 x86_64 x86_64 GNU/Linux


250:~ # rpm -q webmin 
webmin-1.820-1.noarch


250:~ # mdadm -V
mdadm - v3.4 - 28th January 2016


250:~ # cat /proc/mdstat 
Personalities : [raid6] [raid5] [raid4] 
md127 : active raid6 sdi2[7] sdf2[4] sdc2[2] sdb2[0] sda2[1] sdd2[5] sdg2[6]
      5119360 blocks super 1.0 level 6, 128k chunk, algorithm 2 [7/7] [UUUUUUU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid6 sdc3[2] sdf3[5] sda3[1] sdb3[3] sdd3[4] sdi3[6] sdg3[0]
      153599360 blocks super 1.0 level 6, 128k chunk, algorithm 2 [7/7] [UUUUUUU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md3 : inactive sdi4[7] sdf4[4] sdd4[5] sdb4[0] sdc4[2] sda4[1] sdg4[6]
      3103718444 blocks super 1.0

md0 : active raid6 sdf6[5] sdc6[2] sdb6[4] sda6[1] sdi6[8] sdd6[6] sdg6[7]
      7149870080 blocks super 1.2 level 6, 512k chunk, algorithm 2 [7/7] [UUUUUUU]
      bitmap: 0/11 pages [0KB], 65536KB chunk

md2 : active raid6 sdb5[0] sdc5[2] sdd5[5] sda5[1] sdi5[7] sdf5[4] sdg5[6]
      5119993600 blocks super 1.0 level 6, 128k chunk, algorithm 2 [7/7] [UUUUUUU]
      bitmap: 0/8 pages [0KB], 65536KB chunk

unused devices: <none>


250:~ # mdadm -D /dev/md3
/dev/md3:
        Version : 1.0
  Creation Time : Sat Dec 12 07:16:21 2015
     Raid Level : raid6
  Used Dev Size : 443387648 (422.85 GiB 454.03 GB)
   Raid Devices : 7
  Total Devices : 7
    Persistence : Superblock is persistent

    Update Time : Thu Nov 17 14:17:34 2016
          State : active, Not Started 
 Active Devices : 7
Working Devices : 7
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 128K

  Delta Devices : 1, (6->7)

           Name : any:3
           UUID : 51cc1190:dc4821a5:c1161e00:b73e02ec
         Events : 139752

    Number   Major   Minor   RaidDevice State
       0       8       20        0      active sync   /dev/sdb4
       1       8        4        1      active sync   /dev/sda4
       2       8       36        2      active sync   /dev/sdc4
       4       8       84        3      active sync   /dev/sdf4
       6       8      100        4      active sync   /dev/sdg4
       5       8       52        5      active sync   /dev/sdd4
       7       8      132        6      active sync   /dev/sdi4


250:~ # mdadm -E /dev/sd[abcdfgi]4
/dev/sda4:
          Magic : a92b4efc
        Version : 1.0
    Feature Map : 0x5
     Array UUID : 51cc1190:dc4821a5:c1161e00:b73e02ec
           Name : any:3
  Creation Time : Sat Dec 12 07:16:21 2015
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 886775528 (422.85 GiB 454.03 GB)
     Array Size : 2216938240 (2114.24 GiB 2270.14 GB)
  Used Dev Size : 886775296 (422.85 GiB 454.03 GB)
   Super Offset : 886775792 sectors
   Unused Space : before=0 sectors, after=480 sectors
          State : clean
    Device UUID : 92f5e8d6:4e55facc:5446de77:ee298eee

Internal Bitmap : -16 sectors from superblock
  Reshape pos'n : 0
  Delta Devices : 1 (6->7)

    Update Time : Thu Nov 17 14:17:34 2016
  Bad Block Log : 512 entries available at offset -8 sectors
       Checksum : 5c4a0af8 - correct
         Events : 139752

         Layout : left-symmetric
     Chunk Size : 128K

   Device Role : Active device 1
   Array State : AAAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdb4:
          Magic : a92b4efc
        Version : 1.0
    Feature Map : 0x5
     Array UUID : 51cc1190:dc4821a5:c1161e00:b73e02ec
           Name : any:3
  Creation Time : Sat Dec 12 07:16:21 2015
     Raid Level : raid6
   Raid Devices : 7


 Avail Dev Size : 886775528 (422.85 GiB 454.03 GB)
     Array Size : 2216938240 (2114.24 GiB 2270.14 GB)
  Used Dev Size : 886775296 (422.85 GiB 454.03 GB)
   Super Offset : 886775792 sectors
   Unused Space : before=0 sectors, after=480 sectors
          State : clean
    Device UUID : b36bd7a1:ec792d23:51c0e852:e9ba91b5

Internal Bitmap : -16 sectors from superblock
  Reshape pos'n : 0
  Delta Devices : 1 (6->7)

    Update Time : Thu Nov 17 14:17:34 2016
  Bad Block Log : 512 entries available at offset -8 sectors
       Checksum : 1f79aeed - correct
         Events : 139752

         Layout : left-symmetric
     Chunk Size : 128K

   Device Role : Active device 0
   Array State : AAAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdc4:
          Magic : a92b4efc
        Version : 1.0
    Feature Map : 0x5
     Array UUID : 51cc1190:dc4821a5:c1161e00:b73e02ec
           Name : any:3
  Creation Time : Sat Dec 12 07:16:21 2015
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 886783720 (422.85 GiB 454.03 GB)
     Array Size : 2216938240 (2114.24 GiB 2270.14 GB)
  Used Dev Size : 886775296 (422.85 GiB 454.03 GB)
   Super Offset : 886783984 sectors
   Unused Space : before=0 sectors, after=8672 sectors
          State : clean
    Device UUID : ab40e58e:724de1e3:e502ccf0:831a93cd

Internal Bitmap : -16 sectors from superblock
  Reshape pos'n : 0
  Delta Devices : 1 (6->7)

    Update Time : Thu Nov 17 14:17:34 2016
  Bad Block Log : 512 entries available at offset -8 sectors
       Checksum : 8320399c - correct
         Events : 139752

         Layout : left-symmetric
     Chunk Size : 128K

   Device Role : Active device 2
   Array State : AAAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdd4:
          Magic : a92b4efc
        Version : 1.0
    Feature Map : 0x5
     Array UUID : 51cc1190:dc4821a5:c1161e00:b73e02ec
           Name : any:3
  Creation Time : Sat Dec 12 07:16:21 2015
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 886775528 (422.85 GiB 454.03 GB)
     Array Size : 2216938240 (2114.24 GiB 2270.14 GB)
  Used Dev Size : 886775296 (422.85 GiB 454.03 GB)
   Super Offset : 886775792 sectors
   Unused Space : before=0 sectors, after=480 sectors
          State : clean
    Device UUID : b0f9f68d:0ad6f39a:50043287:10b0570d

Internal Bitmap : -16 sectors from superblock
  Reshape pos'n : 0
  Delta Devices : 1 (6->7)

    Update Time : Thu Nov 17 14:17:34 2016
  Bad Block Log : 512 entries available at offset -8 sectors
       Checksum : f6ed233 - correct
         Events : 139752

         Layout : left-symmetric
     Chunk Size : 128K

   Device Role : Active device 5
   Array State : AAAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdf4:
          Magic : a92b4efc
        Version : 1.0
    Feature Map : 0x5
     Array UUID : 51cc1190:dc4821a5:c1161e00:b73e02ec
           Name : any:3
  Creation Time : Sat Dec 12 07:16:21 2015
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 886775528 (422.85 GiB 454.03 GB)
     Array Size : 2216938240 (2114.24 GiB 2270.14 GB)
  Used Dev Size : 886775296 (422.85 GiB 454.03 GB)
   Super Offset : 886775792 sectors
   Unused Space : before=0 sectors, after=480 sectors
          State : clean
    Device UUID : c63684ba:59abf1dc:603d3c94:b5efd4b6

Internal Bitmap : -16 sectors from superblock
  Reshape pos'n : 0
  Delta Devices : 1 (6->7)

    Update Time : Thu Nov 17 14:17:34 2016
  Bad Block Log : 512 entries available at offset -8 sectors
       Checksum : 34815d4d - correct
         Events : 139752

         Layout : left-symmetric
     Chunk Size : 128K

   Device Role : Active device 3
   Array State : AAAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdg4:
          Magic : a92b4efc
        Version : 1.0
    Feature Map : 0x5
     Array UUID : 51cc1190:dc4821a5:c1161e00:b73e02ec
           Name : any:3
  Creation Time : Sat Dec 12 07:16:21 2015
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 886775528 (422.85 GiB 454.03 GB)
     Array Size : 2216938240 (2114.24 GiB 2270.14 GB)
  Used Dev Size : 886775296 (422.85 GiB 454.03 GB)
   Super Offset : 886775792 sectors
   Unused Space : before=0 sectors, after=480 sectors
          State : clean
    Device UUID : 9ef6c9e1:5a56c716:4cc8645f:bd92060b

Internal Bitmap : -16 sectors from superblock
  Reshape pos'n : 0
  Delta Devices : 1 (6->7)

    Update Time : Thu Nov 17 14:17:34 2016
  Bad Block Log : 512 entries available at offset -8 sectors
       Checksum : b4f6f61a - correct
         Events : 139752

         Layout : left-symmetric
     Chunk Size : 128K

   Device Role : Active device 4
   Array State : AAAAAAA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdi4:
          Magic : a92b4efc
        Version : 1.0
    Feature Map : 0x5
     Array UUID : 51cc1190:dc4821a5:c1161e00:b73e02ec
           Name : any:3
  Creation Time : Sat Dec 12 07:16:21 2015
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 886775528 (422.85 GiB 454.03 GB)
     Array Size : 2216938240 (2114.24 GiB 2270.14 GB)
  Used Dev Size : 886775296 (422.85 GiB 454.03 GB)
   Super Offset : 886775792 sectors
   Unused Space : before=0 sectors, after=480 sectors
          State : clean
    Device UUID : a6046dca:1edf6818:5fe92892:2e3a966f

Internal Bitmap : -16 sectors from superblock
  Reshape pos'n : 0
  Delta Devices : 1 (6->7)

    Update Time : Thu Nov 17 14:17:34 2016
  Bad Block Log : 512 entries available at offset -8 sectors
       Checksum : 368f556c - correct
         Events : 139752

         Layout : left-symmetric
     Chunk Size : 128K

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


250:~ # mdadm --examine --scan
ARRAY /dev/md/0  metadata=1.2 UUID=ad2e4877:bb799c91:49e20b58:c0866104 name=430:0
ARRAY /dev/md/swap  metadata=1.0 UUID=a8f1a9d5:bd89d7db:0764ba4d:5a515066 name=any:swap
ARRAY /dev/md/2  metadata=1.0 UUID=0d675c76:d91e6dd2:b8b89871:5af91fed name=any:2
ARRAY /dev/md/3  metadata=1.0 UUID=51cc1190:dc4821a5:c1161e00:b73e02ec name=any:3
ARRAY /dev/md/0  metadata=1.0 UUID=8cedcb83:66499024:f9d66cca:7e7b367b name=any:0

答案1

如果mdadm在组装数组时无法找到数组的所有部分,则不会自动激活它使用。您可以使用命令手动激活它mdadm --run /dev/md3。它可能以只读模式启动,在这种情况下,您可以使用 将其置于读写模式mdadm --readwrite /dev/md3

这是一个安全的操作:如果没有足够的阵列块来保存完整的数据集(例如,RAID6 中缺少三个驱动器,或者 RAID10 中缺少一对匹配的驱动器),mdadm则不会执行任何操作。

相关内容