RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1001096 - multipath devices are not created properly when user_friendly_names enabled
Summary: multipath devices are not created properly when user_friendly_names enabled
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: device-mapper-multipath
Version: 6.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ben Marzinski
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-26 13:42 UTC by Dominic Geevarghese
Modified: 2013-08-30 18:10 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-30 18:10:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dominic Geevarghese 2013-08-26 13:42:51 UTC
Description of problem:

When user_friendly_names are set in multipath.conf , devicenames are not properly created under /dev/mapper/* . However, everything seems working when user_friendly_names unset in config.

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

kernel-2.6.32-358.14.1.el6.x86_64
device-mapper-multipath-0.4.9-64.el6_4.1.x86_64
kpartx-0.4.9-64.el6_4.1.x86_64
device-mapper-1.02.77-9.el6.x86_64

How reproducible:

I could reproduce always in KVM based VM.

Steps to Reproduce:

1. Create partition on iSCSI disk ( used fdisk )

2. kpartx to create map under /dev/mapper/

# ls -l /dev/mapper/*
crw-rw----. 1 root root 10, 58 Aug 27 00:14 /dev/mapper/control
lrwxrwxrwx. 1 root root      7 Aug 27 00:15 /dev/mapper/mpatha -> ../dm-0

# kpartx -a -v /dev/mapper/mpatha 
add map mpatha1 (253:1): 0 1029138 linear /dev/mapper/mpatha 62

# ls -l /dev/mapper/*
crw-rw----. 1 root root 10, 58 Aug 27 00:14 /dev/mapper/control
lrwxrwxrwx. 1 root root      7 Aug 27 00:15 /dev/mapper/mpatha -> ../dm-0
lrwxrwxrwx. 1 root root      7 Aug 27 00:17 /dev/mapper/mpatha1 -> ../dm-1

3. Created one more partition. Still kpartx is creating device _without_  (p)artition notation.

# kpartx -a -v /dev/mapper/mpatha 
add map mpatha1 (253:1): 0 1029138 linear /dev/mapper/mpatha 62
add map mpatha2 (253:2): 0 1029200 linear /dev/mapper/mpatha 1029200

# ls -l /dev/mapper/*
crw-rw----. 1 root root 10, 58 Aug 27 00:14 /dev/mapper/control
lrwxrwxrwx. 1 root root      7 Aug 27 00:15 /dev/mapper/mpatha -> ../dm-0
lrwxrwxrwx. 1 root root      7 Aug 27 00:18 /dev/mapper/mpatha1 -> ../dm-1
lrwxrwxrwx. 1 root root      7 Aug 27 00:18 /dev/mapper/mpatha2 -> ../dm-2

4. Flushed the maps , recreated it by `multipath -v2` . New maps got (p)artition notation at the end of device.

# ls -l /dev/mapper/*
crw-rw----. 1 root root 10, 58 Aug 27 00:14 /dev/mapper/control
lrwxrwxrwx. 1 root root      7 Aug 27 00:18 /dev/mapper/mpatha -> ../dm-0
lrwxrwxrwx. 1 root root      7 Aug 27 00:18 /dev/mapper/mpathap1 -> ../dm-1
lrwxrwxrwx. 1 root root      7 Aug 27 00:18 /dev/mapper/mpathap2 -> ../dm-2

5. kpartx on third partition failed by following

# kpartx -a -v /dev/mapper/mpatha 
device-mapper: create ioctl on mpatha1 failed: Device or resource busy
create/reload failed on mpatha1
add map mpatha1 (0:0): 0 1029138 linear /dev/mapper/mpatha 62
device-mapper: create ioctl on mpatha2 failed: Device or resource busy
create/reload failed on mpatha2
add map mpatha2 (0:0): 0 1029200 linear /dev/mapper/mpatha 1029200
add map mpatha3 (253:3): 0 1029200 linear /dev/mapper/mpatha 2058400

6. What happened to the maps ? . Third device is created _without_ (p)artition notation at end.

# ls -l /dev/mapper/*
crw-rw----. 1 root root 10, 58 Aug 27 00:14 /dev/mapper/control
lrwxrwxrwx. 1 root root      7 Aug 27 00:18 /dev/mapper/mpatha -> ../dm-0
lrwxrwxrwx. 1 root root      7 Aug 27 00:19 /dev/mapper/mpatha3 -> ../dm-3
lrwxrwxrwx. 1 root root      7 Aug 27 00:18 /dev/mapper/mpathap1 -> ../dm-1
lrwxrwxrwx. 1 root root      7 Aug 27 00:18 /dev/mapper/mpathap2 -> ../dm-2

7. Set `user_friendly_names no` in config. I could see device created properly .


# ls -l /dev/mapper/*

lrwxrwxrwx. 1 root root   7 Aug 27 00:34 /dev/mapper/1IET\x20\x20\x20\x20\x2000010001 -> ../dm-0
crw-rw----. 1 root root 10, 58 Aug 27 00:14 /dev/mapper/control

# kpartx -a -v /dev/mapper/1IET\\x20\\x20\\x20\\x20\\x2000010001 

add map 1IET     00010001p1 (253:1): 0 1029138 linear /dev/mapper/1IET\x20\x20\x20\x20\x2000010001 62

# ls -l /dev/mapper/*

lrwxrwxrwx. 1 root root      7 Aug 27 00:34 /dev/mapper/1IET\x20\x20\x20\x20\x2000010001 -> ../dm-0
lrwxrwxrwx. 1 root root      7 Aug 27 00:35 /dev/mapper/1IET\x20\x20\x20\x20\x2000010001p1 -> ../dm-1
crw-rw----. 1 root root 10, 58 Aug 27 00:14 /dev/mapper/control


Actual results:

kpartx failed to create device name properly without multipath daemon reload or flush maps, recreate by multipath.

Expected results:

kpartx should create correct devices under /dev/mapper/ at first place.


Thanks,

Comment 2 Ben Marzinski 2013-08-30 18:10:21 UTC
By default kpartx doesn't add a 'p' unless the device name ends in a number.  In RHEL6, when multipath creates a device, kpartx is automatically run on the resulting device by udev, using the rules in /lib/udev/rules.d/40-multipath.rules with the following command:

RUN+="$env{MPATH_SBIN_PATH}/kpartx -a -p p $tempnode"

The "-p p" Forces the 'p' delimiter, regardless of whether or not the device ends in a number.  If you add that to you kpartx call, things will work the same as they do when the partition devices are automatically created by udev.


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