Skip to main content

Device Mapper Multipath with LVM in Oracle Linux

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.

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.conf

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!




Comments

Popular posts from this blog

SAN Switch Zoning with Brocade

Zoning in Brocade SAN Switch Let's begin with resetting the switch completely. In my environment I have two brocade SAN Switch connecting to 2 Dell R940 server configured with VMware. The SAN switch will be having connectivity between Dell Unity 500 storage and Dell R940 servers. Multipathing will be done between the server and storage with the help of SAN Switch. Multipathing, also called SAN multipathing or I/O multipathing, is the establishment of multiple physical routes between a server and the storage device that supports. It results in better fault tolerance and performance enhancement. DESIGN The idea behind zoning is that intended WWPN talk with each other . This is more like ACL in the world of Ethernet. To see the devices which are logged into the switch the following commands can be executed. SAN-A:admin> switchshow switchName: SAN-A switchType: 118.1 switchState: Online switchMode: Native switchRole: Principal switchDomain: 1 switchId: ...

Upgrade Catalyst C9500

Upgrading Catalyst 9500 series switch is relatively easy. The one that I'm going to upgrade today is on Install mode containing packages.conf file. Install mode consumes far less resources in compared to the traditional bundle mode and has some advantage like auto upgrade when configured in stacked mode. We can talk about the difference between bundle and install mode later on. Let's focus on upgrading the Catalyst 9500 switch. Switch I am trying to upgrade is in 17.03.03 which has some bugs and security vulnerabilities. I am upgrading it from 17.03.03 to 17.6.5(MD) golden image present in the cisco download site for C9500 series switch and also reading down the linked document from cisco that is what they recommend. You can have a look at it . https://www.cisco.com/c/en/us/support/docs/switches/catalyst-9300-series-switches/221498-recommended-releases-for-catalyst-9200-9.html We will first need to create FTP username and password in the switch. The username and password must b...