第 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.
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 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 (/):
# 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 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 wwid '3600d0230000000000e13954ed5f89300' removedRemoving 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