dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/mdadm-raid-check-sysconfig

8fbece
#!/bin/bash
8fbece
#
8fbece
# Configuration file for /etc/cron.weekly/raid-check
8fbece
#
8fbece
# options:
8fbece
#	ENABLED - must be yes in order for the raid check to proceed
8fbece
#	CHECK - can be either check or repair depending on the type of
8fbece
#		operation the user desires.  A check operation will scan
8fbece
#		the drives looking for bad sectors and automatically
8fbece
#		repairing only bad sectors.  If it finds good sectors that
8fbece
#		contain bad data (meaning that the data in a sector does
8fbece
#		not agree with what the data from another disk indicates
8fbece
#		the data should be, for example the parity block + the other
8fbece
#		data blocks would cause us to think that this data block
8fbece
#		is incorrect), then it does nothing but increments the
8fbece
#		counter in the file /sys/block/$dev/md/mismatch_count.
8fbece
#		This allows the sysadmin to inspect the data in the sector
8fbece
#		and the data that would be produced by rebuilding the
8fbece
#		sector from redundant information and pick the correct
8fbece
#		data to keep.  The repair option does the same thing, but
8fbece
#		when it encounters a mismatch in the data, it automatically
8fbece
#		updates the data to be consistent.  However, since we really
8fbece
#		don't know whether it's the parity or the data block that's
8fbece
#		correct (or which data block in the case of raid1), it's
8fbece
#		luck of the draw whether or not the user gets the right
8fbece
#		data instead of the bad data.  This option is the default
8fbece
#		option for devices not listed in either CHECK_DEVS or
8fbece
#		REPAIR_DEVS.
8fbece
#	CHECK_DEVS - a space delimited list of devs that the user specifically
8fbece
#		wants to run a check operation on.
8fbece
#	REPAIR_DEVS - a space delimited list of devs that the user
8fbece
#		specifically wants to run a repair on.
8fbece
#	SKIP_DEVS - a space delimited list of devs that should be skipped
8fbece
#	NICE - Change the raid check CPU and IO priority in order to make
8fbece
#		the system more responsive during lengthy checks.  Valid
8fbece
#		values are high, normal, low, idle.
8fbece
#	MAXCONCURENT - Limit the number of devices to be checked at a time.
8fbece
#		By default all devices will be checked at the same time.
8fbece
#
8fbece
# Note: the raid-check script intentionaly runs last in the cron.weekly
8fbece
# sequence.  This is so we can wait for all the resync operations to complete
8fbece
# and then check the mismatch_count on each array without unduly delaying
8fbece
# other weekly cron jobs.  If any arrays have a non-0 mismatch_count after
8fbece
# the check completes, we echo a warning to stdout which will then me emailed
8fbece
# to the admin as long as mails from cron jobs have not been redirected to
8fbece
# /dev/null.  We do not wait for repair operations to complete as the
8fbece
# md stack will correct any mismatch_cnts automatically.
8fbece
#
8fbece
# Note2: you can not use symbolic names for the raid devices, such as you
8fbece
# /dev/md/root.  The names used in this file must match the names seen in
8fbece
# /proc/mdstat and in /sys/block.
8fbece
8fbece
ENABLED=yes
8fbece
CHECK=check
8fbece
NICE=low
8fbece
# To check devs /dev/md0 and /dev/md3, use "md0 md3"
8fbece
CHECK_DEVS=""
8fbece
REPAIR_DEVS=""
8fbece
SKIP_DEVS=""
8fbece
MAXCONCURRENT=