Bug 160227 - multipath/kpartx integration
multipath/kpartx integration
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: device-mapper-multipath (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ben Marzinski
Fedora Extras Quality Assurance
https://www.redhat.com/archives/fedor...
:
: 167449 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-13 13:26 EDT by Axel Thimm
Modified: 2007-11-30 17:11 EST (History)
11 users (show)

See Also:
Fixed In Version: f7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-29 15:47:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Axel Thimm 2005-06-13 13:26:35 EDT
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 13:30:45 EDT
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 10:25:50 EDT
Two proposed patches to initscripts for you to try out if you wish.
Comment 7 Alasdair Kergon 2005-10-03 10:27:35 EDT
Created attachment 119548 [details]
call kpartx from rc.sysinit for dm-multipath devices
Comment 8 Alasdair Kergon 2005-10-03 10:28:38 EDT
Created attachment 119549 [details]
call kpartx from hotplug script for dm-multipath
Comment 9 Bill Nottingham 2005-10-03 14:02:31 EDT
dev.d is deprecated in favor of direct udev rules, FWIW.
Comment 10 Bill Nottingham 2005-10-03 14:57:03 EDT
(That is, deprecated in the post-FC4 world.)
Comment 11 Bill Nottingham 2005-10-03 15:18:21 EDT
Added to initscripts CVS, will be in 8.17-1. Bouncing over to udev.
Comment 12 Christophe Varoqui 2005-10-03 15:35:35 EDT
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 16:03:11 EDT
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 16:05:12 EDT
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 16:14:40 EDT
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-19 19:09:41 EST
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 07:52:28 EDT
reassigning to device-mapper-multipath, which can provide udev rules for that.
Comment 22 Ben Marzinski 2007-10-29 15:47:14 EDT
This all works for current releases

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