Multipath assigned user_friendly_names during initramfs

Bug #1561103 reported by bugproxy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
multipath-tools (Ubuntu)
Fix Released
High
Taco Screen team

Bug Description

== Comment: #0 - Mauricio Faria De Oliveira - 2016-03-23 10:40:56 ==
---Problem Description---
Multipath assigned user_friendly_names during initramfs

In the initramfs, there's one call to multipath which has no -B argument (local-premount).
It assigns new/different user_friendly_names to devices which might differ from that in the rootfs.
The names should not be assigned during initramfs time, and dealt w/ during rootfs time, then updated to initramfs accordingly.

--- Steps to Reproduce ---

Boot with break=pre-multipath,post-multipath:

Skip the 2 breakpoints in scripts/init-top/multipath.

    ...
    (initramfs) exit
    ...
    (initramfs) exit
    starting version 229
    ...

Skip the 1st breakpoint in scripts/local-top/multipath.

    (initramfs) exit
    Begin: Loading multipath modules ... Success: loaded module dm-multipath.
    Failure: failed to load module dm-emc.
    done.
    Begin: Starting multipathd ... Spawning shell within the initramfs
    ...

The multipath device names are not-user_friendly_names.

That is enabled, but there are no names defined in /etc/multipath/bindings,
so 'multipath -B' will not use user_friendly_names.

    (initramfs) multipath -l -v1
    36005076303ffd2a40000000000000349
    36005076303ffd2a40000000000000348
    36005076303ffd2a40000000000000347
    36005076303ffd2a40000000000000346

    (initramfs) grep user_friendly_names /etc/multipath.conf
        user_friendly_names yes

    (initramfs) cat /etc/multipath/bindings
    # Multipath bindings, Version : 1.0
    # NOTE: this file is automatically maintained by the multipath program.
    # You should not need to edit this file in normal circumstances.
    #
    # Format:
    # alias wwid
    #
    (initramfs)

Skip until the 1st breakpoint in /scripts/local-bottom/multipath:

    (initramfs) exit
    done.
    Begin: Running /scripts/local-premount ... Begin: Waiting for udev to settle (multipath) ... done.
    done.
    ...
    Begin: Running /scripts/local-bottom ... Spawning shell within the initramfs
    ...

And now we've got user_friendly_names:

    (initramfs) multipath -l -v1
    mpathd
    mpathc
    mpathb
    mpatha

That's because the multipath call in /scripts/local-premount/multipath has no -B option.

    (initramfs) grep multipath /scripts/local-premount/multipath
    if [ -x /sbin/multipath ]
        [ "$quiet" != "y" ] && log_begin_msg "Waiting for udev to settle (multipath)"
    multipath -r -v0

And it changed the contents of /etc/multipath/bindings,
which is not desired for the initramfs (may conflict w/ the rootfs's file).

    (initramfs) cat /etc/multipath/bindings
    # Multipath bindings, Version : 1.0
    # NOTE: this file is automatically maintained by the multipath program.
    # You should not need to edit this file in normal circumstances.
    #
    # Format:
    # alias wwid
    #
    mpatha 36005076303ffd2a40000000000000346
    mpathb 36005076303ffd2a40000000000000347
    mpathc 36005076303ffd2a40000000000000348
    mpathd 36005076303ffd2a40000000000000349
    (initramfs)

--- Solution verification ---

On another boot, appending -B on that multipath command, things work fine:

    (initramfs) sed -i '/multipath -r/ s/$/ -B/' /scripts/local-premount/multipath

    (initramfs) grep multipath /scripts/local-premount/multipath
    if [ -x /sbin/multipath ]
        [ "$quiet" != "y" ] && log_begin_msg "Waiting for udev to settle (multipath)"
    multipath -r -v0 -B

    (initramfs) exit # a few times until
    ...
    Begin: Running /scripts/local-bottom ... Spawning shell within the initramfs
    ...

    (initramfs) multipath -l -v1
    36005076303ffd2a40000000000000349
    36005076303ffd2a40000000000000348
    36005076303ffd2a40000000000000347
    36005076303ffd2a40000000000000346

    (initramfs) cat /etc/multipath/bindings
    # Multipath bindings, Version : 1.0
    # NOTE: this file is automatically maintained by the multipath program.
    # You should not need to edit this file in normal circumstances.
    #
    # Format:
    # alias wwid
    #
    (initramfs)

== Comment: #3 - Mauricio Faria De Oliveira - 2016-03-23 10:43:24 ==
Hi @taco-screen-team,

@mathieu-tl is the suggested contact for this bug (multipath bugs et al.)

Thanks

Revision history for this message
bugproxy (bugproxy) wrote : multipath-tools_multipath-B.debdiff

Default Comment by Bridge

tags: added: architecture-ppc64le bugnameltc-139569 severity-critical targetmilestone-inin1604
Changed in ubuntu:
assignee: nobody → Taco Screen team (taco-screen-team)
Kevin W. Rudd (kevinr)
affects: ubuntu → multipath-tools (Ubuntu)
Revision history for this message
bugproxy (bugproxy) wrote :

Default Comment by Bridge

Changed in multipath-tools (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

@taco-screen-team

I'd suggest for @cyphermox (formerly @mathieu-tl) to look at this one.

Thanks

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package multipath-tools - 0.5.0+git1.656f8865-5ubuntu2

---------------
multipath-tools (0.5.0+git1.656f8865-5ubuntu2) xenial; urgency=medium

  [ Mauricio Faria de Oliveira ]
  * Remove partition device nodes of individual paths (for LVM on multipath)
    on the new multipath-tools with udev property blacklisting (LP: #1540401)
    - debian/multipath-tools.dm-mpath-lvm.udev: replace 'multipath -c' with
      'multipath -u' which can read udev properties at PROGRAM-rule time
      (when udev properties are not yet written to the udev database).
    - debian/initramfs/init-top: start multipathd before udev (required by
      'multipath -u' in the udev rules)
    - debian/initramfs/local-top: remove snippet to start multipathd.
  * Remove debian/initramfs/local-top (redundant with other initramfs scripts):
    - init-top: start multipathd.
    - init-top: load modules (dm-multipath and SCSI device handlers); move the
      missing dm-emc there (now scsi-dh-emc; see BTS 567014).
    - local-premount: settle on udev events; and the extra call due to
      multipath discovery in udev rules is no longer required with multipathd
      in initramfs.
    - debian/rules: do not install local-top anymore.
  * debian/initramfs/local-premount: run multipath with -B so not to assign
    names nor change /etc/multipath/bindings during initramfs (LP: #1561103)
  * debian/patches/enable-find-multipaths.patch: re-enable find_multipaths
    by default -- see the removed 'add_find-multipaths.patch' (LP: #1463046)

 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 04 Apr 2016 22:36:48 -0400

Changed in multipath-tools (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.