Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 160227 - multipath/kpartx integration
Summary: multipath/kpartx integration
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: device-mapper-multipath
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ben Marzinski
QA Contact: Fedora Extras Quality Assurance
URL: https://www.redhat.com/archives/fedor...
Whiteboard:
: 167449 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-06-13 17:26 UTC by Axel Thimm
Modified: 2007-11-30 22:11 UTC (History)
11 users (show)

Fixed In Version: f7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-10-29 19:47:14 UTC


Attachments (Terms of Use)
call kpartx from rc.sysinit for dm-multipath devices (deleted)
2005-10-03 14:27 UTC, Alasdair Kergon
no flags Details | Diff
call kpartx from hotplug script for dm-multipath (deleted)
2005-10-03 14:28 UTC, Alasdair Kergon
no flags Details | Diff

Description Axel Thimm 2005-06-13 17:26:35 UTC
Description of problem:
The device-mapper-multipath package provides the tools to do multipath and lvm
partitions on device mapper generated devices, but they are not used during dm
and lvm setup.

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1.Plug multipath devices with lvm volumes
2.
3.
  
Actual results:
- multipaths are not grouped
- partitions on dm devices are not identified
- lvm volumes are not activated

Expected results:
System should modprobe for dm-multipath, and run kpartx on all dm devices before
lvm initialization.

Additional info:
See also post in the URL above.
The following can be used in /etc/rc.local as a workaround:

# multipath
modprobe dm-multipath
multipath
# dm partitions
for x in /dev/dm*; do
  kpartx -va $x
done
# lvm rescan
vgscan --mknodes
vgchange -aly

It would be nice to integrate this within initscripts.

Comment 1 Alasdair Kergon 2005-06-13 17:30:45 UTC
There is work in progress to integrate this into the initrd, to support a dm
multipath root device.

Comment 6 Alasdair Kergon 2005-10-03 14:25:50 UTC
Two proposed patches to initscripts for you to try out if you wish.

Comment 7 Alasdair Kergon 2005-10-03 14:27:35 UTC
Created attachment 119548 [details]
call kpartx from rc.sysinit for dm-multipath devices

Comment 8 Alasdair Kergon 2005-10-03 14:28:38 UTC
Created attachment 119549 [details]
call kpartx from hotplug script for dm-multipath

Comment 9 Bill Nottingham 2005-10-03 18:02:31 UTC
dev.d is deprecated in favor of direct udev rules, FWIW.

Comment 10 Bill Nottingham 2005-10-03 18:57:03 UTC
(That is, deprecated in the post-FC4 world.)

Comment 11 Bill Nottingham 2005-10-03 19:18:21 UTC
Added to initscripts CVS, will be in 8.17-1. Bouncing over to udev.

Comment 12 Christophe Varoqui 2005-10-03 19:35:35 UTC
FYI, upstream uses the following rules file :

1 #
2 # multipath and multipath partitions nodes are created in /dev/mapper/
3 # this file should be installed in /etc/udev/rules.d
4 #
5 # !! udev must not discard DM events !!
6 # !! check the other installed rules !!
7 #
8
9 # lookup the devmap name
10 #ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*", \
11 # PROGRAM="/sbin/devmap_name %M %m"
12 ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*", \
13 PROGRAM="/sbin/dmsetup -j %M -m %m --noopencount --noheadings -c -o name info"
14
15 # take care of devmap partitioning
16 ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*", \
17 RUN+="/sbin/kpartx -a /dev/mapper/%c"
18
19 # insert new paths in multipath topology
20 ACTION=="add", SUBSYSTEM=="block", KERNEL!="dm-*", \
21 RUN+="/sbin/multipath -v0 %r/%k"
22


Comment 13 Alasdair Kergon 2005-10-03 20:03:11 UTC
And that's not ideal for a distribution because it assumes you're using
multipath on your system.  Most people will have the package installed, but not
actually be using it, and the impact on their systems needs to be as close to
nothing as possible.

1) I only want to run kpartx against dm multipath devices not other types of
device-mapper devices: see the dmsetup options used in the script.

2) I don't want to run /sbin/multipath whenever a new device appears on the
system if I'm not using multipath.  And if I am, I just want to notify the
daemon using mpath_ctl, and let the daemon take care of things.


Comment 14 Alasdair Kergon 2005-10-03 20:05:12 UTC
For 2, this is the sort of thing that needs translating to udev:

if /sbin/pidof /sbin/multipathd > /dev/null 2>&1 ; then
        if [ "${DEVPATH:7:3}" = "dm-" ] ; then
                /sbin/mpath_ctl "${ACTION} map ${DEVPATH:7}" > /dev/null 2>&1
        else
                /sbin/mpath_ctl "${ACTION} path ${DEVPATH:7}" > /dev/null 2>&1
        fi
fi


Comment 15 Alasdair Kergon 2005-10-03 20:14:40 UTC
And 'multipath' ought to go away I think: the daemon should manage everything
internally - so state is only held in one place - taking messages and returning
status info via mpath_ctl.  

[More precisely, the 'multipath' command can stay but its functionality moves
into the daemon and merges with mpath_ctl: all it does is send/receive data
to/from the daemon.  The hard-coded '1000' limit on data transfer (with buffer
overflow if exceeded) in the daemon also needs fixing so it either works out the
buffer size it needs before filling it, or else it 'reallocs' the buffer if it
needs more space.]

Comment 20 Christian Iseli 2007-01-20 00:09:41 UTC
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.

Comment 21 Harald Hoyer 2007-09-20 11:52:28 UTC
reassigning to device-mapper-multipath, which can provide udev rules for that.

Comment 22 Ben Marzinski 2007-10-29 19:47:14 UTC
This all works for current releases


Note You need to log in before you can comment on or make changes to this bug.