Home > Linux, Netapp, Redhat > Adding a Netapp LUN on the SAN to a RHEL 5 host

Adding a Netapp LUN on the SAN to a RHEL 5 host

This note will provide the steps to add Netapp LUNs to a running RHEL 5 linux host.

First, ensure the LUNs have been shared/zoned correctly per Netapp requirements.  This doc also assumes Netapp Linux Host software has been installed.

Next, scan the HBAs for the new LUNs:

echo “- – -” > /sys/class/scsi_host/<host listings>/scan

<host listings> refer to the scsi host instances (for the hbas). if you do a listing of the scsi_host directory, you will see something similar to the following:
[root@r08u6 scsi_host]# ll
total 0
drwxr-xr-x 2 root root 0 Aug 4 15:52 host0
drwxr-xr-x 2 root root 0 Aug 4 15:52 host1
drwxr-xr-x 2 root root 0 Aug 4 15:52 host2

as you can see, on this server it shows 3 instances of scsi host entries. by using the echo command above on each of these directory’s “scan” files it will force a re-read of the specific scsi bus.

This procedure has been tested on RHEL5 successfully without interruption to the system.

Next, run:
#sanlun lun show all
controller:         lun-pathname         device filename  adapter  protocol          lun size         lun state
IRVFAS01B:  /vol/BI_TEST/BI_TEST_LUN_2  /dev/sdz         host3    FCP            2t (2199023255552)  GOOD
IRVFAS01B:  /vol/BI_TEST/BI_TEST_LUN_1  /dev/sdaa        host3    FCP            2t (2199023255552)  GOOD
IRVFAS01B:  /vol/BI_TEST/BI_TEST_LUN_2  /dev/sdab        host3    FCP            2t (2199023255552)  GOOD
IRVFAS01B:  /vol/BI_TEST/BI_TEST_LUN_1  /dev/sdac        host3    FCP            2t (2199023255552)  GOOD
IRVFAS01B:  /vol/BI_TEST/BI_TEST_LUN_2  /dev/sdap        host4    FCP            2t (2199023255552)  GOOD
IRVFAS01B:  /vol/BI_TEST/BI_TEST_LUN_1  /dev/sdaq        host4    FCP            2t (2199023255552)  GOOD
IRVFAS01B:  /vol/BI_TEST/BI_TEST_LUN_2  /dev/sdbd        host4    FCP            2t (2199023255552)  GOOD
IRVFAS01B:  /vol/BI_TEST/BI_TEST_LUN_1  /dev/sdbe        host4    FCP            2t (2199023255552)  GOOD

In the example above, we see 2 LUNs mapped with 4 paths to each.

Now, verify using multipath:
#multipath -ll

Note, the WWID that are shown.  You can use them below to map the devices to an alias device name of your choosing.

If the new LUNs aren’t listed, reload the configs:
#service multipathd reload

If you want to use an alias name for the device, modify /etc/multipath.conf and add a stanza similar to:

multipath {
wwid            360a98000486e642f50346331694a7247
alias           mynewLUN1
path_grouping_policy failover
}

This should be part of the “multipaths” section.

Categories: Linux, Netapp, Redhat
  1. Ravindra Patel
    March 8, 2012 at 5:30 pm

    Hi,
    Thanks for helpful article. At the end of your article your wrote

    wwid 360a98000486e642f50346331694a7247

    with /etc/multipathd.conf

    from where did you get this wwid number?

    I checked your output with

    #sanlun lun show all

    but on that output this wwid number is not showing anywhere. Once again Thanks for your helpful article.

    • March 8, 2012 at 10:49 pm

      HI Ravindra,

      You can use the command “multipath -ll” to find the WWID of any particular LUN.

      Will

  2. Santosh
    January 28, 2014 at 2:08 pm

    Hello All,

    Thanks for the posting this .
    Can I get the step by step procedure to assign LUN from EMC VNX to RHEL host with Qlogic dual port HBA , right from HBA drives installed and after this …..
    Thanks in advance
    Santosh

  3. July 19, 2014 at 2:28 am

    do we have to install any packages to list “sanlun lun show all” or comes with OS ?
    that is to list only NAS disks not san ( like inq)…right ?

    • August 16, 2014 at 3:04 am

      Yes, you do. I can’t remember the pkg off the top of my head but you should be able to download it from NetApp’s website.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: