[Help] RAID devices order changed during online expansion

RAID, Volume, storage pool, hard drive, USB, SSD cache and iSCSI LUN
Post Reply
User avatar
Delleter
Posts: 5
Joined: 07 Jul 2025, 19:31
Russia

[Help] RAID devices order changed during online expansion

Post by Delleter »

Hello!
I have an F4-424 Pro (TOS6) with two 500 GB SSDs and four 1 TB HDDs. I created two volumes with TRAID type: the first one on SSDs, the second one on HDDs. So initially I had:

md0 - RAID1 sdza4 + sdzb4 → vg0-lv0
md1 - RAID5 sda4 + sdb4 + sdc4 + sdd4 → vg1-lv1
md8 - RAID1 (swap) sdza3 + sdzb3
md9 - RAID1 (system) sdza2 + sdzb2

Then I started to replace the HDDs one by one to extend the vg1-lv1 size (as described here: viewtopic.php?t=8036 — Online Array Expansion).
I shut down the NAS, replaced one HDD, booted, selected online raid capacity expansion, waited, etc.

After replacing the first HDD with a 6 TB one — all OK.
After the second — md1 recovered, and md2 (RAID1: sdc5 + sdd5) was created and added to vg1-lv1.
After the third — I expected md1 to recover again, and md2 to convert to RAID5 with sdb5 + sdc5 + sdd5.

But from that moment a strange thing happened — the MD devices changed order:

md0 - RAID5 sda4 + sdb4 + sdc4 + sdd4 → vg1-lv1
md1 - RAID5 sdb5 + sdc5 + sdd5 → vg1-lv1
md2 - RAID1 sdza4 + sdzb4 → vg0-lv0

And here is the current state:

Code: Select all

# cat /proc/mdstat
md2 : active raid1 sdzb4[0] sdza4[1]
      477855888 blocks super 1.2 [2/2] [UU]
      bitmap: 2/4 pages [8KB], 65536KB chunk

md1 : active raid5 sdc5[0] sdb5[2] sdd5[1]
      4883829012 blocks super 1.2 level 5, 4k chunk, algorithm 2 [3/3] [UUU]
        resync=DELAYED

md0 : active raid5 sda4[0] sdd4[3] sdc4[4] sdb4[5]
      2898410496 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [U_UU]
      [=====>...............]  recovery = 27.5% (266298900/966136832) finish=78.8min speed=147867K/sec
      bitmap: 2/8 pages [8KB], 65536KB chunk
...

# lsblk -f
NAME          FSTYPE            FSVER    LABEL                         UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1
├─sda2
├─sda3
└─sda4        linux_raid_member 1.2      DellsTNASpro:UTOSUSER-X86-S64 38c2cf39-99d9-f61c-02dc-822b469f1df3
  └─md0       LVM2_member       LVM2 001                               YuHMGq-AVoe-ajkK-h8pP-mSgb-22qi-Fadfc2
    └─vg1-lv1 btrfs                      TOS_VOL_20250805              16ca49ac-85be-475f-a256-70f6654c7a51      4.7T    35% /Volume2
                                                                                                                             /var/subvols/8vEbTxkKvwb
sdb
├─sdb1
├─sdb2
├─sdb3
├─sdb4        linux_raid_member 1.2      DellsTNASpro:UTOSUSER-X86-S64 38c2cf39-99d9-f61c-02dc-822b469f1df3
│ └─md0       LVM2_member       LVM2 001                               YuHMGq-AVoe-ajkK-h8pP-mSgb-22qi-Fadfc2
│   └─vg1-lv1 btrfs                      TOS_VOL_20250805              16ca49ac-85be-475f-a256-70f6654c7a51      4.7T    35% /Volume2
│                                                                                                                            /var/subvols/8vEbTxkKvwb
└─sdb5        linux_raid_member 1.2      DellsTNASpro:UTOSUSER-X86-S64 1acd9f64-5a36-edb0-22d8-382b3f3f9644
  └─md1       LVM2_member       LVM2 001                               pD6v30-kk9f-Qv7k-36IR-1tdu-knfj-7aoly2
    └─vg1-lv1 btrfs                      TOS_VOL_20250805              16ca49ac-85be-475f-a256-70f6654c7a51      4.7T    35% /Volume2
                                                                                                                             /var/subvols/8vEbTxkKvwb
sdc
├─sdc1
├─sdc2
├─sdc3
├─sdc4        linux_raid_member 1.2      DellsTNASpro:UTOSUSER-X86-S64 38c2cf39-99d9-f61c-02dc-822b469f1df3
│ └─md0       LVM2_member       LVM2 001                               YuHMGq-AVoe-ajkK-h8pP-mSgb-22qi-Fadfc2
│   └─vg1-lv1 btrfs                      TOS_VOL_20250805              16ca49ac-85be-475f-a256-70f6654c7a51      4.7T    35% /Volume2
│                                                                                                                            /var/subvols/8vEbTxkKvwb
└─sdc5        linux_raid_member 1.2      DellsTNASpro:UTOSUSER-X86-S64 1acd9f64-5a36-edb0-22d8-382b3f3f9644
  └─md1       LVM2_member       LVM2 001                               pD6v30-kk9f-Qv7k-36IR-1tdu-knfj-7aoly2
    └─vg1-lv1 btrfs                      TOS_VOL_20250805              16ca49ac-85be-475f-a256-70f6654c7a51      4.7T    35% /Volume2
                                                                                                                             /var/subvols/8vEbTxkKvwb
sdd
├─sdd1
├─sdd2
├─sdd3
├─sdd4        linux_raid_member 1.2      DellsTNASpro:UTOSUSER-X86-S64 38c2cf39-99d9-f61c-02dc-822b469f1df3
│ └─md0       LVM2_member       LVM2 001                               YuHMGq-AVoe-ajkK-h8pP-mSgb-22qi-Fadfc2
│   └─vg1-lv1 btrfs                      TOS_VOL_20250805              16ca49ac-85be-475f-a256-70f6654c7a51      4.7T    35% /Volume2
│                                                                                                                            /var/subvols/8vEbTxkKvwb
└─sdd5        linux_raid_member 1.2      DellsTNASpro:UTOSUSER-X86-S64 1acd9f64-5a36-edb0-22d8-382b3f3f9644
  └─md1       LVM2_member       LVM2 001                               pD6v30-kk9f-Qv7k-36IR-1tdu-knfj-7aoly2
    └─vg1-lv1 btrfs                      TOS_VOL_20250805              16ca49ac-85be-475f-a256-70f6654c7a51      4.7T    35% /Volume2
                                                                                                                             /var/subvols/8vEbTxkKvwb

sdzb
├─sdzb1       vfat              FAT32    UTOSDISK                      5395-0076
├─sdzb2       linux_raid_member 1.2      TNAS:UTOSCORE-X86-S64         b3764bc5-9273-a39e-4aac-545f4d945971
│ └─md9       ext4              1.0                                    780ba0e8-d1c3-4ae7-a765-bc9ef707dbee      5.1G    26% /
├─sdzb3       linux_raid_member 1.2      TNAS:UTOSSWAP-X86-S64         586a539e-2fd7-048b-661c-f37166d2f05a
│ └─md8       swap              1                                      4d9a1bd2-09fa-42f7-96f5-b2eb5fc09af4                  [SWAP]
└─sdzb4       linux_raid_member 1.2      DellsTNASpro:UTOSUSER-X86-S64 7c6186b8-28e3-5072-dd70-052dcda714ec
  └─md2       LVM2_member       LVM2 001                               5UHuUh-B1qg-Q0bY-pFKk-ORu3-kdKg-Q2NGaX
    └─vg0-lv0 btrfs                      TOS_VOL_20250805              12970f5d-15e8-40de-8376-e9283a275486    447.1G     1% /Volume1/homes/user/MOD_CONFIG
                                                                                                                             /home/user/MOD_CONFIG
                                                                                                                             /usr/local/@APP_CONFIG
                                                                                                                             /usr/local/@APP_CONFIG
                                                                                                                             /home
                                                                                                                             /Volume1
                                                                                                                             /var/subvols/8vEbTxkKvwa
sdza
├─sdza1       vfat              FAT32    UTOSDISK                      539B-EC3C
├─sdza2       linux_raid_member 1.2      TNAS:UTOSCORE-X86-S64         b3764bc5-9273-a39e-4aac-545f4d945971
│ └─md9       ext4              1.0                                    780ba0e8-d1c3-4ae7-a765-bc9ef707dbee      5.1G    26% /
├─sdza3       linux_raid_member 1.2      TNAS:UTOSSWAP-X86-S64         586a539e-2fd7-048b-661c-f37166d2f05a
│ └─md8       swap              1                                      4d9a1bd2-09fa-42f7-96f5-b2eb5fc09af4                  [SWAP]
└─sdza4       linux_raid_member 1.2      DellsTNASpro:UTOSUSER-X86-S64 7c6186b8-28e3-5072-dd70-052dcda714ec
  └─md2       LVM2_member       LVM2 001                               5UHuUh-B1qg-Q0bY-pFKk-ORu3-kdKg-Q2NGaX
    └─vg0-lv0 btrfs                      TOS_VOL_20250805              12970f5d-15e8-40de-8376-e9283a275486    447.1G     1% /Volume1/homes/user/MOD_CONFIG
                                                                                                                             /home/user/MOD_CONFIG
                                                                                                                             /usr/local/@APP_CONFIG
                                                                                                                             /usr/local/@APP_CONFIG
                                                                                                                             /home
                                                                                                                             /Volume1
                                                                                                                             /var/subvols/8vEbTxkKvwa
So I have a few questions:

1. Is it OK that the MD order changed?
On the forum I often see md0 tied to vg0-lv0, and md1 to vg1-lv1.
Could this reordering cause problems with system logic or updates?

2. If this is a problem — how do I fix the order?
I tried editing /etc/mdadm/mdadm.conf and /etc/mdadm.conf on another NAS (F4-212), but both files get overwritten after reboot.
So I guess some logic sets the order, but I don’t know where it lives or how to override it.

3. What will happen when I replace the fourth (last) HDD with an 8 TB one?
I expect a new md3 to appear and be added to vg1-lv1, but since md2 is already used for SSDs, could this cause conflicts?
Or will the system handle it correctly anyway?

Thanks in advance for any help or clarification!
User avatar
TMzethar
TM Support
Posts: 2819
Joined: 27 Oct 2020, 16:43

Re: [Help] RAID devices order changed during online expansion

Post by TMzethar »

Hi.
This is a normal situation. As HDD members change, there is a possibility that the md number may change.
The system will match vg and lv based on the md information it carries, so changes in the md number will have no impact. In simple terms, the system can correctly handle them.
To contact our team, please send email to following addresses, remember to replace (at) with @:
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
User avatar
Delleter
Posts: 5
Joined: 07 Jul 2025, 19:31
Russia

Re: [Help] RAID devices order changed during online expansion

Post by Delleter »

Thanks a lot, that’s very reassuring!
Just out of curiosity — is there any way to fix or pin specific md numbers, or is it generally not recommended?
User avatar
TMzethar
TM Support
Posts: 2819
Joined: 27 Oct 2020, 16:43

Re: [Help] RAID devices order changed during online expansion

Post by TMzethar »

The order number of md is usually fixed but not absolutely so. It is neither necessary nor recommended that you specific md numbers. It does not affect your usage, and modifying the md order number can be troublesome (for most people).
To contact our team, please send email to following addresses, remember to replace (at) with @:
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
User avatar
Delleter
Posts: 5
Joined: 07 Jul 2025, 19:31
Russia

Re: [Help] RAID devices order changed during online expansion

Post by Delleter »

I added the last HDD, selected online expansion, but it only resynchronized md0. It looks like now I will have to expand md1 manually, and also add md3 myself. Still, something is wrong...

Current state:

Code: Select all

# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md2 : active raid1 sdzb4[0] sdza4[1]
      477855888 blocks super 1.2 [2/2] [UU]
      bitmap: 2/4 pages [8KB], 65536KB chunk

md1 : active raid5 sdc5[0] sdb5[2] sdd5[1]
      9767658280 blocks super 1.2 level 5, 4k chunk, algorithm 2 [3/3] [UUU]
      bitmap: 0/37 pages [0KB], 65536KB chunk

md0 : active raid5 sda4[6] sdb4[5] sdd4[3] sdc4[4]
      2898410496 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
      bitmap: 0/8 pages [0KB], 65536KB chunk

md8 : active raid1 sdzb3[0] sdza3[1]
      1997824 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md9 : active raid1 sdzb2[2] sdza2[1]
      7995392 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

unused devices: <none>

# grep -i 'mdadm' /var/log/messages | grep -E 'assemble|md[0-9]'
Aug  8 01:40:37 DellsTNASpro MDADM-MONITOR: [NewArray]: raid /dev/md0 device create new array
Aug  8 01:40:37 DellsTNASpro mdadm[369]: NewArray event detected on md device /dev/md0
Aug  8 01:40:37 DellsTNASpro MDADM-MONITOR: [DegradedArray]: raid /dev/md0 device degraded
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG /usr/sbin/mdadm -A /dev/md0 /dev/sdb4 /dev/sdc4 /dev/sdd4 --force]
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG mdadm: /dev/md0 has been started with 3 drives (out of 4).
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG /usr/sbin/mdadm --re-add /dev/md0 /dev/sdb4]
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG /usr/sbin/mdadm --re-add /dev/md0 /dev/sdc4]
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG /usr/sbin/mdadm --re-add /dev/md0 /dev/sdd4]
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG /usr/sbin/mdadm -A /dev/md1 /dev/sdb5 /dev/sdc5 /dev/sdd5 --force]
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG mdadm: /dev/md1 has been started with 3 drives.
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG /usr/sbin/mdadm --re-add /dev/md1 /dev/sdb5]
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG /usr/sbin/mdadm --re-add /dev/md1 /dev/sdc5]
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG /usr/sbin/mdadm --re-add /dev/md1 /dev/sdd5]
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG /usr/sbin/mdadm -A /dev/md2 /dev/sdza4 /dev/sdzb4 --force]
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG mdadm: /dev/md2 has been started with 2 drives.
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG /usr/sbin/mdadm --re-add /dev/md2 /dev/sdza4]
Aug  8 01:40:37 DellsTNASpro mntdata[924]: [DEBUG /usr/sbin/mdadm --re-add /dev/md2 /dev/sdzb4]
Aug  8 01:40:37 DellsTNASpro MDADM-MONITOR: [hotspare]: raid md0 status [idle]
Aug  8 01:40:37 DellsTNASpro MDADM-MONITOR: [hotspare]: raid md0 avadisk []
Aug  8 01:40:37 DellsTNASpro mdadm[369]: DegradedArray event detected on md device /dev/md0
Aug  8 01:40:37 DellsTNASpro MDADM-MONITOR: [NewArray]: raid /dev/md2 device create new array
Aug  8 01:40:37 DellsTNASpro mdadm[369]: NewArray event detected on md device /dev/md2
Aug  8 01:40:37 DellsTNASpro MDADM-MONITOR: [NewArray]: raid /dev/md1 device create new array
Aug  8 01:40:37 DellsTNASpro mdadm[369]: NewArray event detected on md device /dev/md1
Aug  8 01:42:32 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm -D /dev/md0 | grep 'Check Status']
Aug  8 01:42:32 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm -D /dev/md1 | grep 'Check Status']
Aug  8 01:42:32 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm -D /dev/md2 | grep 'Check Status']
Aug  8 01:42:32 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md0 |grep UTOSFC-X86-S64]
Aug  8 01:42:32 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md1 |grep UTOSFC-X86-S64]
Aug  8 01:42:34 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md0 |grep UTOSFC-X86-S64]
Aug  8 01:42:34 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md1 |grep UTOSFC-X86-S64]
Aug  8 01:42:35 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md0 |grep UTOSFC-X86-S64]
Aug  8 01:42:35 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md1 |grep UTOSFC-X86-S64]
Aug  8 01:43:05 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm -D /dev/md2 | grep 'Check Status']
Aug  8 01:43:05 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm -D /dev/md0 | grep 'Check Status']
Aug  8 01:43:05 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm -D /dev/md1 | grep 'Check Status']
Aug  8 01:43:06 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md0 |grep UTOSFC-X86-S64]
Aug  8 01:43:06 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md1 |grep UTOSFC-X86-S64]
Aug  8 01:43:07 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md0 |grep UTOSFC-X86-S64]
Aug  8 01:43:07 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md1 |grep UTOSFC-X86-S64]
Aug  8 01:43:15 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md0 |grep UTOSFC-X86-S64]
Aug  8 01:43:15 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md1 |grep UTOSFC-X86-S64]
Aug  8 01:43:15 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm -DY /dev/md1 | grep 'MD_DEVICE_sd[a-z]\+4_DEV=/dev/sd[a-z]\+4']
Aug  8 01:43:36 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md0 |grep UTOSFC-X86-S64]
Aug  8 01:43:36 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm --detail --scan | grep /dev/md1 |grep UTOSFC-X86-S64]
Aug  8 01:43:41 DellsTNASpro MDADM-MONITOR: [RebuildStarted]: raid /dev/md0 device is rebuild
Aug  8 01:44:14 DellsTNASpro mdadm[369]: RebuildStarted event detected on md device /dev/md0
Aug  8 02:01:45 DellsTNASpro MDADM-MONITOR: [Rebuild20]: raid /dev/md0 device is Rebuild20
Aug  8 02:01:45 DellsTNASpro mdadm[369]: Rebuild20 event detected on md device /dev/md0
Aug  8 02:21:06 DellsTNASpro MDADM-MONITOR: [Rebuild40]: raid /dev/md0 device is Rebuild40
Aug  8 02:21:06 DellsTNASpro mdadm[369]: Rebuild40 event detected on md device /dev/md0
Aug  8 02:40:37 DellsTNASpro MDADM-MONITOR: [Rebuild60]: raid /dev/md0 device is Rebuild60
Aug  8 02:40:37 DellsTNASpro mdadm[369]: Rebuild60 event detected on md device /dev/md0
Aug  8 03:00:59 DellsTNASpro MDADM-MONITOR: [Rebuild80]: raid /dev/md0 device is Rebuild80
Aug  8 03:00:59 DellsTNASpro mdadm[369]: Rebuild80 event detected on md device /dev/md0
Aug  8 03:23:59 DellsTNASpro MDADM-MONITOR: [RebuildFinished]: raid /dev/md0 device is RebuildFinished
Aug  8 03:24:01 DellsTNASpro MDADM-MONITOR: [RebuildFinished]: raid /dev/md0 device rebuild finish
Aug  8 03:24:03 DellsTNASpro mdadm[369]: RebuildFinished event detected on md device /dev/md0
Aug  8 03:24:03 DellsTNASpro MDADM-MONITOR: [SpareActive]: raid /dev/md0 device spare active
Aug  8 03:24:03 DellsTNASpro mdadm[369]: SpareActive event detected on md device /dev/md0, component device /dev/sda4
Aug  8 09:47:19 DellsTNASpro TOSDaemon[4890]: [DEBUG /bin/bash -c mdadm -D /dev/md1 | grep 'Check Status']
Image

But sda5 now looks like this:

Code: Select all

# mdadm --examine /dev/sda5
/dev/sda5:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x9
     Array UUID : 1acd9f64:5a36edb0:22d8382b:3f3f9644
           Name : DellsTNASpro:UTOSUSER-X86-S64  (local to host DellsTNASpro)
  Creation Time : Wed Aug  6 00:14:06 2025
     Raid Level : raid5
   Raid Devices : 3

 Avail Dev Size : 9767658280 (4657.58 GiB 5001.04 GB)
     Array Size : 9767658280 (9315.16 GiB 10002.08 GB)
    Data Offset : 261888 sectors
   Super Offset : 8 sectors
   Unused Space : before=261808 sectors, after=0 sectors
          State : clean
    Device UUID : b1ef91fa:fc19f4d1:9379cf5f:d7adfe03

Internal Bitmap : 8 sectors from superblock
    Update Time : Fri Aug  8 01:40:31 2025
  Bad Block Log : 512 entries available at offset 32 sectors - bad blocks present.
       Checksum : 693537ab - correct
         Events : 0

         Layout : left-symmetric
     Chunk Size : 4K

   Device Role : spare
   Array State : AAA ('A' == active, '.' == missing, 'R' == replacing)
User avatar
TMzethar
TM Support
Posts: 2819
Joined: 27 Oct 2020, 16:43

Re: [Help] RAID devices order changed during online expansion

Post by TMzethar »

It might be due to an anomaly in the RAID of the fifth partition itself that the new sda5 failed to successfully join the RAID and instead became a spare.
We suggest you collect a system report and send it to the technical support email or share a link through a forum private message for us to analyze.
(TOS Desktop > Technical Support > Report Issues)
To contact our team, please send email to following addresses, remember to replace (at) with @:
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
User avatar
Delleter
Posts: 5
Joined: 07 Jul 2025, 19:31
Russia

Re: [Help] RAID devices order changed during online expansion

Post by Delleter »

The root cause was the disk’s condition. I did a full erase with Victoria, and then tried the online expansion again. This time it worked, but the recovery sequence started in the wrong order — it began with reshape on md1 instead of recovery on md0:

Code: Select all

# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md3 : active raid1 sdb6[1] sda6[0]
      1953372928 blocks super 1.2 [2/2] [UU]
        resync=DELAYED

md2 : active raid1 sdzb4[0] sdza4[1]
      477855888 blocks super 1.2 [2/2] [UU]

md1 : active raid5 sda5[3] sdc5[0] sdb5[2] sdd5[1]
      9767658280 blocks super 1.2 level 5, 4k chunk, algorithm 2 [4/4] [UUUU]
      [>....................]  reshape =  0.1% (9362664/4883829140) finish=1371.4min speed=59237K/sec
      bitmap: 0/37 pages [0KB], 65536KB chunk

md0 : active raid5 sda4[6] sdb4[5] sdd4[3] sdc4[4]
      2898410496 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [_UUU]
        resync=DELAYED

md8 : active raid1 sdzb3[0] sdza3[1]
      1997824 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md9 : active raid1 sdzb2[2] sdza2[1]
      7995392 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk
I first set idle in /sys/block/md1/md/sync_action, which caused resync to start on md3.
Then I set idle in /sys/block/md3/md/sync_action, but this made the reshape on md1 start again.
Finally, I set frozen for md1 and idle for md3, and only then the recovery on md0 started.
After that, I returned md1 to reshape so it could resume later. Current condition:

Code: Select all

# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md3 : active raid1 sdb6[1] sda6[0]
      1953372928 blocks super 1.2 [2/2] [UU]
        resync=DELAYED

md2 : active raid1 sdzb4[0] sdza4[1]
      477855888 blocks super 1.2 [2/2] [UU]

md1 : active raid5 sda5[3] sdc5[0] sdb5[2] sdd5[1]
      9767658280 blocks super 1.2 level 5, 4k chunk, algorithm 2 [4/4] [UUUU]
        resync=DELAYED
      bitmap: 0/37 pages [0KB], 65536KB chunk

md0 : active raid5 sda4[6] sdb4[5] sdd4[3] sdc4[4]
      2898410496 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [_UUU]
      [=>...................]  recovery =  9.2% (89637116/966136832) finish=76.9min speed=189857K/sec

md8 : active raid1 sdzb3[0] sdza3[1]
      1997824 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md9 : active raid1 sdzb2[2] sdza2[1]
      7995392 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

unused devices: <none>
Why did it start with a less critical reshape (or resync) instead of the higher priority recovery?
In dmesg I see this:

Code: Select all

[   12.352540] md: md0 stopped.
[   12.353920] md/raid:md0: device sdb4 operational as raid disk 1
[   12.353923] md/raid:md0: device sdd4 operational as raid disk 3
[   12.353924] md/raid:md0: device sdc4 operational as raid disk 2
[   12.354108] md/raid:md0: raid level 5 active with 3 out of 4 devices, algorithm 2
[   12.354127] md0: detected capacity change from 0 to 5796820992
[   12.556947] md: md1 stopped.
[   12.575631] md/raid:md1: device sdc5 operational as raid disk 0
[   12.575641] md/raid:md1: device sdb5 operational as raid disk 2
[   12.575644] md/raid:md1: device sdd5 operational as raid disk 1
[   12.575989] md/raid:md1: raid level 5 active with 3 out of 3 devices, algorithm 2
[   12.597051] md1: detected capacity change from 0 to 19535316560
[   12.631884] md: md2 stopped.
[   12.633245] md/raid1:md2: active with 2 out of 2 mirrors
[   12.633274] md2: detected capacity change from 0 to 955711776
[  347.931348] md: reshape of RAID array md1
[  350.075866] md: delaying recovery of md0 until md1 has finished (they share one or more physical units)
[  355.653091] md: delaying recovery of md0 until md1 has finished (they share one or more physical units)
[  454.782225] md/raid1:md3: not clean -- starting background reconstruction
[  454.782228] md/raid1:md3: active with 2 out of 2 mirrors
[  454.782239] md3: detected capacity change from 0 to 3906745856
[  454.782325] md: delaying resync of md3 until md1 has finished (they share one or more physical units)
[  454.782329] md: delaying recovery of md0 until md3 has finished (they share one or more physical units)
Post Reply

Return to “Storage”