4

In the past, I expanded/reshaped raid-6 arrays multiple times with mdadm. Today I've added 2 disks to new raid-6 array, and was not able to reshape it.

It was different this time: now with journal and under WSL2 / Ubuntu. Is there a workaround or I am missing something?

root@DESKTOP:~# mdadm -v --grow --raid-devices=7 /dev/md0
mdadm: Cannot set device shape for /dev/md0: Invalid argument

Array details:

root@DESKTOP:~# mdadm --detail /dev/md0
/dev/md0:
           Version : 1.2
     Creation Time : Thu Nov  3 01:14:38 2022
        Raid Level : raid6
        Array Size : 5860144128 (5588.67 GiB 6000.79 GB)
     Used Dev Size : 1953381376 (1862.89 GiB 2000.26 GB)
      Raid Devices : 5
     Total Devices : 8
       Persistence : Superblock is persistent

       Update Time : Fri Nov  4 02:26:35 2022
             State : clean
    Active Devices : 5    Working Devices : 8
    Failed Devices : 0
     Spare Devices : 2

            Layout : left-symmetric
        Chunk Size : 512K

        Consistency Policy : journal

              Name : DESKTOP:0  (local to host DESKTOP)
              UUID : 21b70607:7ca3faf8:af74d21e:caa06133
            Events : 26489

    Number   Major   Minor   RaidDevice State
       0       8       17        0      active sync   /dev/sdb1
       1       8       33        1      active sync   /dev/sdc1
       2       8       49        2      active sync   /dev/sdd1
       3       8       65        3      active sync   /dev/sde1
       4       8       81        4      active sync   /dev/sdf1

       5       7        1        -      journal   /dev/loop1
       6       8      129        -      spare   /dev/sdi1
       7       8      113        -      spare   /dev/sdh1

root@DESKTOP:~# uname -a Linux DESKTOP 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

mdadm - v4.1 - 2018-10-01

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
BarsMonster
  • 206
  • 1
  • 5

1 Answers1

2

Yep, growing raid-6 with journal is not supported, at least by mdadm 4.1

You can:

  1. --fail and remove journal device
  2. echo resync > /sys/block/md0/md/consistency_policy"
  3. add external bitmap
  4. grow array
  5. re-add journal
BarsMonster
  • 206
  • 1
  • 5