我有一个 4 驱动器 Raid 5 阵列。其中一个驱动器 (sdb) 显示大量错误,并且我的阵列在访问期间显示高延迟。

我目前有一个新磁盘,另一个磁盘已被命令。

作为替换的一部分,我还想将 raid 级别从 raid 5 提升到 raid 6。我确定要实现这一点:

首先成长到 6 级

mdadm --manage /dev/md0 --add /dev/sdf1 
mdadm --grow /dev/md0 --raid-devices 5 --level 6 --backup-file /<path>/mdadm-backup
mdadm --manage /dev/md0 --replace /dev/sdb1 # Set faulty but keep it for replacement until a spare drive is available
# After my second drive arrived
mdadm --manage /dev/md0 --add /dev/sdg1

首先更换故障驱动器,然后升级到 raid 级别 6

mdadm --manage /dev/md0 --add /dev/sdf1 
mdadm --manage /dev/md0 --replace /dev/sdb1 --with /dev/sdf1
# after second drive is arrived
mdadm --manage /dev/md0 --add /dev/sdg1
mdadm --grow /dev/md0 --raid-devices 5 --level 6 --backup-file /path/mdadm-backup

这两种解决方案之间有区别吗?通过在阵列中对磁盘施加较少的操作,一种解决方案是否比另一种更安全?

[编辑] 添加智能结果:

Sdb(几乎有故障)

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   082   072   006    Pre-fail  Always       -       22562487
  3 Spin_Up_Time            0x0003   093   093   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       124
  5 Reallocated_Sector_Ct   0x0033   077   077   010    Pre-fail  Always       -       29352
  7 Seek_Error_Rate         0x000f   087   060   030    Pre-fail  Always       -       4963671931
  9 Power_On_Hours          0x0032   026   026   000    Old_age   Always       -       65627
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       124
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       4793
188 Command_Timeout         0x0032   100   072   000    Old_age   Always       -       137445703785
189 High_Fly_Writes         0x003a   001   001   000    Old_age   Always       -       107
190 Airflow_Temperature_Cel 0x0022   073   056   045    Old_age   Always       -       27 (Min/Max 25/28)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       82
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       296
194 Temperature_Celsius     0x0022   027   044   000    Old_age   Always       -       27 (0 14 0 0 0)
197 Current_Pending_Sector  0x0012   001   001   000    Old_age   Always       -       35384
198 Offline_Uncorrectable   0x0010   001   001   000    Old_age   Offline      -       35384
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

安邦

  1 Raw_Read_Error_Rate     0x000f   118   099   006    Pre-fail  Always       -       194860592
  3 Spin_Up_Time            0x0003   093   093   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       124
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       24
  7 Seek_Error_Rate         0x000f   087   060   030    Pre-fail  Always       -       654004767
  9 Power_On_Hours          0x0032   026   026   000    Old_age   Always       -       65631
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       124
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   094   094   000    Old_age   Always       -       6
188 Command_Timeout         0x0032   100   099   000    Old_age   Always       -       2
189 High_Fly_Writes         0x003a   062   062   000    Old_age   Always       -       38
190 Airflow_Temperature_Cel 0x0022   073   059   045    Old_age   Always       -       27 (Min/Max 24/27)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       82
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       295
194 Temperature_Celsius     0x0022   027   041   000    Old_age   Always       -       27 (0 14 0 0 0)
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

安全数据表

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   113   094   006    Pre-fail  Always       -       51447952
  3 Spin_Up_Time            0x0003   093   093   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       124
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   087   060   030    Pre-fail  Always       -       665278320
  9 Power_On_Hours          0x0032   026   026   000    Old_age   Always       -       65630
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       124
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       173
188 Command_Timeout         0x0032   100   099   000    Old_age   Always       -       1
189 High_Fly_Writes         0x003a   001   001   000    Old_age   Always       -       188
190 Airflow_Temperature_Cel 0x0022   073   055   045    Old_age   Always       -       27 (Min/Max 25/27)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       82
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       296
194 Temperature_Celsius     0x0022   027   045   000    Old_age   Always       -       27 (0 14 0 0 0)
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       16
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       16
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0


最佳答案
1

是的,有区别,但我不确定哪个更好。

当您更换 RAID5 中的磁盘时,您需要确保所有其他磁盘均无读取错误,以便重建新磁盘。对于现代驱动器而言,这并非易事。大型现代驱动器的读取错误几率几乎是必然的,您肯定会遇到错误。这就是为什么不再推荐使用 RAID5 的原因。您可以在互联网上找到大量相关信息。

通过迁移到 RAID6,您还将在旧磁盘上产生写入负载。这甚至可能是有利的:驱动器可以具有“当前待处理扇区”(参见 SMART)。这意味着它认为已损坏的扇区。它会在它们收到新的写入后立即重新分配它们。如果扇区仍然不足以接收写入,则“重新分配扇区”的计数器将上升。然后,该扇区将透明地驻留在磁盘上的其他地方。

我的第一步是查看驱动器的 SMART 状态,并查看上述两个参数。

但是,如果您的驱动器确实有待处理的扇区,我不太愿意推荐其中一种方法。我认为如果没有,我会先更换 RAID5 中的磁盘,因为这会对其他磁盘产生非破坏性操作。

并进行备份…

4

  • 我已编辑了我的帖子,其中包含故障驱动器的智能状态。如您所见,“当前待处理扇区”和“重新分配扇区”相当高。对于其他 3 个磁盘,一个是没有错误的新磁盘,其他磁盘与故障磁盘的年龄相同,但“重新分配扇区/当前待处理扇区”分别为 0/16 和 24/0


    – 


  • 1
    @Scandinave 你有点为难了。我认为在你的情况中我会做的是使用 sysrescue USB 启动系统并将整个 /dev/md0 设备克隆到新磁盘(使用 dd)。然后将dd其放回到带有新磁盘的全新 md 设备上。这样,你仍然可以尽可能多地使用故障驱动器的冗余。而且,这是一个可重复的操作。


    – 

  • 问题是我没有容量足以处理 raid 的所有数据的磁盘。我已经备份了重要数据。所以你告诉我这两种方法都会失败?


    – 

  • @Scandinave 的“will”是一个很强烈的词,但是是的,两个“好”的磁盘都有问题。


    –