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