5

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

1 Answer 1

3

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
1
  • 1
    This was a life-saver! I figured out looking in the kernel's source code that the journal was what was preventing me from resizing an array. But after failing and removing the journal device, the consistency policy was still "journal" and "mdadm --grow" wouldn't let me change it. Doing it manually via sysfs worked. Thanks a ton! Commented Oct 3, 2023 at 1:37

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.