Skip to content

Commit

Permalink
feat(multipath): don't add rd.driver.pre= directives to cmdline
Browse files Browse the repository at this point in the history
For multipath to work correctly, the scsi_dh modules must be loaded
early after boot (before actually probing any SCSI disks, i.e. before
loading any SCSI host adapter drivers), and the dm-multipath module
must be loaded before calling multipath or multipathd. We used to achieve this
with "rd.driver.pre". This makes assumptions about the distribution's
kernel configuration, in particular that the mentioned modules
as well the scsi_mod, sd_mod, and sg modules are actually compiled as
modules rather than being built-in, and unnecessarily forces loading
of the SCSI modules on systems that have no SCSI hardware, or where
multipath is disabled via cmdline.

On modern Linux systems, we have generic and more transparent ways
to configure module loading. It can be achieved via systemd's
modules-load.d mechanism or [email protected], or kmod's
soft dependencies. Upstream multipath-tools 0.9.7 uses [email protected]
to load dm-multipath. On-demand loading of SCSI device handlers
can be done using modules-load.d, or a soft dependency like this:

softdep scsi_mod post: scsi_dh_alua scsi_dh_rdac scsi_dh_emc

Instead of hard-coding the early loading of these modules using
"rd.driver.pre", leave it up to the distribution to configure it
in a generic a way that's consistent with the configuration in the root FS.
  • Loading branch information
mwilck committed Nov 22, 2023
1 parent ba1db45 commit f8db531
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions modules.d/90multipath/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@ depends() {
return 0
}

# called by dracut
cmdline() {
for m in scsi_dh_alua scsi_dh_emc scsi_dh_rdac dm_multipath; do
if grep -m 1 -q "$m" /proc/modules; then
printf 'rd.driver.pre=%s ' "$m"
fi
done
}

# called by dracut
installkernel() {
local _arch=${DRACUT_ARCH:-$(uname -m)}
Expand Down

0 comments on commit f8db531

Please sign in to comment.