RAID disks do not spin down

Hi there,

approx. after upgrade to 3.8.1/3.8.2 I noticed, that my mdraid disks never spins down. I did some research, but I’m not satisfied with it. Every 10 minutes kernel writes some sector on /dev/md0 and I do not know why.
So, this is what idle disk IO graph looks like:

So, i tried

echo 1 > /proc/sys/vm/block_dump

to debug block activity on disks, and what I found is:

2017-10-11T22:10:04+02:00 debug kernel[]: [14952.155530] md0_raid1(2126): WRITE block 8 on sda (1 sectors) 2017-10-11T22:10:04+02:00 debug kernel[]: [14952.161324] md0_raid1(2126): WRITE block 8 on sdb (1 sectors) 2017-10-11T22:10:05+02:00 debug kernel[]: [14953.242609] md0_raid1(2126): WRITE block 8 on sda (1 sectors) 2017-10-11T22:10:05+02:00 debug kernel[]: [14953.248419] md0_raid1(2126): WRITE block 8 on sdb (1 sectors)

And this happens every 10 minutes…

Of course, my RAID1 md0 consists of /dev/sda and /dev/sdb. Raid is in “clean” state and is under regular checking.

Is it some bug of new kernel or am I missing something?

[EDIT]
Additional research results:
I just manually span down disks to obtain some seconds to catch process with
watch -n1 -d "ps axu | awk '{if (\$8==\"D\") {print \$0}}'"
and result is similar each time:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 2102 0.0 0.0 0 0 ? D 10:09 0:00 [md0_raid1] root 27829 0.0 0.0 0 0 ? D 12:55 0:00 [kworker/0:0] root 29695 0.0 0.0 0 0 ? D 13:02 0:00 [kworker/0:2] root 31535 0.0 0.0 908 488 ? D 13:05 0:00 /sbin/uci commit dhcp

It seems that `/sbin/uci commit dhcp’ has something to do with that problem, because it has start time (13:05) whenever a disks spins up. (graph is older, so time do not correspond with times in graph)

1 Like

Just adding a notice. I see the same issue on my Turris Omnia with NAS box. Week or two ago (probably connected with 3.8 update), the HDDs stopped to spin down during inactivity. I can see the same every 10 minutes write activity on the md0 device.

Same here, my single NAS drive won’t spin down anymore.

You can find fix/workaround at Github: https://github.com/CZ-NIC/turris-os/issues/63
Thanks Turris staff for quick answer/solution.

Fix for this issue is in repo and will be part of 3.8.5 release

Workaround:
replace in file /etc/init.d/resolver
pid_num=$(pidof kresd) with pid_num=$(pidof kresd |awk '{print $1}' )