Package: multipath-tools
Version: 0.6.1-3

When using parted to create partitions, multipath partition device
files are created using kernel names rather than honoring the "-p
-part" option in the various udev rules. This issue exists in
multipath-tools/kpartx_0.6.1-3, but has been seen in earlier versions
of multipath-tools/kpartx as well.

Example:

Testing on an amd64 system running sid with
multipath-tools/kpartx_0.6.1-3 from experimental. We hav 8 FC LUNs
with 4 paths each. The kernel version is 4.6.0-1-amd64.

With the following /etc/multipath.conf file:

defaults {
        user_friendly_names "yes"
}

blacklist {
        device {
                vendor "HP"
                product "LOGICAL VOLUME"
}

Here are the devices used (the boot device is blacklisted):

# lsscsi
[0:0:0:0]    storage HP       P244br           2.52  -        
[0:1:0:0]    disk    HP       LOGICAL VOLUME   2.52  /dev/sda 
[1:0:0:0]    disk    3PARdata VV               3212  /dev/sdj 
[1:0:0:1]    disk    3PARdata VV               3212  /dev/sdl 
[1:0:0:2]    disk    3PARdata VV               3212  /dev/sdn 
[1:0:0:3]    disk    3PARdata VV               3212  /dev/sdq 
[1:0:0:4]    disk    3PARdata VV               3212  /dev/sdr 
[1:0:0:5]    disk    3PARdata VV               3212  /dev/sdt 
[1:0:0:6]    disk    3PARdata VV               3212  /dev/sdv 
[1:0:0:7]    disk    3PARdata VV               3212  /dev/sdx 
[1:0:0:254]  enclosu 3PARdata SES              3212  -        
[1:0:1:0]    disk    3PARdata VV               3212  /dev/sdz 
[1:0:1:1]    disk    3PARdata VV               3212  /dev/sdaa
[1:0:1:2]    disk    3PARdata VV               3212  /dev/sdab
[1:0:1:3]    disk    3PARdata VV               3212  /dev/sdac
[1:0:1:4]    disk    3PARdata VV               3212  /dev/sdad
[1:0:1:5]    disk    3PARdata VV               3212  /dev/sdae
[1:0:1:6]    disk    3PARdata VV               3212  /dev/sdaf
[1:0:1:7]    disk    3PARdata VV               3212  /dev/sdag
[1:0:1:254]  enclosu 3PARdata SES              3212  -        
[2:0:0:0]    disk    3PARdata VV               3212  /dev/sdb 
[2:0:0:1]    disk    3PARdata VV               3212  /dev/sdc 
[2:0:0:2]    disk    3PARdata VV               3212  /dev/sdd 
[2:0:0:3]    disk    3PARdata VV               3212  /dev/sde 
[2:0:0:4]    disk    3PARdata VV               3212  /dev/sdf 
[2:0:0:5]    disk    3PARdata VV               3212  /dev/sdg 
[2:0:0:6]    disk    3PARdata VV               3212  /dev/sdh 
[2:0:0:7]    disk    3PARdata VV               3212  /dev/sdi 
[2:0:0:254]  enclosu 3PARdata SES              3212  -        
[2:0:1:0]    disk    3PARdata VV               3212  /dev/sdk 
[2:0:1:1]    disk    3PARdata VV               3212  /dev/sdm 
[2:0:1:2]    disk    3PARdata VV               3212  /dev/sdo 
[2:0:1:3]    disk    3PARdata VV               3212  /dev/sdp 
[2:0:1:4]    disk    3PARdata VV               3212  /dev/sds 
[2:0:1:5]    disk    3PARdata VV               3212  /dev/sdu 
[2:0:1:6]    disk    3PARdata VV               3212  /dev/sdw 
[2:0:1:7]    disk    3PARdata VV               3212  /dev/sdy 
[2:0:1:254]  enclosu 3PARdata SES              3212  - 

And the following multipath -l output:

# multipath -l
mpathe (360002ac00000000000001908000028be) dm-4 3PARdata,VV
size=1.0G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=0 status=active
  |- 1:0:0:4 sdr  65:16  active undef running
  |- 1:0:1:4 sdad 65:208 active undef running
  |- 2:0:0:4 sdf  8:80   active undef running
  `- 2:0:1:4 sds  65:32  active undef running
mpathd (360002ac00000000000001907000028be) dm-3 3PARdata,VV
size=1.0G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=0 status=active
  |- 1:0:0:3 sdq  65:0   active undef running
  |- 1:0:1:3 sdac 65:192 active undef running
  |- 2:0:0:3 sde  8:64   active undef running
  `- 2:0:1:3 sdp  8:240  active undef running
mpathc (360002ac00000000000001906000028be) dm-2 3PARdata,VV
size=1.0G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=0 status=active
  |- 1:0:0:2 sdn  8:208  active undef running
  |- 1:0:1:2 sdab 65:176 active undef running
  |- 2:0:0:2 sdd  8:48   active undef running
  `- 2:0:1:2 sdo  8:224  active undef running
mpathb (360002ac00000000000001905000028be) dm-1 3PARdata,VV
size=1.0G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=0 status=active
  |- 1:0:0:1 sdl  8:176  active undef running
  |- 1:0:1:1 sdaa 65:160 active undef running
  |- 2:0:0:1 sdc  8:32   active undef running
  `- 2:0:1:1 sdm  8:192  active undef running
mpatha (360002ac00000000000001904000028be) dm-0 3PARdata,VV
size=1.0G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=0 status=active
  |- 1:0:0:0 sdj  8:144  active undef running
  |- 1:0:1:0 sdz  65:144 active undef running
  |- 2:0:0:0 sdb  8:16   active undef running
  `- 2:0:1:0 sdk  8:160  active undef running
mpathh (360002ac0000000000000190b000028be) dm-7 3PARdata,VV
size=1.0G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=0 status=active
  |- 1:0:0:7 sdx  65:112 active undef running
  |- 1:0:1:7 sdag 66:0   active undef running
  |- 2:0:0:7 sdi  8:128  active undef running
  `- 2:0:1:7 sdy  65:128 active undef running
mpathg (360002ac0000000000000190a000028be) dm-6 3PARdata,VV
size=1.0G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=0 status=active
  |- 1:0:0:6 sdv  65:80  active undef running
  |- 1:0:1:6 sdaf 65:240 active undef running
  |- 2:0:0:6 sdh  8:112  active undef running
  `- 2:0:1:6 sdw  65:96  active undef running
mpathf (360002ac00000000000001909000028be) dm-5 3PARdata,VV
size=1.0G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=0 status=active
  |- 1:0:0:5 sdt  65:48  active undef running
  |- 1:0:1:5 sdae 65:224 active undef running
  |- 2:0:0:5 sdg  8:96   active undef running
  `- 2:0:1:5 sdu  65:64  active undef running

With the following device files in /dev/mapper:

# ls -l /dev/mapper
total 0
crw------- 1 root root 10, 236 Jun 14 13:28 control
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpatha -> ../dm-0
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathb -> ../dm-1
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathc -> ../dm-2
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathd -> ../dm-3
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathe -> ../dm-4
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathf -> ../dm-5
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathg -> ../dm-6
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathh -> ../dm-7


We then run parted on /dev/mapper/mpatha and create a label and a partition:

# parted /dev/mapper/mpatha
GNU Parted 3.2
Using /dev/mapper/mpatha
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gptWarning: The existing disk label on /dev/mapper/mpatha will 
be destroyed and all
data on this disk will be lost. Do you want to continue?
Yes/No? yes
(parted) mkpart primary ext2 0 100%
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? i
(parted) quit
Information: You may need to update /etc/fstab.

Under /dev/mapper, we see:

# ls -l /dev/mapper
total 0
crw------- 1 root root 10, 236 Jun 14 13:28 control
lrwxrwxrwx 1 root root       7 Jun 14 13:57 mpatha -> ../dm-0
lrwxrwxrwx 1 root root       7 Jun 14 13:56 mpatha1 -> ../dm-8
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathb -> ../dm-1
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathc -> ../dm-2
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathd -> ../dm-3
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathe -> ../dm-4
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathf -> ../dm-5
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathg -> ../dm-6
lrwxrwxrwx 1 root root       7 Jun 14 13:53 mpathh -> ../dm-7

Note that we see /dev/mapper/mpatha1 instead of /dev/mapper/mpatha-part1.

Here is the udevadm monitor output during the partition creation:

KERNEL[1654.655670] change   /devices/virtual/block/dm-0 (block)
UDEV  [1654.674470] change   /devices/virtual/block/dm-0 (block)
KERNEL[1686.963300] add      /devices/virtual/bdi/254:8 (bdi)
KERNEL[1686.963443] add      /devices/virtual/block/dm-8 (block)
UDEV  [1686.963889] add      /devices/virtual/bdi/254:8 (bdi)
KERNEL[1686.963916] change   /devices/virtual/block/dm-8 (block)
UDEV  [1686.972372] add      /devices/virtual/block/dm-8 (block)
UDEV  [1686.999211] change   /devices/virtual/block/dm-8 (block)
KERNEL[1699.598572] change   /devices/virtual/block/dm-0 (block)
KERNEL[1699.616084] add      /devices/virtual/bdi/254:9 (bdi)
KERNEL[1699.616215] add      /devices/virtual/block/dm-9 (block)
KERNEL[1699.616533] remove   /devices/virtual/block/dm-9 (block)
UDEV  [1699.616728] add      /devices/virtual/bdi/254:9 (bdi)
UDEV  [1699.620321] add      /devices/virtual/block/dm-9 (block)
UDEV  [1699.620427] remove   /devices/virtual/block/dm-9 (block)
KERNEL[1699.640199] remove   /devices/virtual/bdi/254:9 (bdi)
UDEV  [1699.640289] remove   /devices/virtual/bdi/254:9 (bdi)
UDEV  [1699.664986] change   /devices/virtual/block/dm-0 (block)

This work properly when using fdisk:

fdisk  /dev/mapper/mpathb

Welcome to fdisk (util-linux 2.28).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (32768-2097151, default 32768):
Last sector, +sectors or +size{K,M,G,T,P} (32768-2097151, default 2097151):

Created a new partition 1 of type 'Linux' and of size 1008 MiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Invalid argument

The kernel still uses the old table. The new table will be used at the next
reboot or after you run partprobe(8) or kpartx(8).

# ls -l /dev/mapper
total 0
crw------- 1 root root 10, 236 Jun 14 13:28 control
lrwxrwxrwx 1 root root       7 Jun 14 14:00 mpatha -> ../dm-0
lrwxrwxrwx 1 root root       7 Jun 14 14:00 mpatha1 -> ../dm-8
lrwxrwxrwx 1 root root       7 Jun 14 14:01 mpathb -> ../dm-1
lrwxrwxrwx 1 root root       7 Jun 14 14:01 mpathb-part1 -> ../dm-9
lrwxrwxrwx 1 root root       7 Jun 14 14:00 mpathc -> ../dm-2
lrwxrwxrwx 1 root root       7 Jun 14 14:00 mpathd -> ../dm-3
lrwxrwxrwx 1 root root       7 Jun 14 14:00 mpathe -> ../dm-4
lrwxrwxrwx 1 root root       7 Jun 14 14:00 mpathf -> ../dm-5
lrwxrwxrwx 1 root root       7 Jun 14 14:00 mpathg -> ../dm-6
lrwxrwxrwx 1 root root       7 Jun 14 14:00 mpathh -> ../dm-7

KERNEL[1988.516908] change   /devices/virtual/block/dm-1 (block)
KERNEL[1988.547294] add      /devices/virtual/bdi/254:9 (bdi)
KERNEL[1988.547364] add      /devices/virtual/block/dm-9 (block)
KERNEL[1988.547807] change   /devices/virtual/block/dm-9 (block)
UDEV  [1988.547918] add      /devices/virtual/bdi/254:9 (bdi)
UDEV  [1988.548599] change   /devices/virtual/block/dm-1 (block)
UDEV  [1988.556555] add      /devices/virtual/block/dm-9 (block)
UDEV  [1988.572788] change   /devices/virtual/block/dm-9 (block)

We have the same issue regardless of the friendly_user_names setting.

Reply via email to