Chapter 5. Preventing devices from multipathing
You can configure DM Multipath to ignore selected devices when it configures multipath devices. DM Multipath does not group these ignored devices into a multipath device.
5.1. Conditions when DM Multipath creates a multipath device for a path Copy linkLink copied to clipboard!
DM Multipath uses the find_multipaths parameter and device discovery rules to automatically determine when to create multipath devices for detected storage paths.
DM Multipath has default rules to determine whether to create a multipath device for a path or ignore it. You can configure the behavior.
If find_multipaths is set to off, multipath always tries to create a multipath device for every non-disabled path. If the find_multipaths configuration parameter is set to on, then multipath creates a device, only if one of following conditions is met:
- There are at least two paths with the same World-Wide Identification (WWID) that are not disabled.
-
You manually force the creation of the device by specifying a device with the
multipathcommand. - A path has the same WWID as a previously created multipath device, even if that device no longer exists. Whenever a multipath device is created, multipath remembers its WWID. It then automatically recreates the device when it detects a path with that WWID. This lets multipath automatically choose the correct paths to make into multipath devices, without having to disable multipathing on other devices.
If you created a multipath device without using find_multipaths and later set it to on, remove unwanted device WWIDs from /etc/multipath/wwids. The following example shows a sample /etc/multipath/wwids file. The WWIDs are enclosed by slashes (/):
# Multipath wwids, Version : 1.0
# NOTE: This file is automatically maintained by multipath and multipathd.
# You should not need to edit this file in normal circumstances.
#
# Valid WWIDs:
/3600d0230000000000e13955cc3757802/
/3600d0230000000000e13955cc3757801/
/3600d0230000000000e13955cc3757800/
/3600d02300069c9ce09d41c31f29d4c00/
/SWINSYS SF2372 0E13955CC3757802/
/3600d0230000000000e13955cc3757803/
In addition to on and off, you can also set find_multipaths to the following values:
strict-
Multipath never accepts paths that have not previously been multipathed and are therefore not in the
/etc/multipath/wwidsfile. smart-
Multipath always accepts non-disabled devices in
udevas soon as they appear. Ifmultipathddoes not create the device within the timeout set in thefind_multipaths_timeoutparameter, it releases its claim on the device.
The built-in default value of find_multipaths is off. The default multipath.conf file created by mpathconf, however, will set the value of find_multipaths to on.
When find_multipaths is set to on, disable multipathing only on devices with multiple paths that you do not want multipathed. Because of this, it will generally not be necessary to disable multipathing on devices.
If you add a multipath device to blacklist, remove its WWID from the /etc/multipath/wwids file by using the -w option. This avoids issues with other programs. For example, to remove the device /dev/sdb with WWID 3600d0230000000000e13954ed5f89300 from the /etc/multipath/wwids file, you can use either of the following methods.
Removing a multipath device by using the device name.
# multipath -w /dev/sdbwwid '3600d0230000000000e13954ed5f89300' removedRemoving a multipath device by using the WWID of the device.
# multipath -w 3600d0230000000000e13954ed5f89300wwid '3600d0230000000000e13954ed5f89300' removed
You can also use the -W option to update the /etc/multipath/wwids file. This would reset the /etc/multipath/wwids file to only include the WWIDs of the current multipath devices. To reset the file, run the following:
# multipath -W
successfully reset wwids
5.2. Criteria for disabling multipathing on certain devices Copy linkLink copied to clipboard!
Device exclusion from multipathing uses criteria such as, WWID, device name, type, property, or protocol, evaluated in priority order with exception lists taking precedence.
You can disable multipathing on devices by any of the following criteria:
- WWID
- device name
- device type
- property
- protocol
By default, a variety of device types are disabled, even after you comment out the initial blacklist section of the configuration file.
For every device, DM Multipath evaluates these criteria in the following order:
-
property -
devnode -
device -
protocol -
wwid
If a device turns out to be disabled by any of the mentioned criteria, DM Multipath excludes it from handling by multipathd, and does not evaluate the later criteria. For each criteria, the exception list takes precedence over the list of disabled devices, if a device matches both.
5.3. Disabling multipathing by WWID Copy linkLink copied to clipboard!
Exclude specific devices from multipath by disabling them by using their WWID in the multipath.conf file. This is useful for local disks, single-path devices, or storage needing special handling outside the multipath framework.
Procedure
Find WWID of a device:
# multipathd show paths raw format "%d %w" | grep sdbsdb 3600508b4001080520001e00011700000Disable devices in the
/etc/multipath.confconfiguration file by using thewwidentry.The following example shows the lines in the DM Multipath configuration file that disable a device with a WWID of
3600508b4001080520001e00011700000:blacklist { wwid 3600508b4001080520001e00011700000 }Validate the
/etc/multipath.conffile after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/nullTo display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:# service multipathd reload
5.4. Disabling multipathing by device name Copy linkLink copied to clipboard!
Disable multipathing for specific devices by using their device names, such as /dev/sda in the multipath.conf file. This prevents DM Multipath from grouping local disks, USB devices, or other storage into multipath devices, keeping them as individual block devices.
Procedure
Display device information:
# udevadm info --query=all -n /dev/mapper/sd*Disable devices in the
/etc/multipath.confconfiguration file by using thedevnodeentry. The following example shows the lines in the DM Multipath configuration file that disable all SCSI devices, because it disables allsd*devices as well:blacklist { devnode "^sd[a-z]" }You can use a
devnodeentry to disable individual devices rather than all devices of a specific type. However, this is not recommended because unless it is statically mapped byudevrules, there is no guarantee that a specific device will have the same name on reboot. For example, a device name could change from/dev/sdato/dev/sdbon reboot.By default, DM Multipath disables all devices that are not the following:
- Small Computer System Interface (SCSI)
- Non-Volatile Memory Express (NVMe)
Direct Access Storage Device (DASD).
To disable, it uses the following
devnodeentry:blacklist { devnode "!^(sd[a-z]|dasd[a-z]|nvme[0-9])" }The devices that this entry disables do not generally support DM Multipath.
Validate the
/etc/multipath.conffile after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/nullTo display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:# service multipathd reload
5.5. Disabling multipathing by device type Copy linkLink copied to clipboard!
Exclude entire categories of devices from multipath by specifying vendor and product info in the device section of multipath.conf. This prevents DM Multipath from grouping devices of certain models or vendors, keeping them as individual block devices.
Procedure
Display device type:
# multipathd show paths raw format "%d %s" | grep sdbsdb HP,HSV210Disable devices in the
/etc/multipath.confconfiguration file by using thedevicesection.The following example disables multipathing on all IBM DS4200 and HP devices:
blacklist { device { vendor "IBM" product "3S42" #DS4200 Product 10 } device { vendor "HP" product ".*" } }Validate the
/etc/multipath.conffile after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/nullTo display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:# service multipathd reload
5.6. Disabling multipathing by udev property Copy linkLink copied to clipboard!
Exclude devices from multipath by using their udev properties in the multipath.conf file. This method allows flexible filtering based on system-detected attributes like hardware type or connection, giving precise control over which devices are excluded from multipathing.
Procedure
Display the
udevvariables for a device:# udevadm info --query=all -n /dev/sdbDisable devices in the
/etc/multipath.confconfiguration file by using thepropertyparameter. This parameter is a regular expression string that matches against theudevenvironment variable name for the devices.The following example disables multipathing on all devices with the
udevpropertyID_ATA:blacklist { property "ID_ATA" }Validate the
/etc/multipath.conffile after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/nullTo display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:# service multipathd reload
5.7. Disabling multipathing by device protocol Copy linkLink copied to clipboard!
Exclude devices from multipath based on their transport protocol by using the device protocol setting in multipath.conf. This is useful for preventing multipathing on local or specific protocols better managed outside the multipath framework.
Procedure
Optional: View the protocol that a path is using:
# multipathd show paths raw format "%d %P" | grep sdbsdb scsi:fcpDisable devices in the
/etc/multipath.confconfiguration file by using theprotocolparameter.The
protocolparameter takes a regular expression and blacklists all devices with matching protocol strings. For example, to disable multipathing on all nvme devices, use the following:blacklist { protocol "nvme" }DM Multipath recognizes the
protocolstrings such asscsi:fcp,scsi:spi,scsi:ssa,scsi:sbp,scsi:srp,scsi:iscsi,scsi:sas,scsi:adt,scsi:ata,scsi:unspec,ccw,cciss,nvme:pcie,nvme:rdma,nvme:fc,nvme:tcp,nvme:loop,nvme:apple-nvme,nvme:unspec, andundef.Validate the
/etc/multipath.conffile after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/nullTo display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:# service multipathd reload
5.8. Adding exceptions for devices with disabled multipathing Copy linkLink copied to clipboard!
Re-enable multipathing for specific devices by adding exceptions in multipath.conf. This is useful when broad exclusion rules are in place but certain devices still require multipathing. This allows precise control over which devices are managed by DM Multipath.
Prerequisites
- Multipathing is disabled on certain devices.
Procedure
Enable multipathing on the devices by using the
blacklist_exceptionssection of the/etc/multipath.confconfiguration file.When specifying devices in the
blacklist_exceptionssection, you must use the same criteria as theblacklistsection. For example, a WWID exception does not apply to devices disabled by adevnodeentry, even if associated with that WWID. Similarly,devnodeexceptions apply only todevnodeentries, anddeviceexceptions apply only to device entries.Following is an example for adding exceptions for devices with disabled multipathing
An exception by WWID
If you have many devices and want to multipath only one with WWID
3600d0230000000000e13955cc3757803, you can disable all devices, then add an exception. Add the following lines to the/etc/multipath.conffile:blacklist { wwid ".*" } blacklist_exceptions { wwid "3600d0230000000000e13955cc3757803" }Alternatively, you can use an exclamation mark (
!) to invert theblacklistentry, which disables all devices except the specified WWID:blacklist { wwid "!3600d0230000000000e13955cc3757803" }An exception by udev property
The
propertyparameter works differently than the otherblacklist_exceptionparameters. The value of thepropertyparameter must match the name of a variable in theudevdatabase. Otherwise, the device is disabled. Using this parameter, you can disable multipathing on certain SCSI devices, such as USB sticks and local hard drives.To enable multipathing only on SCSI devices that can reasonably be multipathed, set this parameter to
(SCSI_IDENT_|ID_WWN)as in the following example:blacklist_exceptions { property "(SCSI_IDENT_|ID_WWN)" }
Validate the
/etc/multipath.conffile after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/nullTo display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:# service multipathd reload