Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Disable/spread regular HDD integrity checks

Featured Replies

Hey, the last time my Helios4's PSU blew I suspect was due to a power overload, with the PSU not being able to deal with all 4 HDDs doing active work (this also killed one of the HDDs in my array). Based on the system log, it looked like the system was doing a regular integrity checks on all 4 HDDs at once (!).

 

I would like to either disable the integrity check altogether, or more ideally, spread it out. I have two RAID-1 arrays, and there is no reason for all four drives to be checked simultaneously. For example, I can check one of the arrays (two HDDs) and then once that is done, the second array (the other two HDDs) after.

 

Does anyone know where the code/script for the integrity check lives? The closest I found was /etc/cron.daily/mdadm which runs

mdadm --monitor --scan --oneshot

but from the manpage description it is unclear to me whether that is superficial check or that may actually invoke a deep and lengthy integrity check.

Hi Nathan,

This is something that indeed is done by mdadm configuration. You need to check /etc/cron.d/mdadm:

#
# cron.d/mdadm -- schedules periodic redundancy checks of MD devices
#
# Copyright © martin f. krafft <madduck@madduck.net>
# distributed under the terms of the Artistic Licence 2.0
#

# By default, run at 00:57 on every Sunday, but do nothing unless the day of
# the month is less than or equal to 7. Thus, only run on the first Sunday of
# each month. crontab(5) sucks, unfortunately, in this regard; therefore this
# hack (see #380425).
57 0 * * 0 root if [ -x /usr/share/mdadm/checkarray ] && [ $(date +\%d) -le 7 ]; then /usr/share/mdadm/checkarray --cron --all --idle --quiet; fi

You can either disable this cronjob by commenting out the actual cron entry, or by moving the file 'mdadm' out of the '/etc/cron.d' folder.

 

Easiest would be to write a script that will iterare all mdadm devices, start the redundancy check, wait for the check to complete. then move to the next mdadm device.

 

Something like:

#!/bin/bash

case "$( /usr/bin/id -u )" in
'0')
	;;
*)
	echo "Please run as root user."
	exit 1
	;;
esac

for MD in /dev/md[0-9]*
do
	SYNC_ACTION="/sys/block/${MD:?}/md/sync_action"
	( echo 'check' > "${SYNC_ACTION:?}" ) || exit 1

	while true
	do
		case "$( /usr/bin/cat "${SYNC_ACTION:?}" )" in
		'')
			exit
			;;
		'idle') 
			break
			;;
		esac
		sleep 10
	done
done

# EOF

 

Note that that code snippet was not tested, but should give you direction to your solution.

 

Hope that helps,

Groetjes,

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.