-
Notifications
You must be signed in to change notification settings - Fork 4
/
md-timeouts.rules.strategy2
54 lines (46 loc) · 2.18 KB
/
md-timeouts.rules.strategy2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright (C) 2017 by Jonathan G. Underwood
# This file is part of mdraid-safe-timeouts.
#
# mdraid-safe-timeouts is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# mdraid-safe-timeouts is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with mdraid-safe-timeouts. If not, see
# <http://www.gnu.org/licenses/>.
# This file causes block devices with Linux RAID (mdadm) signatures to
# attempt to set safe ERC/TLER/SCTERC timeouts for the drives involved,
# and the kernel controller.
# See udev(8) for syntax
# Don't process any events if anaconda is running as anaconda brings up
# raid devices manually
ENV{ANACONDA}=="?*", GOTO="md_timeouts_end"
SUBSYSTEM!="block|machinecheck", GOTO="md_timeouts_end"
# "noiswmd" on kernel command line stops mdadm from handling
# "isw" (aka IMSM - Intel RAID).
# "nodmraid" on kernel command line stops mdadm from handling
# "isw" or "ddf".
IMPORT{cmdline}="nodmraid"
ENV{nodmraid}=="?*", GOTO="md_timeouts_end"
IMPORT{cmdline}="noiswmd"
ENV{noiswmd}=="?*", GOTO="md_timeouts_end"
# Adjust timeouts. This is done by triggering a rule each time a
# partition device (eg. /dev/sda1) is added/changed. If that partition
# is a raid member, then the script that's called sets the parent disk's
# timeouts accordingly. Note that for a given disk, the script will be
# called once for each partition on the disk. The script looks at all
# known (at that point in time) partitions on the disks and sets
# timeouts appropriately.
IMPORT{program}="/sbin/mdadm --examine --export $devnode"
ENV{DEVTYPE}=="partition", ACTION=="add|change", \
ENV{ID_FS_TYPE}=="linux_raid_member", \
TEST=="/sys/block/$parent/device/timeout", \
TEST=="/usr/sbin/smartctl", \
RUN+="/etc/udev/rules.d/mdraid-set-timeouts-for-disk.sh $parent"
LABEL="md_timeouts_end"