mdadm을 사용하여 기존 RAID 어레이에 미러링된 드라이브를 추가하는 방법은 무엇입니까?

mdadm을 사용하여 기존 RAID 어레이에 미러링된 드라이브를 추가하는 방법은 무엇입니까?

배열을 만들었습니다.

mdadm --create --verbose /dev/md3 --level=mirror --raid-devices=2 /dev/sdc1 /dev/sdd1

위의 작업이 성공적으로 완료되었습니다.

이제 3개의 동일한 미러를 얻기 위해 추가 드라이브를 추가하고 싶습니다. 그럼 여기 나온 정보를 토대로https://raid.wiki.kernel.org/index.php/A_guide_to_mdadm#Adding_a_drive_to_a_mirror난 달린다:

sudo mdadm --grow /dev/md127 --add /dev/sda --raid-devices=3
mdadm: added /dev/sda
raid_disks for /dev/md127 set to 3

그러나 진단을 살펴보십시오.

sudo mdadm -D /dev/md127
/dev/md127:
           Version : 1.2
     Creation Time : Wed May 20 18:06:31 2020
        Raid Level : raid1
        Array Size : 2928507904 (2792.84 GiB 2998.79 GB)
     Used Dev Size : 2928507904 (2792.84 GiB 2998.79 GB)
      Raid Devices : 3
     Total Devices : 3
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Thu May 28 14:44:52 2020
             State : clean, degraded, recovering 
    Active Devices : 2
   Working Devices : 3
    Failed Devices : 0
     Spare Devices : 1

Consistency Policy : bitmap

    Rebuild Status : 0% complete

              Name : blueberry:3  (local to host blueberry)
              UUID : 3cfe6a05:7fbfe9c6:0249d666:1a23a6aa
            Events : 5468

    Number   Major   Minor   RaidDevice State
       0       8       17        0      active sync   /dev/sdb1
       1       8       33        1      active sync   /dev/sdc1
       2       8        0        2      spare rebuilding   /dev/sda
cat /proc/mdstat 
Personalities : [raid1] 
md127 : active raid1 sda[2] sdc1[1] sdb1[0]
      2928507904 blocks super 1.2 [3/2] [UU_]
      [>....................]  recovery =  3.1% (92780288/2928507904) finish=336.6min speed=140405K/sec
      bitmap: 0/22 pages [0KB], 65536KB chunk

unused devices: <none>

spare이 드라이브가 대안 으로 추가된 것 같은데요 ? 그러나 놀라운 점은 그것이 가능하다는 것입니다 rebuild.

답변1

결국 이게 맞는 것 같습니다.

최종 출력은 다음과 같습니다.

cat /proc/mdstat 
Personalities : [raid1] 
md127 : active raid1 sda[2] sdc1[1] sdb1[0]
      2928507904 blocks super 1.2 [3/3] [UUU]
      bitmap: 0/22 pages [0KB], 65536KB chunk

unused devices: <none>
sudo mdadm -D /dev/md127
/dev/md127:
           Version : 1.2
     Creation Time : Wed May 20 18:06:31 2020
        Raid Level : raid1
        Array Size : 2928507904 (2792.84 GiB 2998.79 GB)
     Used Dev Size : 2928507904 (2792.84 GiB 2998.79 GB)
      Raid Devices : 3
     Total Devices : 3
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Thu May 28 22:22:04 2020
             State : clean 
    Active Devices : 3
   Working Devices : 3
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : bitmap

              Name : blueberry:3  (local to host blueberry)
              UUID : 3cfe6a05:7fbfe9c6:0249d666:1a23a6aa
            Events : 11028

    Number   Major   Minor   RaidDevice State
       0       8       17        0      active sync   /dev/sdb1
       1       8       33        1      active sync   /dev/sdc1
       2       8        0        2      active sync   /dev/sda

관련 정보