当我忘记执行 mdadm --remove 时,如何重建 mdraid 阵列?

当我忘记执行 mdadm --remove 时,如何重建 mdraid 阵列?

我已经物理替换了/dev/sdkb磁盘,但是我忘记了:

sudo mdadm /dev/md4 --remove /dev/sdkb3

以下是阵列的状态:

$ sudo mdadm -D /dev/md4
/dev/md4:
        Version : 1.2
  Creation Time : Wed Aug 21 15:55:55 2013
     Raid Level : raid6
     Array Size : 29255442560 (27900.16 GiB 29957.57 GB)
  Used Dev Size : 2925544256 (2790.02 GiB 2995.76 GB)
   Raid Devices : 12
  Total Devices : 11
    Persistence : Superblock is persistent

    Update Time : Fri Jun 30 15:19:55 2023
          State : clean, degraded
 Active Devices : 11
Working Devices : 11
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           Name : NAS_06:4
           UUID : de1e6dce:5fa47110:9e9c2f69:9463a569
         Events : 4290131

    Number   Major   Minor   RaidDevice State
      14      65      483        0      active sync   /dev/sdka3
       -       0        0        1      removed
       2      66      259        2      active sync   /dev/sdkc3
      16      67      387        3      active sync   /dev/sdla3
      15      67      403        4      active sync   /dev/sdlb3
       5      67      419        5      active sync   /dev/sdlc3
      12      69      291        6      active sync   /dev/sdma3
      17      69      307        7      active sync   /dev/sdmb3
       8      69      323        8      active sync   /dev/sdmc3
       9      70      451        9      active sync   /dev/sdna3
      10      70      467       10      active sync   /dev/sdnb3
      13      70      483       11      active sync   /dev/sdnc3
$ sudo parted /dev/sdkb unit s print
Password:
Error: /dev/sdkb: unrecognised disk label
Model: ATA ST3000NC002-1DY1 (scsi)
Disk /dev/sdkb: 5860533168s
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
$

这是同一阵列中另一个磁盘的分区表/dev/md4

$ sudo parted /dev/sdka unit s print
Model: ATA ST3000NM0005-1V4 (scsi)
Disk /dev/sdka: 5860533168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start     End          Size         File system  Name  Flags
 1      2048s     4982527s     4980480s                        raid
 2      4982528s  9176831s     4194304s                        raid
 3      9437184s  5860528064s  5851090881s                     raid

$

EDIT0:我使用parted在扇区模式下/dev/sdka为磁盘手动重新创建了相同的分区表:/dev/sdkb

$ sudo parted /dev/sdkb unit s print
Model: ATA ST3000NC002-1DY1 (scsi)
Disk /dev/sdkb: 5860533168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start     End          Size         File system  Name  Flags
 1      2048s     4982527s     4980480s                        raid
 2      4982528s  9176831s     4194304s                        raid
 3      9437184s  5860528064s  5851090881s                     raid

$

我如何重建此 RAID6 阵列?

相关内容