This blog describes you the step by step procedure for configuring multipath in liunx using Device Mapper and will also help you understanding what Device Mapper is.
Simply stating Device Mapper is an interface to Linux Kernel which helps us to configure multiple I/O path between the server and the storage arrays. Device Mapper interface allows the linux kernel to communicate with LVM Logical Volumes, EVMS Volumes , Software RAID, multipath and many other solutions. Multipathing is a must for all those mission critical applications as we all know that data is the most important thing in an enterprise network .
Let me now share the installation process for multipathing.
#rpm -qa | grep device-mapper
#mpathconf -enable -user_firendly_names n
#modprobe dm_multipath
#lsmod | grep dm_multipath
Note : We can use the wwid and alias in this section which will be represented as name when we check using multipath -ll command This will make our life much more easier with the conventional name.

After making all the necessary changes we can now save it.
In order to verify we can use the multipath command .
#multipath -ll or multipath -v2

LUN allocated from the storage itself can now be seen and also the two valid I/O active path.
Note : There are some unwanted LUN shown above which can be removed . This LUN was shown from the previous LUN presented which was directly removed from the storage . This is the main reason why we always need to follow the correct procedure which is removing the LUN from the multipath itself and then deleting it from the storage array later. In order to delete the unwanted LUN we can simply use the following command.
# echo 1 > /sys/block/sdf/device/delete
The next step is performing LVM. Let me briefly describe about what LVM ( Logical Volume Manager) really is and why it has become one of the most useful technology to the linux system administrators. LVM is a widely-used technique and extremely flexible disk management scheme for deploying logical rather than physical storage. With LVM, system administrator can easily resize and extend the logical drive when it is required
In order to perform LVM in we will need first create a new partition using fdisk tool for /dev/mapper/database
# fdisk /dev/mapper/database
n : creates partition
p : primary partition or extended .
then include the size and sector
press t
and 8e for Linux LVM
#partprobe /dev/mapper/database
Note : Now the pvcreate must be done for /dev/mapper/database1
#pvcreate /dev/mapper/database1
#pvdisplay (Verify Physical Volume)
#vgcreate vgnepal /dev/mapper/database1
#vgdisplay (Verify Volume Group)
#lvcreate -n lvnepal -l 100%FREE vgnepal
#lvdisplay (Logical Volume)
Now using mkfs command we will format the newly created LVM.
#mkfs.xfs /dev/vgnepal/lvnepal
Now we will need to permanently mount.
#vim /etc/fstab
/dev/vgnepal/lvnepal /oracle xfs defaults 1 2
#mount -a
We can now verify the storage allocation using df -h command.

This completes this post. I hope this has been informative. Let me know your question in the Comments section below. Thank you!
Simply stating Device Mapper is an interface to Linux Kernel which helps us to configure multiple I/O path between the server and the storage arrays. Device Mapper interface allows the linux kernel to communicate with LVM Logical Volumes, EVMS Volumes , Software RAID, multipath and many other solutions. Multipathing is a must for all those mission critical applications as we all know that data is the most important thing in an enterprise network .
Let me now share the installation process for multipathing.
Installing Device Mapper
#yum install device-mapper-multipath -y#rpm -qa | grep device-mapper
Enabling Multipath
#cp /usr/sare/doc/device-mapper-multipath - */multipath.conf /etc/multipath.conf#mpathconf -enable -user_firendly_names n
#modprobe dm_multipath
#lsmod | grep dm_multipath
SCAN
#sh rescan-scsi-bus.sh -r.
Configuring
#vim /etc/multipath.confNote : We can use the wwid and alias in this section which will be represented as name when we check using multipath -ll command This will make our life much more easier with the conventional name.
After making all the necessary changes we can now save it.
In order to verify we can use the multipath command .
#multipath -ll or multipath -v2
LUN allocated from the storage itself can now be seen and also the two valid I/O active path.
Note : There are some unwanted LUN shown above which can be removed . This LUN was shown from the previous LUN presented which was directly removed from the storage . This is the main reason why we always need to follow the correct procedure which is removing the LUN from the multipath itself and then deleting it from the storage array later. In order to delete the unwanted LUN we can simply use the following command.
# echo 1 > /sys/block/sdf/device/delete
The next step is performing LVM. Let me briefly describe about what LVM ( Logical Volume Manager) really is and why it has become one of the most useful technology to the linux system administrators. LVM is a widely-used technique and extremely flexible disk management scheme for deploying logical rather than physical storage. With LVM, system administrator can easily resize and extend the logical drive when it is required
In order to perform LVM in we will need first create a new partition using fdisk tool for /dev/mapper/database
# fdisk /dev/mapper/database
n : creates partition
p : primary partition or extended .
then include the size and sector
press t
and 8e for Linux LVM
#partprobe /dev/mapper/database
Note : Now the pvcreate must be done for /dev/mapper/database1
#pvcreate /dev/mapper/database1
#pvdisplay (Verify Physical Volume)
#vgcreate vgnepal /dev/mapper/database1
#vgdisplay (Verify Volume Group)
#lvcreate -n lvnepal -l 100%FREE vgnepal
#lvdisplay (Logical Volume)
Now using mkfs command we will format the newly created LVM.
#mkfs.xfs /dev/vgnepal/lvnepal
Now we will need to permanently mount.
#vim /etc/fstab
/dev/vgnepal/lvnepal /oracle xfs defaults 1 2
#mount -a
We can now verify the storage allocation using df -h command.
This completes this post. I hope this has been informative. Let me know your question in the Comments section below. Thank you!
Comments
Post a Comment