When WWID does not end in digit, no `p` is added to the partition name of a multipath device in RHEL7

Solution Verified - Updated -

Issue

  • When WWID does not end in digit, no p is added to the partition name of a multipath device. However, when the WWID ends in digit, kpartx adds p to the partition name.
  • kpartx fails silently when adding partition to multipath device in RHEL7

For example :

# multipath -ll
0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0 dm-3 QEMU    ,QEMU HARDDISK    <--- WWID ending in digit
size=20G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
  `- 2:0:0:0 sda 8:0 active ready running


root@dhcp210-194 ~]# fdisk /dev/mapper/0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0 
Welcome to fdisk (util-linux 2.23.2).

                Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-41943039, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): 
Using default value 41943039
Partition 1 of type Linux and of size 20 GiB is set

Command (m for help): w
The partition table has been altered!


[root@dhcp210-194 ~]# kpartx -a -v /dev/mapper/0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0 
add map 0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0p1 (253:4): 0 41940992 linear /dev/mapper/0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0 2048

[root@dhcp210-194 ~]# ls -l /dev/mapper/0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0*
lrwxrwxrwx. 1 root root 7 Aug 30 04:45 /dev/mapper/0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0 -> ../dm-3
lrwxrwxrwx. 1 root root 7 Aug 30 04:45 /dev/mapper/0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0p1 -> ../dm-4  <-- `p` is added to represent partition

=======================================================================

    multipath {
        wwid            0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0
        alias           mpatha
    }


[root@dhcp210-194 ~]# multipath -ll
mpatha (0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0) dm-3 QEMU    ,QEMU HARDDISK   <-- WWID does not end with digit
size=20G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
  `- 2:0:0:0 sda 8:0 active ready running
[root@dhcp210-194 ~]# fdisk /dev/mapper/mpatha 

Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-41943039, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): 
Using default value 41943039
Partition 1 of type Linux and of size 20 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

[root@dhcp210-194 ~]# kpartx -a -v /dev/mapper/mpatha 
add map mpatha1 (253:4): 0 41940992 linear /dev/mapper/mpatha 2048

[root@dhcp210-194 ~]# ls -l /dev/mapper/mpatha*
lrwxrwxrwx. 1 root root 7 Aug 30 04:50 /dev/mapper/mpatha -> ../dm-3
lrwxrwxrwx. 1 root root 7 Aug 30 04:50 /dev/mapper/mpatha1 -> ../dm-4   <---------  no `p` is added

Environment

  • Red Hat Enterprise Linux (RHEL) 7
  • DM-Multipath
  • kpartx

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content