Chapter 3. Configuring DM Multipath
Chapter 3. Configuring DM Multipath You can set up DM Multipath with the mpathconf utility. This utility creates or edits the /etc/multipath.conf multipath configuration file based on the following scenarios: If the /etc/multipath.conf file already exists, the mpathconf utility will edit it. If the /etc/multipath.conf file does not exist, the mpathconf utility will create the /etc/multipath.conf file from scratch. 3.1. Checking for the device-mapper-multipath package Before setting up DM Multipath on your system, ensure that your system is up-to-date and includes the device-mapper-multipath package. Procedure Check if your system includes the device-mapper-multipath package: If your system does not include the package, it prints the following: If your system does not include the package, install it by running the following command: 3.2. Setting up basic failover configuration with DM Multipath You can set up DM Multipath for a basic failover configuration and edit the /etc/multipath.conf file before starting the multipathd daemon. Prerequisites Administrative access. Procedure Enable and initialize the multipath configuration file: Optional: Edit the /etc/multipath.conf file. Most default settings are already configured, including path_grouping_policy which is set to failover . Optional: The default naming format of multipath devices is set to /dev/mapper/mpathn format. If you prefer a different naming format: Configure DM Multipath to use the multipath device WWID as its name, instead of the mpath_n_ user-friendly naming scheme: Reload the configuration of the DM Multipath daemon: Start the DM Multipath daemon: Verification Confirm that the DM Multipath daemon is running without issues: Verify the naming format of multipath devices: 3.3. Ignoring local disks when generating multipath devices Some machines have local SCSI cards for their internal disks and DM Multipath is not recommended for these devices. If you set the find_multipaths configuration parameter to yes , you do not have to disable multipathing on these devices. If you do not set the find_multipaths configuration parameter to yes , you can use the following procedure to modify the DM Multipath configuration file to ignore the local disks when configuring multipath. Procedure Identify the internal disk using any known parameters such as the device's model, path or vendor, and determine its WWID by using any one of the following options: Display existing multipath devices: Display additional multipath devices that DM Multipath could create: Display device information: In this example, /dev/sda is the internal disk and its WWID is WDC_WD800JD-75MSA3_WD-WMAM9FU71040 . Edit the blacklist section of the /etc/multipath.conf file to ignore this device, using its WWID attribute: Warning Although you could identify the device using its devnode parameter, such as sda , it would not be a safe procedure, because /dev/sda is not guaranteed to refer to the same device on reboot. Check for any configuration errors in the /etc/multipath.conf file: To see the full report, do not discard the command output: If the disk is included in initramfs remake the initramfs. For more information see Configuring multipathing in initramfs . Reload the /etc/multipath.conf file by reconfiguring the multipathd daemon: Note Multipath devices on top of local disks cannot be removed when in use. To ignore such device, stop all users of the device. For example, by unmounting any filesystem on top of it and deactivating any logical volumes using it. If this is not possible, you can reboot the system to remove the multipath device. Verification Verify that the internal disk is ignored and it is not displayed in the multipath output: List the multipathed devices: List the additional devices that DM Multipath could create: Additional resources multipath.conf(5) man page 3.4. Configuring additional storage with DM Multipath By default, DM Multipath includes built-in configurations for the most common storage arrays, which support DM Multipath. If your storage array does not already have a configuration, you can add one by editting the /etc/multipath.conf file. NOTE Add additional storage devices during the initial configuration to align the setup with your anticipated needs. DM Multipath enables adding devices later for scalability or upgrades, but this approach may require adjusting configurations to ensuring compatibility. Prerequisites Administrative access. Procedure View the default configuration value and supported devices: Edit the /etc/multipath.conf file to set up your multipath configuration. Example 3.1. DM Multipath Configuration for HP OPEN-V Storage Device Save your changes and close the editor. Update the multipath device list by scanning for new devices: Verification Confirm that the multipath devices are recognized correctly: 3.5. Configuring multipathing in initramfs Setting up multipathing in the initramfs file system is essential for seamless storage functionality, particularly in scenarios requiring redundancy and load balancing. This setup guarantees that multipath devices are available early in the boot process, which is crucial for maintaining the integrity of the storage setup and preventing potential issues. Prerequisites Administrative access. Configured DM multipath on your system. Procedure Rebuild the initramfs file system with the multipath configuration files: NOTE When using multipath in the initramfs and modifying its configuration files, remember to rebuild the initramfs for the changes to tale effect. If your root device employs multipath, the dracut command will automatically include the multipath module in the initramfs . Optional: If multipath in the initramfs is no longer necessary: Remove the multipath configuration file: Rebuild the initramfs with the added multipath configuration: Verification Check if multipath-related files and configurations are present: NOTE While verefication steps provided can give you an indication of success, a final test boot-up is recommended to ensure that the configuration works as expected. After the reboot, confirm that the multipath devices are recognized correctly:
rpm -q device-mapper-multipath device-mapper-multipath- current-package-version package device-mapper-multipath is not installed yum install device-mapper-multipath mpathconf --enable mpathconf --enable --user_friendly_names n systemctl reload multipathd.service systemctl start multipathd.service systemctl status multipathd.service ls /dev/mapper/ multipath -v2 -l mpatha ( WDC_WD800JD-75MSA3_WD-WMAM9FU71040 ) dm-2 ATA,WDC WD800JD-75MS size=33 GB features="0" hwhandler="0" wp=rw `-+- policy='round-robin 0' prio=0 status=active |- 0:0:0:0 sda 8:0 active undef running multipath -v2 -d : mpatha ( WDC_WD800JD-75MSA3_WD-WMAM9FU71040 ) dm-2 ATA,WDC WD800JD-75MS size=33 GB features="0" hwhandler="0" wp=undef `-+- policy='round-robin 0' prio=1 status=undef |- 0:0:0:0 sda 8:0 undef ready running multipathd show paths raw format "%d %w" | grep sda sda WDC_WD800JD-75MSA3_WD-WMAM9FU71040 blacklist { wwid WDC_WD800JD-75MSA3_WD-WMAM9FU71040 } multipath -t > /dev/null multipath -t systemctl reload multipathd multipath -v2 -l multipath -v2 -d multipathd show config Set default configurations for all devices managed by DM Multipath defaults { # Enable user-friendly names for devices user_friendly_names yes } devices { # Define configuration for HP OPEN-V storage device { vendor "HP" pproduct "OPEN-V" no_path_retry 18 } } multipath -r multipath -ll dracut --force --add multipath rm /etc/dracut.conf.d/multipath.conf dracut --force --omit multipath lsinitrd /path/to/initramfs.img -m | grep multipath multipath -ll