1 # This file causes block devices with Linux RAID (mdadm) signatures to
2 # automatically cause mdadm to be run.
3 # See udev(8) for syntax
5 ACTION!="add|change", GOTO="md_end"
6 SUBSYSTEM!="block", GOTO="md_end"
7 ENV{rd_NO_MD}=="?*", GOTO="md_end"
8 KERNEL=="md*", ENV{ID_FS_TYPE}!="linux_raid_member", GOTO="md_end"
9 KERNEL=="md*", ACTION!="change", GOTO="md_end"
11 # Also don't process disks that are slated to be a multipath device
12 ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="md_end"
14 ENV{ID_FS_TYPE}=="ddf_raid_member|isw_raid_member|linux_raid_member", GOTO="md_try"
18 ENV{ID_FS_TYPE}=="isw_raid_member", ENV{rd_NO_MDIMSM}=="?*", GOTO="md_end"
19 ENV{ID_FS_TYPE}=="ddf_raid_member", ENV{rd_NO_MDDDF}=="?*", GOTO="md_end"
22 PROGRAM="/bin/sh -c 'for i in $sys/$devpath/holders/md[0-9_]*; do [ -e $$i ] && exit 0; done; exit 1;' ", \
25 # for native arrays - array's uuid has to be specified
26 # for containers - container's uuid has to be specified
27 # TODO : how to get embedded array's uuid having container's component ?
31 ENV{DEVTYPE}!="partition", \
32 RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}"
34 RUN+="/sbin/initqueue --timeout --name 50-mdraid_start --onetime --unique /sbin/mdraid_start"
37 # Incrementally build the md array; this will automatically assemble
38 # any eventual containers as well (imsm, ddf)
40 LABEL="md_incremental"
42 RUN+="/sbin/mdadm $env{rd_MD_OFFROOT} -I $env{DEVNAME}"