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