Show Table of Contents
Chapter 3. Setting Up DM-Multipath
This chapter provides step-by-step example procedures for configuring DM-Multipath. It includes the following procedures:
- Basic DM-Multipath setup
- Ignoring local disks
- Adding more devices to the configuration file
- Starting multipath in the
initramfsfile system
3.1. Setting Up DM-Multipath
Before setting up DM-Multipath on your system, ensure that your system has been updated and includes the
device-mapper-multipath package.
You set up multipath with the
mpathconf utility, which creates the multipath configuration file /etc/multipath.conf.
- If the
/etc/multipath.conffile already exists, thempathconfutility will edit it. - If the
/etc/multipath.conffile does not exist, thempathconfutility will use the/usr/share/doc/device-mapper-multipath-0.4.9/multipath.conffile as the starting file. - If the
/usr/share/doc/device-mapper-multipath-0.4.9/multipath.conffile does not exist thempathconfutility will create the/etc/multipath.conffile from scratch.
If you do not need to edit the
/etc/multipath.conf file, you can set up DM-Multipath for a basic failover configuration by running the following command. This command enables the multipath configuration file and starts the multipathd daemon.
# mpathconf --enable --with_multipathd y
If you need to edit the
/etc/multipath.conf file before starting the multipathd daemon. use the following procedure to set up DM-Multipath for a basic failover configuration.
- Run the
mpathconfcommand with the--enableoption specified:#
mpathconf --enableFor information on additional options to thempathconfcommand you may require, see thempathconfman page or enter thempathconfcommand with the--helpoption specified.#
mpathconf --helpusage: /sbin/mpathconf <command> Commands: Enable: --enable Disable: --disable Set user_friendly_names (Default n): --user_friendly_names <y|n> Set find_multipaths (Default n): --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> chkconfig on/off multipathd (Default y): --with_chkconfig <y|n> - Edit the
/etc/multipath.conffile if necessary. The default settings for DM-Multipath are compiled in to the system and do not need to be explicitly set in the/etc/multipath.conffile.The default value ofpath_grouping_policyis set tofailover, so in this example you do not need to edit the/etc/multipath.conffile. For information on changing the values in the configuration file to something other than the defaults, see Chapter 4, The DM-Multipath Configuration File.The initial defaults section of the configuration file configures your system so that the names of the multipath devices are of the formmpathn; without this setting, the names of the multipath devices would be aliased to the WWID of the device. - Save the configuration file and exit the editor, if necessary.
- Execute the following command:
#
service multipathd start
Since the value of
user_friendly_names is set to yes in the configuration file, the multipath devices will be created as /dev/mapper/mpathn. For information on setting the name of the device to an alias of your choosing, see Chapter 4, The DM-Multipath Configuration File.
If you do not want to use user friendly names, you can enter the following command:
# mpathconf --enable --user_friendly_names nNote
If you find that you need to edit the multipath configuration file after you have started the multipath daemon, you must execute the
service multipathd reload command for the changes to take effect.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.