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.conffile already exists, thempathconfutility will edit it.
- 
					If the /etc/multipath.conffile does not exist, thempathconfutility will create the/etc/multipath.conffile 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-multipathpackage:- rpm -q device-mapper-multipath - # rpm -q device-mapper-multipath device-mapper-multipath-current-package-version- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - If your system does not include the package, it prints the following: - package device-mapper-multipath is not installed - package device-mapper-multipath is not installed- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- If your system does not include the package, install it by running the following command: - yum install device-mapper-multipath - # yum install device-mapper-multipath- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
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: - mpathconf --enable - # mpathconf --enable- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Optional: Edit the - /etc/multipath.conffile.- Most default settings are already configured, including - path_grouping_policywhich is set to- failover.
- Optional: The default naming format of multipath devices is set to - /dev/mapper/mpathnformat. 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: - mpathconf --enable --user_friendly_names n - # mpathconf --enable --user_friendly_names n- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Reload the configuration of the DM Multipath daemon: - systemctl reload multipathd.service - # systemctl reload multipathd.service- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Start the DM Multipath daemon: - systemctl start multipathd.service - # systemctl start multipathd.service- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
Verification
- Confirm that the DM Multipath daemon is running without issues: - systemctl status multipathd.service - # systemctl status multipathd.service- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Verify the naming format of multipath devices: - ls /dev/mapper/ - # ls /dev/mapper/- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
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 on, you do not have to disable multipathing on these devices.
			
				If you do not set the find_multipaths configuration parameter to on, 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: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Display additional multipath devices that DM Multipath could create: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Display device information: - multipathd show paths raw format "%d %w" | grep sda - # multipathd show paths raw format "%d %w" | grep sda sda WDC_WD800JD-75MSA3_WD-WMAM9FU71040- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - In this example, - /dev/sdais the internal disk and its WWID is- WDC_WD800JD-75MSA3_WD-WMAM9FU71040.
 
- Edit the - blacklistsection of the- /etc/multipath.conffile to ignore this device, using its WWID attribute:- blacklist { wwid WDC_WD800JD-75MSA3_WD-WMAM9FU71040 }- blacklist { wwid WDC_WD800JD-75MSA3_WD-WMAM9FU71040 }- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow Warning- Although you could identify the device using its - devnodeparameter, such as- sda, it would not be a safe procedure, because- /dev/sdais not guaranteed to refer to the same device on reboot.
- Check for any configuration errors in the - /etc/multipath.conffile:- multipath -t > /dev/null - # multipath -t > /dev/null- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - To see the full report, do not discard the command output: - multipath -t - # multipath -t- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- 
						Remake the initramfs if the disk is included in initramfs. For more information, see Configuring multipathing in initramfs.
- Reload the - /etc/multipath.conffile by reconfiguring the- multipathddaemon:- systemctl reload multipathd - # systemctl reload multipathd- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
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: - multipath -v2 -l - # multipath -v2 -l- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- List the additional devices that DM Multipath could create: - multipath -v2 -d - # multipath -v2 -d- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
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 editing the /etc/multipath.conf file.
			
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.
Procedure
- View the default configuration value and supported devices: - multipathd show config - # multipathd show config- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Edit the - /etc/multipath.conffile to set up your multipath configuration.- Example 3.1. DM Multipath Configuration for HP OPEN-V Storage Device - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Save your changes and close the editor.
- Update the multipath device list by scanning for new devices: - multipath -r - # multipath -r- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
Verification
- Confirm that the multipath devices are recognized correctly: - multipath -ll - # multipath -ll- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
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
- Configured DM multipath on your system.
Procedure
- Rebuild the - initramfsfile system with the multipath configuration files:- dracut --force --add multipath - # dracut --force --add multipath- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow Note- When using multipath in the - initramfsand modifying its configuration files, remember to rebuild the- initramfsfor the changes to take effect. If your root device employs multipath, the- dracutcommand will automatically include the multipath module in the- initramfs.
- Optional: If multipath in the - initramfsis no longer necessary:- Remove the multipath configuration file: - rm /etc/dracut.conf.d/multipath.conf - # rm /etc/dracut.conf.d/multipath.conf- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Rebuild the - initramfswith the added multipath configuration:- dracut --force --omit multipath - # dracut --force --omit multipath- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
Verification
- Check if multipath-related files and configurations are present: - lsinitrd /path/to/initramfs.img -m | grep multipath - # lsinitrd /path/to/initramfs.img -m | grep multipath- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
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: - multipath -ll - # multipath -ll- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow