无法将新磁盘添加到 MDADM Raid:无法写入元数据

无法将新磁盘添加到 MDADM Raid:无法写入元数据

当我尝试向 mdadm 添加新磁盘时,收到错误:
sudo mdadm --add /dev/md0 /dev/sdd --verbose

mdadm: Failed to write metadata to /dev/sdd

这是我的设置问题还是其他问题。
我购买了 4 个据说是新的替换磁盘,但我怀疑它们要么被擦除并标记为新的,要么是工厂翻新的,因为我使用它们时遇到了困难,而且列出的累计时间很长。到目前为止,我只尝试了 4 个磁盘中的 2 个。我的设置是通过 LSI2308 连接的 HB-1235 磁盘盒。通常使用多路径,但是我后来禁用了多路径,并断开了第二根电缆,试图找出我无法设置磁盘的原因。尝试运行 fdisk mkfs.ext4 或其他磁盘实用程序无法写入它。我运行了坏块扫描,没有返回坏块。检查 hdparm,未设置只读标志。我发现的另一件奇怪的事情是,即使我禁用了多路径并重新启动,我仍然看到两个驱动器及其多路径别名列出。是否有第二个应用程序可以运行多路径?磁盘是密封的,但我知道任何人都可以将磁盘重新密封到静电袋中。翻新磁盘是否显示出厂时间?

系统详细信息:

  • Ubuntu 22.04.1 LTS
  • mdadm - v4.2 - 2021-12-30
  • 设定
    • 库版本:1.02.175(2021-01-08)
    • 驱动程序版本:4.45.0

sudo mdadm --query --detail /dev/md0

/dev/md0:
           Version : 1.2
     Creation Time : Sat Feb  2 22:55:00 2019
        Raid Level : raid6
        Array Size : 19533824000 (18.19 TiB 20.00 TB)
     Used Dev Size : 1953382400 (1862.89 GiB 2000.26 GB)
      Raid Devices : 12
     Total Devices : 11
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Sat Dec 31 04:39:07 2022
             State : clean, degraded
    Active Devices : 11
   Working Devices : 11
    Failed Devices : 0
     Spare Devices : 0

            Layout : left-symmetric
        Chunk Size : 512K

Consistency Policy : bitmap

              Name : media:0  (local to host media)
              UUID : 1599e3ae:2bb24f48:a9524f60:02b6cb8c
            Events : 5824802

    Number   Major   Minor   RaidDevice State
       0       8      144        0      active sync   /dev/sdj
       1       8      176        1      active sync   /dev/sdl
       2       8      128        2      active sync   /dev/sdi
       3       8      112        3      active sync   /dev/sdh
       4       8       96        4      active sync   /dev/sdg
       5       8      192        5      active sync   /dev/sdm
       -       0        0        6      removed
       7       8       80        7      active sync   /dev/sdf
       8       8      160        8      active sync   /dev/sdk
       9     253        1        9      active sync   /dev/dm-1
      10     253        0       10      active sync   /dev/dm-0
      11       8       32       11      active sync   /dev/sdc


cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid6 sdk[8] sdj[0] sdh[3] sdi[2] sdg[4] sdc[11] sdl[1] sdm[5] sdf[7] dm-1[9] dm-0[10]
      19533824000 blocks super 1.2 level 6, 512k chunk, algorithm 2 [12/11] [UUUUUU_UUUUU]
      bitmap: 15/15 pages [60KB], 65536KB chunk

sudo smartctl -a /dev/sdd

smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.15.0-56-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               SEAGATE
Product:              DKS2P-H2R0SS
Revision:             4F06
Compliance:           SPC-3
User Capacity:        2,000,398,934,016 bytes [2.00 TB]
Logical block size:   512 bytes
Rotation Rate:        7200 rpm
Form Factor:          3.5 inches
Logical Unit id:      0x5000c50041070d0b
Serial number:        Z1P1AFWD0000S138114Q
Device type:          disk
Transport protocol:   SAS (SPL-3)
Local Time is:        Sat Dec 31 12:31:04 2022 PST
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Enabled

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK

Current Drive Temperature:     23 C
Drive Trip Temperature:        68 C

Accumulated power on time, hours:minutes 54263:40
Manufactured in week 06 of year 2012
Specified cycle count over device lifetime:  10000
Accumulated start-stop cycles:  151
Specified load-unload count over device lifetime:  300000
Accumulated load-unload cycles:  151
Elements in grown defect list: 0

Vendor (Seagate Cache) information
  Blocks sent to initiator = 89937483
  Blocks received from initiator = 195186019
  Blocks read from cache and sent to initiator = 750296
  Number of read and write commands whose size <= segment size = 3072072
  Number of read and write commands whose size > segment size = 0

Vendor (Seagate/Hitachi) factory information
  number of hours powered up = 54263.67
  number of minutes until next internal SMART test = 39

Error counter log:
           Errors Corrected by           Total   Correction     Gigabytes    Total
               ECC          rereads/    errors   algorithm      processed    uncorrected
           fast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
read:   2324326148        0         0  2324326148          0       1149.377           0
write:         0        0         0         0          0        101.683           0
verify:   459775        0         0    459775          0          0.000           0

Non-medium error count:        0


[GLTSD (Global Logging Target Save Disable) set. Enable Save with '-S on']
SMART Self-test log
Num  Test              Status                 segment  LifeTime  LBA_first_err [SK ASC ASQ]
     Description                              number   (hours)
# 1  Background short  Completed                   -   54215                 - [-   -    -]

Long (extended) Self-test duration: 5 seconds [0.1 minutes]

这是我上次创建数组时的历史参考: 多路径 Raid 6-MDADM 找不到超级块-18.04

编辑: 在网上查看了一些信息后,我怀疑我的磁盘曾经被格式化为 520 字节扇区磁盘。但是目前的审查没有显示这一点:

参考:https://www.youtube.com/watch?v=DAaTfv96V9w&ab_channel=ArtofServer https://www.reddit.com/r/homelab/comments/9bu8tf/is_this_drive_actually_bad_or_did_i_screw/

我针对几个不同的磁盘运行了 sdparm -all /dev/sdd >> sdd_parm.txt。现有磁盘仅在磁盘 ID 上有所不同。然而,新磁盘有多个不同之处。

colordiff sdc_parm.txt sdd_parm.txt -B --ignore-matching-lines=RE -W 200

1c1
<     /dev/sdc: SEAGATE   ST2000NM0001      XRBA
---
>     /dev/sdd: SEAGATE   DKS2P-H2R0SS      4F06
10c10
<   EER           0  [cha: y, def:  0, sav:  0]  Enable early recovery (obsolete)
---
>   EER           1  [cha: y, def:  0, sav:  1]  Enable early recovery (obsolete)
18c18
<   RRC           20  [cha: y, def: 20, sav: 20]  Read retry count
---
>   RRC           10  [cha: y, def: 20, sav: 10]  Read retry count
28c28
<   RTL           8000  [cha: y, def: -1, sav:8000]  Recovery time limit (ms)
---
>   RTL           2000  [cha: y, def: -1, sav:2000]  Recovery time limit (ms)
41c41
<   MBS           314  [cha: y, def:314, sav:314]  Maximum burst size (512 bytes)
---
>   MBS           1040  [cha: y, def:314, sav:1040]  Maximum burst size (512 bytes)
54c54
<   DBPPS         512  [cha: n, def:512, sav:512]  Data bytes per physical sector
---
>   DBPPS         512  [cha: n, def:520, sav:512]  Data bytes per physical sector
75c75
<   V_DTE         0  [cha: y, def:  0, sav:  0]  Data terminate on error
---
>   V_DTE         1  [cha: y, def:  0, sav:  1]  Data terminate on error
77c77
<   V_RC          20  [cha: y, def: 20, sav: 20]  Verify retry count
---
>   V_RC          5  [cha: y, def: 20, sav:  5]  Verify retry count
79c79
<   V_RTL         8000  [cha: y, def: -1, sav:8000]  Verify recovery time limit (ms)
---
>   V_RTL         1000  [cha: y, def: -1, sav:1000]  Verify recovery time limit (ms)
92c92
<   WCE           0  [cha: y, def:  0, sav:  0]  Write cache enable
---
>   WCE           0  [cha: y, def:  1, sav:  0]  Write cache enable
118c118
<   NCS           32  [cha: n, def: 32, sav: 32]  Number of cache segments
---
>   NCS           3  [cha: y, def: 32, sav:  3]  Number of cache segments
126,127c126,127
<   D_SENSE       1  [cha: y, def:  0, sav:  1]  Descriptor format sense data
<   GLTSD         0  [cha: y, def:  1, sav:  0]  Global logging target save disable
---
>   D_SENSE       0  [cha: y, def:  0, sav:  0]  Descriptor format sense data
>   GLTSD         1  [cha: y, def:  1, sav:  1]  Global logging target save disable
155c155
<   ESTCT         18500  [cha: n, def:18500, sav:18500]  Extended self test completion time (sec)
---
>   ESTCT         5  [cha: y, def: 14, sav:  5]  Extended self test completion time (sec)
172,174c172,174
<   IDLE_C        0  [cha: n, def:  0, sav:  0]  Idle_c timer enable
<   IDLE_B        1  [cha: y, def:  0, sav:  1]  Idle_b timer enable
<   IDLE          1  [cha: y, def:  0, sav:  1]  Idle_a timer enable
---
>   IDLE_C        0  [cha: y, def:  0, sav:  0]  Idle_c timer enable
>   IDLE_B        0  [cha: y, def:  0, sav:  0]  Idle_b timer enable
>   IDLE          0  [cha: y, def:  0, sav:  0]  Idle_a timer enable
183c183
<   ICCT          0  [cha: n, def:  0, sav:  0]  Idle_c condition timer (100 ms)
---
>   ICCT          18000  [cha: y, def:18000, sav:18000]  Idle_c condition timer (100 ms)
195c195
<   PERF          0  [cha: y, def:  0, sav:  0]  Performance (impact of ie operations)
---
>   PERF          1  [cha: y, def:  0, sav:  1]  Performance (impact of ie operations)
202,203c202,203
<   LOGERR        1  [cha: y, def:  0, sav:  1]  Log informational exception errors
<   MRIE          4  [cha: y, def:  0, sav:  4]  Method of reporting informational exceptions
---
>   LOGERR        0  [cha: y, def:  0, sav:  0]  Log informational exception errors
>   MRIE          0  [cha: y, def:  0, sav:  0]  Method of reporting informational exceptions
207,217c207,208
<   INTT          600  [cha: y, def:  0, sav:600]  Interval timer (100 ms)
<   REPC          0  [cha: y, def:  1, sav:  0]  Report count (or Test flag number [SSC-3])
< Background control (SBC) [bc] mode page [PS=1]:
<   S_L_FULL      0  [cha: n, def:  0, sav:  0]  Suspend on log full
<   LOWIR         0  [cha: n, def:  0, sav:  0]  Log only when intervention required
<   EN_BMS        1  [cha: n, def:  1, sav:  1]  Enable background medium scan
<   EN_PS         0  [cha: y, def:  0, sav:  0]  Enable pre-scan
<   BMS_I         72  [cha: y, def: 72, sav: 72]  Background medium scan interval time (hour)
<   BPS_TL        24  [cha: y, def: 24, sav: 24]  Background pre-scan time limit (hour)
<   MIN_IDLE      250  [cha: y, def:500, sav:250]  Minumum idle time before background scan (ms)
<   MAX_SUSP      0  [cha: y, def:  0, sav:  0]  Maximum time to suspend background scan (ms)
---
>   INTT          0  [cha: y, def:  0, sav:  0]  Interval timer (100 ms)
>   REPC          1  [cha: y, def:  1, sav:  1]  Report count (or Test flag number [SSC-3])

驱动差异 第 1/5 页 驱动差异 第 2/5 页 驱动差异 第 3/5 页 驱动差异 第 4/5 页 驱动差异 第 5/5 页

答案1

在这里找到了解决方案: https://www.reddit.com/r/homelab/comments/9bu8tf/is_this_drive_actually_bad_or_did_i_screw/

  1. 最终解决方案是从 HP 下载适用于驱动器型号的固件
  2. 使用 OpenSeaChest 将其刷入驱动器(注意,扇区和字节将显示 0,这是没问题的。)
  3. 重启——我不确定是否有必要,但我还是重启了
  4. 使用 512 字节参数格式化磁盘。我使用了 OpenSeaChest_Format,但我确信 sg_format 的效果一样好。

注意:我怀疑卖家或者向卖家提供驱动器的供应商之前擦除了驱动器并将其重新格式化为 512,但从未刷新过固件,因此磁盘正在寻找 520 扇区分区,但格式化为 512。

相关内容