问题

更换软件 RAID 上的问题磁盘后,mdadm 无法启动 RAID 数组并显示错误“不足以启动数组”并且软件 Raid 状态显示“活动、失败、未启动”

“mdadm -detail /dev/md0”显示只有 4 个磁盘处于活动状态,8 个已移除磁盘。

# mdadm --detail /dev/md0
  State : active, FAILED, Not Started
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
  Number Major Minor RaidDevice State
  0 0 0 0 removed
  2 0 0 2 removed
  4 0 0 4 removed
  6 0 0 6 removed
  8 0 0 8 removed
  10 0 0 10 removed
  12 0 0 12 removed
  14 0 0 14 removed
  8 9 9 8 active sync /dev/md9
  9 9 10 9 active sync /dev/md10
  10 9 11 10 active sync /dev/md11
  11 9 12 11 active sync /dev/md12
Linux mdadm报错:not enough to start the array
on  it road.com

解决方案

与磁盘的连接存在一些问题,并且已更换磁盘,之后只有 4 个显示同步且显示其他磁盘的设备被移除。

为使软件 RAID 功能正常运行,最少设备应处于活动状态以启动数组。
需要使用 -f(强制)选项组装 mdraid 数组,当 -f 选项与 mdadm -A 命令一起使用时,它将尝试组装数组,

如果某些设备上的元数据似乎已过时。
Mdadm 找不到足够的工作设备来启动数组,但可以找到一些记录为失败的设备。

  1. 这里我们需要停止完整的 md0,因为很少有磁盘显示为活动的。
mdadm: Found some drive for an array that is already active: /dev/md0
mdadm: giving up.
  1. 在尝试重新组装之前,确保对 mdraid 数组挂载点上的数据进行有效备份。
    停止数组:
# mdadm -S /dev/md0
mdadm: stopped /dev/md0
  1. 组装预先存在的数组:
# mdadm -A -f /dev/md0
mdadm: /dev/md0 has been started with 12 drives.
  1. 验证 md0 的状态:
# mdadm --detail /dev/md0
/dev/md0:
  Version : 1.2
  Creation Time : Wed Jan 23 09:34:49 2018
  Raid Level : raid0
  Array Size : 9373701120 (8939.46 GiB 9598.67 GB)
  Raid Devices : 12
  Total Devices : 12
  Persistence : Superblock is persistent
  Update Time : Wed Jan 23 09:34:49 2018
  State : clean
 Active Devices : 12
Working Devices : 12
 Failed Devices : 0
  Spare Devices : 0
  Chunk Size : 512K
  Events : 0
  Number Major Minor RaidDevice State
  0 9 1 0 active sync /dev/md1
  1 9 2 1 active sync /dev/md2
  2 9 3 2 active sync /dev/md3
  3 9 4 3 active sync /dev/md4
  4 9 5 4 active sync /dev/md5
  5 9 6 5 active sync /dev/md6
  6 9 7 6 active sync /dev/md7
  7 9 8 7 active sync /dev/md8
  8 9 9 8 active sync /dev/md9
  9 9 10 9 active sync /dev/md10
  10 9 11 10 active sync /dev/md11
  11 9 12 11 active sync /dev/md12
日期:2020-09-17 00:14:06 来源:oir作者:oir