]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(multipath): disable user_friendly_names with mpathconf
authorBenjamin Marzinski <bmarzins@redhat.com>
Thu, 24 Apr 2025 21:51:01 +0000 (17:51 -0400)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Wed, 30 Apr 2025 15:58:57 +0000 (11:58 -0400)
If dracut is creating /etc/multipath.conf by calling mpathconf in either
multipathd-configure.service or multipathd.sh, there is a chance that
the multipath config in the real root differs. Specifically, it might
have chosen different user_friendly_names for the devices. When the
systems switches to the real root, multipath may not be able to switch
the devices to their configured names because those might already be
in use. To avoid this, call mpathconf with "--user_friendly_names n"
to create a multipath.conf with user_friendly_names disabled. If all
devices use WWID names, it is always possible for multipath to rename
them later.

Fixes b8a92b715 ("multipath: add automatic configuration for multipath")

modules.d/90multipath/multipathd-configure.service
modules.d/90multipath/multipathd.sh

index dba5a68579ad995b03dfe0e2fe9859468b3e99b7..92627a11ee7a7332228aab71faaa27f5b9f6eed2 100644 (file)
@@ -15,7 +15,7 @@ Type=oneshot
 RemainAfterExit=yes
 # mpathconf requires /etc/multipath to already exist
 ExecStartPre=-/usr/bin/mkdir -p /etc/multipath
-ExecStart=/usr/sbin/mpathconf --enable
+ExecStart=/usr/sbin/mpathconf --enable --user_friendly_names n
 
 [Install]
 WantedBy=sysinit.target
index 68bd038308fe7894e5f6c725bacf39e8a345244a..c745defb4edd68301176593ddcc2a4ddb5fdeaf7 100755 (executable)
@@ -5,7 +5,7 @@ command -v getarg > /dev/null || . /lib/dracut-lib.sh
 if [ "$(getarg rd.multipath)" = "default" ] && [ ! -e /etc/multipath.conf ]; then
     # mpathconf requires /etc/multipath to already exist
     mkdir -p /etc/multipath
-    mpathconf --enable
+    mpathconf --enable --user_friendly_names n
 fi
 
 if getargbool 1 rd.multipath && [ -e /etc/multipath.conf ]; then