#1460 Issue closed: Raid1 container

Labels: enhancement, needs sponsorship, special hardware or VM, no-issue-activity

Kolesar opened issue at 2017-08-29 13:28:

I have RAID 1 on my environment and I detect one issue in script:
rear/usr/share/rear/layout/save/GNU/Linux/210_raid_layout.sh

Output of mdadm is:

mdadm --misc --detail /dev/md127
/dev/md127:
        Version : imsm
     Raid Level : container
  Total Devices : 2

Working Devices : 2


           UUID : fe5173d0:dfb8783b:b19d7a81:c0715868
  Member Arrays : /dev/md/raid01

    Number   Major   Minor   RaidDevice

       0       8       16        -        /dev/sdb
       1       8        0        -        /dev/sda

As you can see, here we do not have Raid Devices in output and 210_raid_layout.sh break in line 44
https://github.com/rear/rear/blob/2c12a52b3322f833c81cae2a8bc5baa799c3187d/usr/share/rear/layout/save/GNU/Linux/210_raid_layout.sh#L44
because variable ndevices is empty.

Easy workaround is adding one if statement before line 44, like:

            if [ -z "$ndevices" ] ; then
                ndevices=0
            fi

But, I guess that command for Raid Level: container should be different.

Note: Command for another block device is OK

mdadm --misc --detail /dev/md126
/dev/md126:
      Container : /dev/md/imsm0, member 0
     Raid Level : raid1
     Array Size : 976759808 (931.51 GiB 1000.20 GB)
  Used Dev Size : 976759940 (931.51 GiB 1000.20 GB)
   Raid Devices : 2
  Total Devices : 2

          State : active 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0


           UUID : 7e085b05:d8a58ee9:95b5187f:039d725c
    Number   Major   Minor   RaidDevice State
       1       8        0        0      active sync   /dev/sda
       0       8       16        1      active sync   /dev/sdb

jsmeix commented at 2017-08-30 11:02:

@Kolesar
I have no personal experience with RAID setup
so that I cannot really help here.

In general for issues where you already have a fix
I suggest that you submit a GitHub pull request
with your proposed fix, cf.
http://relax-and-recover.org/development/
and see in particular
https://github.com/rear/rear/wiki/Coding-Style

That code in 210_raid_layout.sh was mainly made in 2011 via
https://github.com/rear/rear/commit/8125ec3b0aef92dedfeb25e330644119fac40f64
at that time in 21_raid_layout.sh so that this code
might need some general adaptions to keep it up-to-date
plus enhancements for things like "Raid Level: container".

jsmeix commented at 2017-11-09 11:40:

See also
https://github.com/rear/rear/issues/1540#issuecomment-343129121

jsmeix commented at 2017-11-10 09:13:

@Kolesar
I assume you also have the special Intel Matrix RAID hardware, cf.
https://github.com/rear/rear/issues/1540#issuecomment-343418305

github-actions commented at 2020-07-01 01:33:

Stale issue message


[Export of Github issue for rear/rear.]