Script to Create multipath.conf Alias Entries for Nimble LUNs

File uploaded by bill on Jan 6, 2014Last modified by mkieran on Jan 6, 2014
Version 4Show Document
  • View in full screen mode

Hi All,


Wrote a little script that will look at the devices on a linux system and create multipath.conf alias entries for any Nimble luns.  The value of using the alias is the device can be referenced by the alias in place in /dev/mapper/mpathX.  This script will create the alias based on the name of the volume.  To use the script just run it.  If there are any Nimble iSCSI luns it will produce the correct multipaths {} config.  Here's an example:


multipaths {

multipath {

                wwid            2d4cbebaf6624165b6c9ce900d40dd8da

                alias            nimblelun01




Now if you want to format or mount the lun it can be addressed by "/dev/mapper/nimblelun01" instead of "/dev/mapper/mpathX".


The script will output the configuration details, you'll need to copy and paste them in to the /etc/multipath.conf manually.  The script was written on and tested for CentOS 6.4.