Chapter 6. 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.
6.1. Conditions when DM Multipath creates a multipath device for a path
DM Multipath has a set of default rules to determine whether to create a multipath device for a path or whether to ignore the path. You can configure the behavior.
If the find_multipaths
configuration parameter is set to off
, multipath always tries to create a multipath device for every path that is not explicitly disabled. 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
multipath
command. - A path has the same WWID as a multipath device that was previously created even if that multipath device does not currently exist. Whenever a multipath device is created, multipath remembers the WWID of the device so that it automatically creates the device again as soon as it sees a path with that WWID. This allows you to have multipath automatically choose the correct paths to make into multipath devices, without having to disable multipathing on other devices.
If you have previously created a multipath device without using the find_multipaths
parameter and then you later set the parameter to on
, you might need to remove the WWIDs of any device you do not want created as a multipath device from the /etc/multipath/wwids
file. 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/wwids
file. smart
-
Multipath always accepts non-disabled devices in
udev
as soon as they appear. Ifmultipathd
does not create the device within a timeout set with thefind_multipaths_timeout
parameter, it will release 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 the find_multipaths
parameter is set to on
, disable multipathing only on the devices with multiple paths that you do not want to be multipathed. Because of this, it will generally not be necessary to disable multipathing on devices.
If you add a previously created multipath device to blacklist
, removing the WWID of that device from the /etc/multipath/wwids
file by using the -w
option can help avoid 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/sdb wwid '3600d0230000000000e13954ed5f89300' removed
Removing a multipath device by using the WWID of the device.
# multipath -w 3600d0230000000000e13954ed5f89300 wwid '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
Additional resources
-
multipath.conf(5)
man page
6.2. Criteria for disabling multipathing on certain devices
You can disable multipathing on devices by any of the following criteria:
- WWID
- device name
- device type
- property
- protocol
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.
By default, a variety of device types are disabled, even after you comment out the initial blacklist
section of the configuration file.
Additional resources
6.3. Disabling multipathing by WWID
You can disable multipathing on individual devices by their World-Wide Identification (WWID).
Procedure
Find WWID of a device:
# multipathd show paths raw format "%d %w" | grep sdb sdb 3600508b4001080520001e00011700000
Disable devices in the
/etc/multipath.conf
configuration file using thewwid
entry.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.conf
file after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/null
To display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conf
file and reconfigure themultipathd
daemon for changes to take effect:# service multipathd reload
6.4. Disabling multipathing by device name
You can disable multipathing on device types by device name, so that DM Multipath will not group them into a multipath device.
Procedure
Display device information:
# udevadm info --query=all -n /dev/mapper/sd*
Disable devices in the
/etc/multipath.conf
configuration file using thedevnode
entry.The following example shows the lines in the DM Multipath configuration file that disable all SCSI devices, because it disables all
sd*
devices as well:blacklist { devnode "^sd[a-z]" }
You can use a
devnode
entry to disable individual devices rather than all devices of a specific type. However, this is not recommended because unless it is statically mapped byudev
rules, there is no guarantee that a specific device will have the same name on reboot. For example, a device name could change from/dev/sda
to/dev/sdb
on reboot.By default, DM Multipath disables all devices that are not SCSI, NVMe, or DASD, using the following
devnode
entry: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.conf
file after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/null
To display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conf
file and reconfigure themultipathd
daemon for changes to take effect:# service multipathd reload
Additional resources
6.5. Disabling multipathing by device type
You can disable multipathing on devices by using the device section.
Procedure
Display device type:
# multipathd show paths raw format "%d %s" | grep sdb sdb HP,HSV210
Disable devices in the
/etc/multipath.conf
configuration file using thedevice
section.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.conf
file after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/null
To display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conf
file and reconfigure themultipathd
daemon for changes to take effect:# service multipathd reload
6.6. Disabling multipathing by udev property
You can disable multipathing on devices by their udev
property parameter.
Procedure
Display the
udev
variables for a device:# udevadm info --query=all -n /dev/sdb
Disable devices in the
/etc/multipath.conf
configuration file using theproperty
parameter. This parameter is a regular expression string that matches against theudev
environment variable name for the devices.The following example disables multipathing on all devices with the
udev
propertyID_ATA
:blacklist { property "ID_ATA" }
Validate the
/etc/multipath.conf
file after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/null
To display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conf
file and reconfigure themultipathd
daemon for changes to take effect:# service multipathd reload
6.7. Disabling multipathing by device protocol
You can disable multipathing on devices by using device protocol.
Procedure
Optional: View the protocol that a path is using:
# multipathd show paths raw format "%d %P" | grep sdb sdb scsi:fcp
Disable devices in the
/etc/multipath.conf
configuration file using theprotocol
parameter.The protocol parameter 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 following protocol strings:
-
scsi: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
-
undef
-
Validate the
/etc/multipath.conf
file after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/null
To display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conf
file and reconfigure themultipathd
daemon for changes to take effect:# service multipathd reload
6.8. Adding exceptions for devices with disabled multipathing
You can enable multipathing by adding exceptions on devices where multipathing is currently disabled.
Prerequisites
- Multipathing is disabled on certain devices.
Procedure
Enable multipathing on the devices using the
blacklist_exceptions
section of the/etc/multipath.conf
configuration file.When specifying devices in the
blacklist_exceptions
section of the configuration file, you must specify the exceptions using the same criteria as they were specified in theblacklist
section. For example, a WWID exception does not apply to devices disabled by adevnode
entry, even if the disabled device is associated with that WWID. Similarly,devnode
exceptions apply only todevnode
entries, anddevice
exceptions apply only to device entries.Example 6.1. An exception by WWID
If you have a large number of devices and want to multipath only one of them with the WWID of
3600d0230000000000e13955cc3757803
, instead of individually disabling each of the devices except the one you want, you could disable all of them, and then enable only the one you want by adding the following lines to the/etc/multipath.conf
file:blacklist { wwid ".*" } blacklist_exceptions { wwid "3600d0230000000000e13955cc3757803" }
Alternatively, you could use an exclamation mark (
!
) to invert theblacklist
entry, which disables all devices except the specified WWID:blacklist { wwid "!3600d0230000000000e13955cc3757803" }
Example 6.2. An exception by udev property
The
property
parameter works differently than the otherblacklist_exception
parameters. The value of theproperty
parameter must match the name of a variable in theudev
database. 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 could 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.conf
file after modifying the multipath configuration file by running one of the following commands:To display any configuration errors, run:
# multipath -t > /dev/null
To display the new configuration with the changes added, run:
# multipath -t
Reload the
/etc/multipath.conf
file and reconfigure themultipathd
daemon for changes to take effect:# service multipathd reload