Use the mpathconf utility to configure DM-Multipath. The mpathconf utility creates or modifies the /etc/multipath.conf file, using a copy of the sample multipath.conf file in the /usr/share/doc/device-mapper-multipath-[version] directory as a template if necessary. Run mpathconf –help to display usage:

 # mpathconf --help
usage: /sbin/mpathconf [command]

Commands:
Enable: --enable 
Disable: --disable
Only allow certain wwids (instead of enable): --allow [WWID]
Set user_friendly_names (Default y): --user_friendly_names [y|n]
Set find_multipaths (Default y): --find_multipaths [y|n]
Load the dm-multipath modules on enable (Default y): --with_module [y|n]
start/stop/reload multipathd (Default n): --with_multipathd [y|n]
select output file (Default /etc/multipath.conf): --outfile [FILE]

 

By default, the mpathconf utility loads the device-mapper-multipath kernel module and enables the user_friendly_names and the find_multipaths attributes.

 

Run mpathconf without any arguments to display the status of DM-Multipath.

# mpathconf 
multipath is enabled
find_multipaths is enabled
user_friendly_names is enabled
dm_multipath module is not loaded
multipathd is not running

 

For a basic failover configuration with all the defaults, run:

# mpathconf --enable

 

To enable the multipath configuration and start the multipathd service, run:

# mpathconf –-enable --with_multipathd y

 

The remaining commands are:

  • –user_friendly_names [y|n] – If set to y, this adds the line user_friendly_names yes to the /etc/multipath.conf defaults section. If set to n, this removes the line.
  • –find_multipaths [y|n] – If set to y, this adds the line find_multipaths yes to the /etc/multipath.conf defaults section. If set to n, this removes the line. Refer to the multipath.conf(5) man page for a description of find_multipaths.
  • –with_module [y|n] – If set to y, this runs modprobe dm_multipath to install the multipath modules. This only works with the –enable command.
  • –with_multipathd [y|n] – If set to y, this runs systemctl enable multipathd to start multipathd on –enable , and runs systemctl stop multipathd on –disable.

 

Always reload the multipathd service after making any changes to the /etc/multipath.conf configuration file.

# systemctl reload multipathd 

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)