diff options
author | Peter Jones <pjones@redhat.com> | 2009-11-24 14:47:48 -0500 |
---|---|---|
committer | Peter Jones <pjones@redhat.com> | 2009-11-25 10:54:12 -0500 |
commit | b869710aff869d949a7d23be298aefbcbab82eb0 (patch) | |
tree | 31a2ec3ad6fe2d34743536dd331bc0c5c0bb31e7 /modules.d/90multipath | |
parent | 323428ced555c588b978b9a7bb8c9f8ef9641ec1 (diff) | |
download | dracut-b869710aff869d949a7d23be298aefbcbab82eb0.tar.gz dracut-b869710aff869d949a7d23be298aefbcbab82eb0.tar.bz2 dracut-b869710aff869d949a7d23be298aefbcbab82eb0.zip |
Bring up multipath devices that are configured in multipath.conf.
This brings up multipath devices which are configured in multipath.conf
as we find them.
Diffstat (limited to 'modules.d/90multipath')
-rw-r--r-- | modules.d/90multipath/14-multipath-scan.rules | 9 | ||||
-rwxr-xr-x | modules.d/90multipath/install | 3 | ||||
-rw-r--r-- | modules.d/90multipath/multipath-scan.sh | 16 |
3 files changed, 28 insertions, 0 deletions
diff --git a/modules.d/90multipath/14-multipath-scan.rules b/modules.d/90multipath/14-multipath-scan.rules new file mode 100644 index 00000000..b4acf57c --- /dev/null +++ b/modules.d/90multipath/14-multipath-scan.rules @@ -0,0 +1,9 @@ +# scan for multipath devices +SUBSYSTEM!="block", GOTO="end_mpath_scan" +KERNEL!="sd*", GOTO="end_mpath_scan" +PROGRAM=="/bin/sh -c 'for i in //holders/dm-[0-9]*; do [ -e $$i ] && exit 0; done; exit 1;' ", GOTO="end_mpath_scan" +RUN+="/sbin/modprobe dm-multipath" +RUN+="/bin/echo 'queuing multipath scan'" +RUN+="/sbin/initqueue --settled --onetime --unique --name=mpscan /sbin/multipath-scan" +RUN+="/bin/sh -c '>/tmp/.multipath-scan-%k;'" +LABEL="end_mpath_scan" diff --git a/modules.d/90multipath/install b/modules.d/90multipath/install index 375db6d5..26a3fdae 100755 --- a/modules.d/90multipath/install +++ b/modules.d/90multipath/install @@ -27,3 +27,6 @@ done inst_hook pre-trigger 02 "$moddir/multipathd.sh" inst_hook pre-pivot 02 "$moddir/multipathd-stop.sh" inst_rules 40-multipath.rules + +inst "$moddir/multipath-scan.sh" /sbin/multipath-scan +inst_rules "$moddir/14-multipath-scan.rules" diff --git a/modules.d/90multipath/multipath-scan.sh b/modules.d/90multipath/multipath-scan.sh new file mode 100644 index 00000000..0e1d3f24 --- /dev/null +++ b/modules.d/90multipath/multipath-scan.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# scan for multipaths if udev has settled + +. /lib/dracut-lib.sh + +[ -d /etc/multipath ] || mkdir -p /etc/multipath +mpdevs=$( + for f in /tmp/.multipath-scan-* ; do + [ -e "$f" ] || continue + echo -n "${f##/tmp/.multipath-scan-} " + done +) + +[ -e /etc/multipath.conf ] || exit 1 +multipath ${mpdevs} |