#602 Issue closed: Failure saving layout for software raid config

Labels: enhancement, bug, needs sponsorship

tfgm-bud opened issue at 2015-06-15 21:55:

This is on CentOS release 6.6 with Relax-and-Recover 1.17.0

I'm getting an error while trying to do a "rear mkbackup" on a workstation with software raid:

2015-06-15 20:56:57 Saving Software RAID configuration.
/usr/share/rear/layout/save/GNU/Linux/21_raid_layout.sh: line 44: let: sparedevices=2-: syntax error: operand expected (error token is "-")
/usr/share/rear/layout/save/GNU/Linux/21_raid_layout.sh: line 65: [: : integer expression expected

It looks like it is failing while trying to grep the number of "Raid Devices" from a device that is a container (/dev/md0).

The devices:

[root@workstation ~]# mdadm --detail --scan --config=partitions
ARRAY /dev/md0 metadata=imsm UUID=b2ccf499:9a015432:31ba2a11:507ee499
ARRAY /dev/md/Volume0 container=/dev/md0 member=0 UUID=ae668881:42be3d3e:248e78cc:32e3be3f

Each individual device (note no "Raid Devices" line for /dev/md0):

[root@workstation ~]# mdadm --misc --detail /dev/md0
/dev/md0:
        Version : imsm
     Raid Level : container
  Total Devices : 2

Working Devices : 2


           UUID : b2ccf499:9a015432:31ba2a11:507ee499
  Member Arrays : /dev/md/Volume0

    Number   Major   Minor   RaidDevice

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

[root@workstation ~]# mdadm --misc --detail /dev/md/Volume0
/dev/md/Volume0:
      Container : /dev/md0, 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 : clean 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0


           UUID : ae668881:42be3d3e:248e78cc:32e3be3f
    Number   Major   Minor   RaidDevice State
       1       8        0        0      active sync   /dev/sda
       0       8       16        1      active sync   /dev/sdb

The layout file ends up looking like:

raid /dev/md0 metadata=imsm level=container raid-devices= uuid=b2ccf499:9a015432:31ba2a11:507ee499 devices=,
raid /dev/md126 metadata= level=raid1 raid-devices=2 uuid=ae668881:42be3d3e:248e78cc:32e3be3f name=Volume0 devices=,

Not sure what to do to fix the issue without breaking anything.

gdha commented at 2015-06-16 05:27:

@tfgm-bud Looks like the code in /usr/share/rear/layout/save/GNU/Linux/21_raid_layout.sh was build and tested on RHEL 4 and RHEL 5. RHEL 6 and the container (volume) concept seems not yet known.
Are you able to assist in getting the script in proper state?
Do not forget that the rebuild the software raid script will also be not complete for these concepts.

tfgm-bud commented at 2015-06-16 14:29:

I will help with it but going to need some direction. I'm new to rear, rusty on CentOS and inexperienced with software raid.

I guess the first thing to do is take a look at the rebuild the software raid script to figure out what it need to do.

gdha commented at 2015-10-29 11:00:

@tfgm-bud sorry, we cannot simulate your environment:

# mdadm --create --verbose /dev/md/imsm /dev/sd[b-c] --raid-devices 2 --metadata=imsm
mdmon: imsm: Cannot open /dev/sdb: Device or resource busy
mdadm: /dev/sdb is not suitable for this array.
mdmon: /dev/sdc is not attached to Intel(R) RAID controller.
mdadm: /dev/sdc is not suitable for this array.
mdadm: create aborted

Therefore, looking for sponsorship or ask for consultancy (onsite/remote)

tobiaspal commented at 2016-05-06 02:57:

@gdha: try running the mdadm command prefixed with IMSM_NO_PLATFORM=1. Can check the mdadm manual for details.

gdha commented at 2016-05-06 07:35:

@tobiaspal can you help with improving the code?

gdha commented at 2018-04-12 11:39:

As no-one seems interested in this topic we better close it until further notice.

tfgm-bud commented at 2018-04-12 18:02:

Yeah, the one system I had with software raid has been decommissioned so not a problem for me anymore. Thanks.


[Export of Github issue for rear/rear.]