Description of problem: The /etc/cron.weekly/99-raid-check script does not check my md2 but does check md0 and md1. Version-Release number of selected component (if applicable): mdadm-2.6.9-3.el5.x86_64 How reproducible: Depends on I/O at the time the script runs. Steps to Reproduce: 1. Used dd command to write 1 GB of /dev/zero to a file: [root@dhcpxx-xx ~]# dd if=/dev/zero of=foobar count=1 bs=1073741824 2. While dd was writing, confirm /sys/block/mdX/md/array_state is 'active' [root@dhcpxx-xx ~]# cat /sys/block/md2/md/array_state active 3. Run the script 99-raid-check 4. Verify mdX was not checked. In my case mdX= md2 Sep 5 07:09:15 dhcpxx-xx kernel: md: syncing RAID array md0 Sep 5 07:09:38 dhcpxx-xx kernel: md: md0: sync done. Sep 5 07:10:51 dhcpxx-xx kernel: md: syncing RAID array md0 Sep 5 07:10:51 dhcpxx-xx kernel: md: delaying resync of md1 until md0 has finished resync (they share one or more physical units) Sep 5 07:12:04 dhcpxx-xx kernel: md: md0: sync done. Sep 5 07:12:04 dhcpxx-xx kernel: md: syncing RAID array md1 Actual results: The array busy with IO is not checked Expected results: All valid arrays are checked, irrespective of whether it is busy or not Additional info: When 99-raid-check runs there is a lot of write activity which keeps md2 in the 'active' state. The script checks for 'clean' so it skips md2 since it is 'active'. Suggested fix: array_state values of 'clean' or 'active' should be considered ok. Change this: if [ "$array_state" = clean -a "$sync_action" = idle ]; then to... if [ "$array_state" = clean -o "$array_state" = active ] && [ "$sync_action" = idle ]; then
DOH, I need to read bash scripts correctly, the Fedora script reads like this, ie. already does the right thing: if [ "$array_state" != "clean" -a "$array_state" != "active" ]; then continue fi sync_action=`cat /sys/block/$dev/md/sync_action` if [ "$sync_action" != idle ]; then continue fi Closing - NOTABUG
Please reopen for EL5, this is still a bug there (as you saw as you reported this against mdadm-2.6.9-3.el5), as pointed up on the linux-raid list yesterday (see http://marc.info/?l=linux-raid&m=134118030800900&w=2 )
There is already a bugzilla open against RHEL5 and the fix has pushed into the tree.
Ah OK, I guess I just couldn't find it.