dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/mdadm.rules

373056
# This file causes block devices with Linux RAID (mdadm) signatures to
373056
# automatically cause mdadm to be run.
373056
# See udev(8) for syntax
373056
373056
# Don't process any events if anaconda is running as anaconda brings up
373056
# raid devices manually
373056
ENV{ANACONDA}=="?*", GOTO="md_end"
373056
373056
# Also don't process disks that are slated to be a multipath device
373056
ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="md_end"
373056
373056
# We process add events on block devices (since they are ready as soon as
373056
# they are added to the system), but we must process change events as well
373056
# on any dm devices (like LUKS partitions or LVM logical volumes) and on
373056
# md devices because both of these first get added, then get brought live
373056
# and trigger a change event.  The reason we don't process change events
373056
# on bare hard disks is because if you stop all arrays on a disk, then
373056
# run fdisk on the disk to change the partitions, when fdisk exits it
373056
# triggers a change event, and we want to wait until all the fdisks on
373056
# all member disks are done before we do anything.  Unfortunately, we have
373056
# no way of knowing that, so we just have to let those arrays be brought
373056
# up manually after fdisk has been run on all of the disks.
373056
373056
# First, process all add events (md and dm devices will not really do
373056
# anything here, just regular disks, and this also won't get any imsm
373056
# array members either)
373056
SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \
7bdf8f
	IMPORT{program}="/sbin/mdadm -I $env{DEVNAME} --export $devnode --offroot ${DEVLINKS}"
7bdf8f
SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \
7bdf8f
	ENV{MD_STARTED}=="*unsafe*", ENV{MD_FOREIGN}=="no", ENV{SYSTEMD_WANTS}+="mdadm-last-resort@$env{MD_DEVICE}.timer"
373056
373056
# Next, check to make sure the BIOS raid stuff wasn't turned off via cmdline
373056
IMPORT{cmdline}="noiswmd"
373056
IMPORT{cmdline}="nodmraid"
373056
ENV{noiswmd}=="?*", GOTO="md_imsm_inc_end"
373056
ENV{nodmraid}=="?*", GOTO="md_imsm_inc_end"
373056
SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="isw_raid_member", \
373056
	RUN+="/sbin/mdadm -I $env{DEVNAME}"
fc6001
LABEL="md_imsm_inc_end"
fc6001
373056
SUBSYSTEM=="block", ACTION=="remove", ENV{ID_PATH}=="?*", \
373056
	RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}"
373056
SUBSYSTEM=="block", ACTION=="remove", ENV{ID_PATH}!="?*", \
373056
	RUN+="/sbin/mdadm -If $name"
373056
373056
# Next make sure that this isn't a dm device we should skip for some reason
373056
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_change_end"
373056
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="dm_change_end"
373056
ENV{DM_SUSPENDED}=="1", GOTO="dm_change_end"
373056
KERNEL=="dm-*", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="linux_raid_member", \
373056
	ACTION=="change", RUN+="/sbin/mdadm -I $env{DEVNAME}"
373056
LABEL="dm_change_end"
373056
373056
# Finally catch any nested md raid arrays.  If we brought up an md raid
373056
# array that's part of another md raid array, it won't be ready to be used
373056
# until the change event that occurs when it becomes live
373056
KERNEL=="md*", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="linux_raid_member", \
373056
	ACTION=="change", RUN+="/sbin/mdadm -I $env{DEVNAME}"
373056
373056
LABEL="md_end"