Add Multipath and connect to XFS system

Device Mapper Multipathing (DM-Multipath) is a native multipathing in Linux, Device Mapper Multipathing (DM-Multipath) can be used for Redundancy and to Improve the Performance. It aggregates or combines the multiple I/O paths between Servers and Storage, so it creates a single device at the OS Level.

For example, Lets say a server with two HBA card attached to a storage controller with single ports on each HBA cards. One lun assigned to the single server via two wwn number of both cards. So OS detects two devices: /dev/sdb and /dev/sdc. Once we installed the Device Mapper Multipathing. DM-Multipath creates a single device with a unique WWID that reroutes I/O to those four underlying devices according to the multipath configuration. So when there is a failure with any of this I/O paths, Data can be accessible using the available I/O Path.

Install the  Device Mapper Multipath package.

Verify the device-mapper-multipath package has been installed or not.

[root@linux1 ~]# rpm -q device-mapper-multipath

If it is not installed, Install the Device Mapper Multipath package using yum to avoid dependencies issue. if yum is not configured, please refer the link Yum Configuration on Linux.

[root@linux1 ~]# yum -y install device-mapper-multipath

Basic Configuration of Linux Device Mapper Multipathing

Configuration file is /etc/multipath.conf file, take a backup of it. Edit the configuration file to ensure you have the following entries uncommented out.

If you’re unable to find multipath.conf configuration file, you may find it at this locaiton:

 cd /usr/share/doc/device-mapper-multipath-0.4.9/
cp multipath.conf /etc/multipath.conf
nano multipath.conf
defaults {
user_friendly_names yes
}
blacklist {
devnode “sda”
}

The blacklist includes the devices which are not to be configured in Multipathing. For example, Lets say our OS installed disk is /dev/sda. So the first entry in the blacklist will exclude them. Same for IDE drives (hd).

Start and Enable the multipath daemons.

Start the multipath service if not started bydefault.

[root@linux1 ~]# systemctl start multipathd

Enable the multipath service to start on boot.

[root@linux1 ~]# systemctl enable multipathd

Check the multipathing status.

The multipath -ll command prints out multipathed paths that show which devices are multipathed. If the command does not print anything out, ensure that all SAN connections are set up properly and the system is multipathed.

[root@linux1 ~]# multipath -ll
mpathb (360014051f89d2bb3300470fa7d4baa10) dm-2 LIO-ORG ,lun0
size=2.0G features='0' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=0 status=active
| `- 1:0:0:0 sdb 8:16 active active running
`-+- policy='service-time 0' prio=0 status=enabled
  `- 2:0:0:0 sdc 8:32 active active running

The above output shows 1 LUN (mpathb) with 2 paths (sdb and sdc). Linux Multipathing basic configuration is done.

Install XFS System Utilities

First, you need to install XFS system utilities, which allow you to perform various XFS related administration tasks (e.g., format, expand, repair, setting up quota, change parameters, etc).

On Debian, Ubuntu or Linux Mint:

$ sudo apt-get install xfsprogs

On Fedora, CentOS or RHEL:

$ sudo yum install xfsprogs

On Arch Linux:

$ sudo pacman -S xfsprogs

Create an XFS-Formatted Disk Partition

Now let’s first prepare a disk partition to create XFS on. Assuming that your disk is located at /dev/sdb, create a partition by:

$ sudo fdisk /dev/sdb

Let’s say the created partition is assigned /dev/sdb1 device name.

Next, format the partition as XFS using mkfs.xfs command. The “-f” option is needed if the partition has any other file system created on it, and you want to overwrite it.

$ sudo mkfs.xfs -f /dev/sdb1

Now you are ready to mount the formatted partition. Let’s assume that /storage is a local mount point for XFS. Go ahead and mount the partition by running:

$ sudo mount -t xfs /dev/sdb1 /storage

Verify that XFS mount is succesful by running:

$ df -Th /storage

If you want the XFS partition to be mounted at /storage automatically upon boot, add the following line to /etc/fstab.

/dev/sdb1 /storage xfs defaults 0 0

Src:

https://www.learnitguide.net/2016/06/how-to-configure-multipathing-in-linux.html
http://ask.xmodulo.com/create-mount-xfs-file-system-linux.html

Share

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.