Red Hat Bugzilla – Bug 1290494
Degraded RAID1 MD Array becomes inactive after rebooting the system.
Last modified: 2017-02-24 15:01:54 EST
Created attachment 1104411 [details] SOS report Description of problem: Degraded RAID-1 Array that was created using mdadm becomes inactive and its status is shown as raid0 after the system is rebooted. Version-Release number of selected component (if applicable): 3.3.2-7 How reproducible: Always Steps to Reproduce: 1. Create RAID-1 Array. mdadm -C /dev/md1 --metadata=1.2 -l1 -n2 /dev/sdb1 /dev/sdc1 2. Save the Configuration details. mdadm --examine --scan > /etc/mdadm.conf 3. Degrade the Array by unplugging one of the Drives of Array. 4. Status of the Array is shown as Degraded. mdadm -D /dev/md1 5. Reboot the system Actual results: The status of the Array should be shown as Degraded and active. Expected results: The status of the Array is shown as inactive and in raid0 mode. Additional info: After the system is rebooted, if the Array is stopped and re-assembled, then status is shown as degraded and active.
Correcting the Actual and Expected Results. * Expected results: The status of the Array should be shown as Degraded, Raid1 and active. * Actual results: The status of the Array is shown as inactive and in raid0 mode.
Following is my analysis # when one of the drive of RAID 1 array is unplugged the array is hooking "static int restart_array(struct mddev *mddev)" [driver/md/md.c] and sets "read-auto" mode in /sys/devices/virtual/block/md9/md/array_state # Seems we may need to "run" the array to make it active again [Optional] # one manual way I could see is after degrade before reboot run "mdadm - /dev/md9" and then reboot it works fine .But this cannot be a automatic solution # But since we are rebooting without the above step the state "/sys/devices/virtual/block/md9/md/array_state" remains "read-auto" # While the system reboots it marks this "inactive" and also doesnot print the valid values from the sys path # So During/At reboot time hooking the "run" is making it active "mdadm --R /dev/md9" I could see a dracut patch mdraid_start that makes mandatory "run" over all the array's https://github.com/zfsonlinux/dracut/blob/master/modules.d/90mdraid/mdraid_start.sh To my understanding defining a rule in Udev rules.d might help Working on to understand it further Thanks Lakshmi
Created attachment 1112184 [details] The patch file Hi Lakshmi There is already a patch for this. I tried it and it can fix the problem. The attachment is the patch. Thanks Xiao
Sure Xiao .Thanks for the update Regards Lakshmi
(In reply to Lakshmi_Narayanan_Du from comment #6) > Following is my analysis > > # when one of the drive of RAID 1 array is unplugged the array is > hooking "static int restart_array(struct mddev *mddev)" [driver/md/md.c] > and sets "read-auto" mode in > /sys/devices/virtual/block/md9/md/array_state > > # Seems we may need to "run" the array to make it active again > > [Optional] > # one manual way I could see is after degrade before reboot run "mdadm - > /dev/md9" and then reboot it works fine .But this cannot be a automatic > solution > > # But since we are rebooting without the above step the state > "/sys/devices/virtual/block/md9/md/array_state" > remains "read-auto" > > # While the system reboots it marks this "inactive" and also doesnot print > the valid values from the sys path > > # So During/At reboot time hooking the "run" is making it active > > "mdadm --R /dev/md9" > > > I could see a dracut patch mdraid_start that makes mandatory "run" over all > the array's > > https://github.com/zfsonlinux/dracut/blob/master/modules.d/90mdraid/ > mdraid_start.sh Huh? Why are you using the "zfsonlinux" github clone? > > To my understanding defining a rule in Udev rules.d might help > > Working on to understand it further > > Thanks > Lakshmi Might be better in the md-shutdown script: <https://github.com/dracutdevs/dracut/blob/master/modules.d/90mdraid/md-shutdown.sh>
(In reply to Harald Hoyer from comment #10) > (In reply to Lakshmi_Narayanan_Du from comment #6) > > Following is my analysis > > > > # when one of the drive of RAID 1 array is unplugged the array is > > hooking "static int restart_array(struct mddev *mddev)" [driver/md/md.c] > > and sets "read-auto" mode in > > /sys/devices/virtual/block/md9/md/array_state > > > > # Seems we may need to "run" the array to make it active again > > > > [Optional] > > # one manual way I could see is after degrade before reboot run "mdadm - > > /dev/md9" and then reboot it works fine .But this cannot be a automatic > > solution > > > > # But since we are rebooting without the above step the state > > "/sys/devices/virtual/block/md9/md/array_state" > > remains "read-auto" > > > > # While the system reboots it marks this "inactive" and also doesnot print > > the valid values from the sys path > > > > # So During/At reboot time hooking the "run" is making it active > > > > "mdadm --R /dev/md9" > > > > > > I could see a dracut patch mdraid_start that makes mandatory "run" over all > > the array's > > > > https://github.com/zfsonlinux/dracut/blob/master/modules.d/90mdraid/ > > mdraid_start.sh > > Huh? Why are you using the "zfsonlinux" github clone? > > > > > To my understanding defining a rule in Udev rules.d might help > > > > Working on to understand it further > > > > Thanks > > Lakshmi > > Might be better in the md-shutdown script: > <https://github.com/dracutdevs/dracut/blob/master/modules.d/90mdraid/md- > shutdown.sh> Although this is probably only interesting for the root on MD case.
Verified the issue in RHEL 7.3 Alpha1 Build. It's resolved.
Hi nikhil, what information do you need ?
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2182.html