16.8 Blacklisting Non-Multipath Devices

The /etc/multipath.conf file can contain a blacklist section where all non-multipath devices are listed. You can blacklist devices by WWID (wwid keyword), device name (devnode keyword), or device type (device section). You can also use the blacklist_exceptions section to enable multipath for some devices that are blacklisted by the regular expressions used in the blacklist section.

NOTE: Preferred Blacklisting Methods

The preferred method for blacklisting devices is by WWID or by vendor and product. Blacklisting by devnode is not recommended, because device nodes can change and thus are not useful for persistent device identification.

WARNING: Regular Expressions in multipath.conf

Regular expressions in the /etc/multipath.conf do not work in general. They only work if they are matched against common strings. However, the standard configuration of multipath already contains regular expressions for many devices and vendors. Matching regular expressions with other regular expressions does not work. Make sure that you are only matching against strings shown with multipath -t.

You can typically ignore non-multipathed devices, such as hpsa, fd, hd, md, dm, sr, scd, st, ram, raw, and loop. For example, local SATA hard disks and flash disks do not have multiple paths. If you want multipath to ignore single-path devices, put them in the blacklist section.

NOTE: Compatibility

The keyword devnode_blacklist has been deprecated and replaced with the keyword blacklist.

With SUSE Linux Enterprise Server 12 the glibc-provided regular expressions are used. To match an arbitrary string, you must now use ".*" rather than "*".

For example, to blacklist local devices and all arrays from the hpsa driver from being managed by multipath, the blacklist section looks like this:

blacklist {
      wwid "26353900f02796769"
      devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
      devnode "^sd[a-z][0-9]*"
}

You can also blacklist only the partitions from a driver instead of the entire array. For example, you can use the following regular expression to blacklist only partitions from the cciss driver and not the entire array:

blacklist {
      devnode "^cciss!c[0-9]d[0-9]*[p[0-9]*]"
}

You can blacklist by specific device types by adding a device section in the blacklist, and using the vendor and product keywords.

blacklist {
      device {
           vendor  "DELL"
           product ".*"
       }
}

You can use a blacklist_exceptions section to enable multipath for some devices that were blacklisted by the regular expressions used in the blacklist section. You add exceptions by WWID (wwid keyword), device name (devnode keyword), or device type (device section). You must specify the exceptions in the same way that you blacklisted the corresponding devices. That is, wwid exceptions apply to a wwid blacklist, devnode exceptions apply to a devnode blacklist, and device type exceptions apply to a device type blacklist.

For example, you can enable multipath for a desired device type when you have different device types from the same vendor. Blacklist all of the vendor’s device types in the blacklist section, and then enable multipath for the desired device type by adding a device section in a blacklist_exceptions section.

blacklist {
      devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st|sda)[0-9]*"
      device {
           vendor  "DELL"
           product ".*"
       }
}

blacklist_exceptions {
      device {
           vendor  "DELL"
           product "MD3220i"
       }
}

You can also use the blacklist_exceptions to enable multipath only for specific devices. For example:

blacklist {
      wwid ".*"
}

blacklist_exceptions {
        wwid "3600d0230000000000e13955cc3751234"
        wwid "3600d0230000000000e13955cc3751235"
}

After you have modified the /etc/multipath.conf file, you must run dracut -f to re-create the initrd on your system, then restart the server for the changes to take effect. See Section 16.6.4, Applying the /etc/multipath.conf File Changes to Update the Multipath Maps for details.

Following the reboot, the local devices should no longer be listed in the multipath maps when you issue the multipath -ll command.

NOTE: Using the find_multipaths Option

Starting with SUSE Linux Enterprise Server 12 SP2, the multipath tools support the option find_multipaths in the defaults section of /etc/multipath.conf. Simply put, this option prevents multipath and multipathd from setting up multipath maps for devices with only a single path (see the man 5 multipath.conf for details). In certain configurations, this may save the administrator from the effort of creating blacklist entries, for example for local SATA disks.

Convenient as it seems at first, using the find_multipaths option also has disadvantages. It complicates and slows down the system boot, because for every device found, the boot logic needs to wait until all devices have been discovered to see whether a second path exists for the device. Additionally, problems can arise when some paths are down or otherwise invisible at boot time—a device can be falsely detected as a single-path device and activated, causing later addition of more paths to fail.

find_multipaths considers all devices that are listed in /etc/multipath/wwids with matching WWIDs as being multipath devices. This is important when find_multipaths is first activated: Unless /etc/multipath/wwids is deleted or edited, activating this option has no effect, because all previously existing multipath maps (including single-path ones) are listed in the wwids file. On SAN-boot systems with a multipathed root file system, make sure to keep /etc/multipath/wwids synchronized between the initial RAM disk and the file system.

In Summary, using find_multipaths may be convenient in certain use cases, but SUSE still recommends the default configuration with a properly configured blacklist and blacklist exceptions.