3

I have an mdadm array which has constant disk i/o. I know it's the array bc my server shows which specific drives have activity. According to iotop there's a constant disk write of 3-6 Mbps, however, there are no corresponding processes in the list.

What could be causing this? It's already been built, so it's not from calculating parity or anything.

austin1howard
  • 133
  • 1
  • 5

2 Answers2

3

It's likely your RAID set is being checked. Some distros initiate an automatic background check of the RAID set from cron. On Debian-based systems, check out /etc/cron.daily/mdadm and /etc/cron.d/mdadm; there might be similar files on other distros.

You can see if a background check is running by looking in /sys/block/mdX/md/sync_action, as follows:

[root@localhost ~]# grep . /sys/block/*/md/sync_action
/sys/block/md0/md/sync_action:idle
/sys/block/md1/md/sync_action:idle
Paul Gear
  • 4,367
  • 19
  • 38
  • 1
    I think that was it. There's a cronjob to do the check. It was strange because that process wasn't showing up in `iotop`, but maybe it runs in such a way as to be invisible there. – austin1howard Jan 27 '14 at 08:04
  • 2
    md checks run as part of the kernel driver, and so aren't visible in the process table. I'll edit the answer to show an example. – Paul Gear Jan 27 '14 at 09:08
2

Have you created an ext3 or ext4 filesystem on this raid array ?

That disk activity was probably related to LazyInit :

mkfs.ext3 man page lazy init section :

lazy_itable_init[= <0 to disable, 1 to enable>]

If enabled and the uninit_bg feature is enabled, the inode table will not be fully initialized by mke2fs. This speeds up filesystem initialization noticeably, but it requires the kernel to finish initializing the filesystem in the background when the filesystem is first mounted. If the option value is omitted, it defaults to 1 to enable lazy inode table zeroing.

more informations :

https://forums.linuxmint.com/viewtopic.php?t=212707

and

https://www.thomas-krenn.com/en/wiki/Ext4_Filesystem#Lazy_Initialization

and

ubuntuforums.org/showthread.php?t=2306568&p=13409940#post13409940

alemansec
  • 31
  • 2
  • You realize the question is 3 years old and is already solved? Apart from that, your suggestion would only explain a one time event, not a constant problem. – Gerald Schneider Jul 24 '17 at 08:56
  • You did not read my post or did not understand it : Lazy init is constant for a limited period of time (until it actually completes). Regarding OP date - this page is easily reached from simple search engine queries, hence my comment here. – alemansec Jul 27 '17 at 05:54
  • another link explaining the feature behind this : https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bfff68738f1cb5c93dab1114634cea02aae9e7ba – alemansec Jul 27 '17 at 06:14
  • For example, on a 4.9.0 kernel, on a "dekstop oriented" machine (intel core i7 16BGB ram, 3 brand new TOSHIBA DT01ACA1 A750 harddrives (1TB 32MB cache 7200rpm), after creating a 3x1TB RAID-0 array, disk activity created by ext4 lazy initialization is visible for more than 5 hours. On such a (recent) kernel, you'll actually "see" the ext4lazyinit kernel thread running. – alemansec Jul 27 '17 at 18:46
  • In my case, your answer helped me solve my problem. Thanks ! – Damien May 21 '20 at 11:04