Questo contenuto non è disponibile nella lingua selezionata.
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 Copia collegamentoCollegamento copiato negli appunti!
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
multipathcommand. - 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 (/):
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 a timeout set with thefind_multipaths_timeoutparameter, 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
# multipath -w /dev/sdb wwid '3600d0230000000000e13954ed5f89300' removedCopy to Clipboard Copied! Toggle word wrap Toggle overflow Removing a multipath device by using the WWID of the device.
multipath -w 3600d0230000000000e13954ed5f89300
# multipath -w 3600d0230000000000e13954ed5f89300 wwid '3600d0230000000000e13954ed5f89300' removedCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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
# multipath -W
successfully reset wwids
6.2. Criteria for disabling multipathing on certain devices Copia collegamentoCollegamento copiato negli appunti!
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.
6.3. Disabling multipathing by WWID Copia collegamentoCollegamento copiato negli appunti!
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
# multipathd show paths raw format "%d %w" | grep sdb sdb 3600508b4001080520001e00011700000Copy to Clipboard Copied! Toggle word wrap Toggle overflow Disable devices in the
/etc/multipath.confconfiguration file 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 }blacklist { wwid 3600508b4001080520001e00011700000 }Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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/null
# multipath -t > /dev/nullCopy to Clipboard Copied! Toggle word wrap Toggle overflow To display the new configuration with the changes added, run:
multipath -t
# multipath -tCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:service multipathd reload
# service multipathd reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.4. Disabling multipathing by device name Copia collegamentoCollegamento copiato negli appunti!
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*
# udevadm info --query=all -n /dev/mapper/sd*Copy to Clipboard Copied! Toggle word wrap Toggle overflow Disable devices in the
/etc/multipath.confconfiguration file using thedevnodeentry.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]" }blacklist { devnode "^sd[a-z]" }Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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 SCSI, NVMe, or DASD, using the following
devnodeentry:blacklist { devnode "!^(sd[a-z]|dasd[a-z]|nvme[0-9])" }blacklist { devnode "!^(sd[a-z]|dasd[a-z]|nvme[0-9])" }Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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/null
# multipath -t > /dev/nullCopy to Clipboard Copied! Toggle word wrap Toggle overflow To display the new configuration with the changes added, run:
multipath -t
# multipath -tCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:service multipathd reload
# service multipathd reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.5. Disabling multipathing by device type Copia collegamentoCollegamento copiato negli appunti!
You can disable multipathing on devices by using the device section.
Procedure
Display device type:
multipathd show paths raw format "%d %s" | grep sdb
# multipathd show paths raw format "%d %s" | grep sdb sdb HP,HSV210Copy to Clipboard Copied! Toggle word wrap Toggle overflow Disable devices in the
/etc/multipath.confconfiguration file using thedevicesection.The following example disables multipathing on all IBM DS4200 and HP devices:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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/null
# multipath -t > /dev/nullCopy to Clipboard Copied! Toggle word wrap Toggle overflow To display the new configuration with the changes added, run:
multipath -t
# multipath -tCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:service multipathd reload
# service multipathd reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.6. Disabling multipathing by udev property Copia collegamentoCollegamento copiato negli appunti!
You can disable multipathing on devices by their udev property parameter.
Procedure
Display the
udevvariables for a device:udevadm info --query=all -n /dev/sdb
# udevadm info --query=all -n /dev/sdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow Disable devices in the
/etc/multipath.confconfiguration file 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" }blacklist { property "ID_ATA" }Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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/null
# multipath -t > /dev/nullCopy to Clipboard Copied! Toggle word wrap Toggle overflow To display the new configuration with the changes added, run:
multipath -t
# multipath -tCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:service multipathd reload
# service multipathd reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.7. Disabling multipathing by device protocol Copia collegamentoCollegamento copiato negli appunti!
You can disable multipathing on devices by using the device protocol.
Procedure
Optional: View the protocol that a path is using:
multipathd show paths raw format "%d %P" | grep sdb
# multipathd show paths raw format "%d %P" | grep sdb sdb scsi:fcpCopy to Clipboard Copied! Toggle word wrap Toggle overflow Disable devices in the
/etc/multipath.confconfiguration file 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" }blacklist { protocol "nvme" }Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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/null
# multipath -t > /dev/nullCopy to Clipboard Copied! Toggle word wrap Toggle overflow To display the new configuration with the changes added, run:
multipath -t
# multipath -tCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:service multipathd reload
# service multipathd reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.8. Adding exceptions for devices with disabled multipathing Copia collegamentoCollegamento copiato negli appunti!
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_exceptionssection of the/etc/multipath.confconfiguration file.When specifying devices in the
blacklist_exceptionssection of the configuration file, you must specify the exceptions using the same criteria as they were specified in theblacklistsection. For example, a WWID exception does not apply to devices disabled by adevnodeentry, even if the disabled device is associated with that WWID. Similarly,devnodeexceptions apply only todevnodeentries, anddeviceexceptions 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.conffile:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you could use an exclamation mark (
!) to invert theblacklistentry, which disables all devices except the specified WWID:blacklist { wwid "!3600d0230000000000e13955cc3757803" }blacklist { wwid "!3600d0230000000000e13955cc3757803" }Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 6.2. 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 could reasonably be multipathed, set this parameter to
(SCSI_IDENT_|ID_WWN)as in the following example:blacklist_exceptions { property "(SCSI_IDENT_|ID_WWN)" }blacklist_exceptions { property "(SCSI_IDENT_|ID_WWN)" }Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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/null
# multipath -t > /dev/nullCopy to Clipboard Copied! Toggle word wrap Toggle overflow To display the new configuration with the changes added, run:
multipath -t
# multipath -tCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Reload the
/etc/multipath.conffile and reconfigure themultipathddaemon for changes to take effect:service multipathd reload
# service multipathd reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow