How to Configure Multipathing in Linux?
Last Updated :
01 Dec, 2022
Multipathing is a process that allows us to combine different physical connections between the server and a storage location into a single virtual device. The main idea behind multipathing is to provide a more flexible connection to the storage location for improved performance.
The RHEL supports this process of multipathing by taking the help of the dm-multipath subsystem. It takes the help of the device mapper system present in the kernel to create virtual devices which are then looked after by the multipathd daemon and multipath CLI.
Steps to configure Multipathing in Linux
Step 1: Install the device mapper multipath package
yum -y install device-mapper-multipath
Confirm the installation by typing the below command:
rpm -q device-mapper-multipath
Step 2: Generating and Exploring the default device mapper configuration file:
To generate a default config file we can take the help of the mpathconf command. This command along with the --help flag will let us know about the default values that should be used in the file. Create the file in the /etc/mpath.conf location.
mpathconf --help
The devices which are set by default need not to be set again. The below example shows what this means:
mpathconf --enable --find_multipaths y
The above command will only set the find_multipaths flag while leaving all the other settings to default. This will create a sample multipath.conf file at the /etc/multipath.conf location.
If you want to edit the file which is already there then change the directory to, /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf :
cd /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
Use the Cat command to see the contents of the .conf file.
cat multipath.conf
Step 3. Editing the multipath.conf file:
The below command will generate a file in the multipath directory. Keep in mind that only the entries that we have mentioned will change, the rest will be as they were.
mpathconf --enable --user_friendly_names y
Step 4. Enabling the Multipathd service:
systemctl start multipathd
systemctl enable multipathd
Step 5. Blacklisting of some devices:
Certain devices that match specific criteria can be blacklisted, this can be mentioned in a short piece of code. These devices will be skipped when the detection of multipath devices would be carried on. The device mapper also provides the facility of a built-in blacklist so that the unsupported devices are excluded automatically.
blacklist {
devnode vda
}
In the above example, the device vda will be ignored or blacklisted during the multi-mapper search.
So this is how you can configure multipathing in Linux.
Similar Reads
How To Configure Routes in Remix?
Remix is a full-stack framework that simplifies the process of building modern, data-driven web applications. One of the standout features of Remix is its powerful and flexible routing system. Routing in Remix is based on a file-system convention, making it easy to define both simple and complex rou
7 min read
How to Symlink a File in Linux
In Linux/UNIX, a symbolic link or soft link, also referred to as a symlink, is a useful tool for linking files or directories from different locations. Similar to a pointer in C programming, a symlink directs to the original file from an alternate location. The creation of symbolic links is facilita
4 min read
How to Configure Quagga Routing Suite on Linux?
Quagga is a routing software suite that provides support for various routing protocols, including OSPF Open Shortest Path First), BGP (Border Gateway Protocol), and RIP (Routing Information Protocol). It is designed to run on Unix-like operating systems, such as Linux, and is often used in large net
5 min read
How to Manage Directories in Linux?
Directories in Linux or any operating system help to organize the data and files, which is then easier to find and manage. In this article, you will learn everything you will need to manage directories in Linux. We will try to cover every topic from creating, and copying to deleting the directories
6 min read
How to Mount File System in Linux | mount Command
Working with file systems is a fundamental part of managing a Linux system, and knowing how to mount them is a skill every Linux user should have. Whether youâre connecting a USB drive, accessing a network share, or setting up a new partition, the mount command is your go-to tool for making file sys
6 min read
How to Configure RAID?
This article will guide you on configuring RAID on your computer What is RAID?RAID (redundant array of independent disks) is a method of storing the same data in multiple different hard disks or solid-state drives which is done to protect data in case of a drive/hardware failure. In simple words, it
3 min read
How to Configure your Linux Firewall - 3 Methods
A Linux firewall is essential for protecting your system from unauthorized access and attacks. By configuring firewall rules, you can control the flow of traffic into and out of your system. Linux offers multiple firewall management tools, including iptables and firewalld, both of which can be used
13 min read
How to Configure IPv6 on CISCO Router?
An IPv6 is the sixth version of any IP address on the IP protocol. It consists of eight groups of four hexadecimal digits. IP v6 is a 128-bits address having an address space of 2^128. For more details about IPv6 refer to the articles: What is IPv6? and Internet Protocol version 6 (IPv6). Steps to
2 min read
How to Install and Configure Samba in Ubuntu
In the current society where things are digitalized it is common for people to share files and printers among various devices. Regardless of whether you are using a computer and its resources for personal or academic purposes, sharing files and printers is sometimes necessary. But on the other hand,
4 min read
How to Insert a Directory to PATH in Linux
Adding a directory to the PATH in Linux allows the system to locate and execute scripts or programs stored in that directory without requiring the full path each time. When you type a command in the Linux terminal, the shell searches for the corresponding executable file to run it. These executables
5 min read