Table of ContentsView in Frames

Examples of sanlun, iscsiadm, iscsi output when used to view LUNs

You can use either the sanlun command, the iscsiadm command, or the iscsi command to view the LUNs configured on your Linux host. The examples in this section show the type of output you would see if you run one of these commands on your Linux operating system in an environment with DM-Multipath enabled or one with it disabled.

The tool you use depends on your version of Linux and what you want to view as well as whether you have DM-Multipath enabled. The sanlun command displays the host device names and the LUNs to which they are mapped. The iscsiadm command lists the available storage systems and LUNs. The iscsi-ls -l command lists storage system node names, IP addresses, and available LUNs.

The following sections provide examples of the type of output you see if you run one of these commands in a specific environment; for example with iSCSI and DM-Multipath on Red Hat Enterprise Linux 5 series.

Example of using sanlun to view LUNs running FC with DM-Multipath

This example shows sample output from the sanlun lun show all command when it is issued in a Host Utilities environment that is running the FC protocol with DM-Multipath on a storage system running clustered Data ONTAP.

# sanlun lun show all
controller(7mode)/             device          host                  lun
vserver(Cmode) lun-pathname    filename        adapter    protocol   size    mode
---------------------------------------------------------------------------------
vs_data28_2    /vol/vol1/lun1 	/dev/sdgf       host1      FCP        3g      C
vs_data28_2    /vol/vol2/lun2 	/dev/sdge       host1      FCP        3g      C
vs_data28_2    /vol/vol3/lun3 	/dev/sdgd       host1      FCP        3g      C

This example shows sample output from the sanlun lun show all command when it is issued in a Host Utilities environment that is running the FC protocol with DM-Multipath on a storage system running Data ONTAP operating in 7-Mode.

# sanlun lun show all
controller(7mode)/                device      host                  lun
vserver(Cmode)  lun-pathname      filename    adapter    protocol   size    mode
--------------------------------------------------------------------------------
fas3040-201-25   /vol/vol1/lun1   /dev/sdu    host1      FCP        5g      7
fas3040-201-25   /vol/vol2/lun2   /dev/sdt    host1      FCP        5g      7
fas3040-201-25   /vol/vol3/lun3   /dev/sds    host1      FCP        5g      7

Example of using sanlun to view LUNs running iSCSI with DM-Multipath

This example shows sample output from the sanlun lun show all command when it is issued in a Host Utilities environment that is running the iSCSI protocol with DM-Multipath on a storage system running clustered Data ONTAP.

# sanlun lun show all
controller(7mode)/              device       host                  lun
vserver(Cmode) lun-pathname     filename     adapter    protocol   size    mode
-------------------------------------------------------------------------------
vs_data78_1    /vol/vol1/lun1 	/dev/sdcx     host29     iSCSI      3g      C
vs_data78_0    /vol/vol2/lun2 	/dev/sdcw     host20     iSCSI      3g      C
vs_data79_1    /vol/vol3/lun3 	/dev/sdck     host14     iSCSI      3g      C

This example shows sample output from the sanlun lun show all command when it is issued in a Host Utilities environment that is running the iSCSI protocol with DM-Multipath on a storage system running Data ONTAP operating in 7-Mode.

# sanlun lun show all
controller(7mode)/               device      host                  lun
vserver(Cmode)   lun-pathname    filename    adapter    protocol   size    mode
-------------------------------------------------------------------------------
fas3040-201-24   /vol/vol1/lun1  /dev/sdb    host6      iSCSI      10m     7
fas3040-201-24   /vol/vol2/lun2  /dev/sdb    host6      iSCSI      10m     7
fas3040-201-24   /vol/vol3/lun3  /dev/sdb    host6      iSCSI      10m     7

Example of using iscsiadm to view LUNs running iSCSI with DM-Multipath on RHEL series system

This example shows sample output from the iscsiadm command when it is issued in a Host Utilities environment that is running the iSCSI protocol and DM-Multipath on a Red Hat Enterprise Linux 5 or 6 series system.

Note: This example lists the available storage systems and LUNs for a session with a specific session ID. To view the details of all the sessions, you use the iscsiadm -m session -P 3 command.
# iscsiadm -m session  -P 3 -r 2
Target: iqn.1992-08.com.netapp:sn.101183016
        Current Portal: 10.72.199.71:3260,1001
        Persistent Portal: 10.72.199.71:3260,1001
                **********
                Interface:
                **********
                Iface Name: default
                Iface Transport: tcp
                Iface Initiatorname: iqn.1994-05.com.redhat:5e3e11e0104d
                Iface IPaddress: 10.72.199.119
                Iface HWaddress: default
                Iface Netdev: default
                SID: 2
                iSCSI Connection State: LOGGED IN
                iSCSI Session State: LOGGED_IN
                Internal iscsid Session State: NO CHANGE
                ************************
                Negotiated iSCSI params:
                ************************
                HeaderDigest: None
                DataDigest: None
                MaxRecvDataSegmentLength: 131072
                MaxXmitDataSegmentLength: 65536
                FirstBurstLength: 65536
                MaxBurstLength: 65536
                ImmediateData: Yes
                InitialR2T: No
                MaxOutstandingR2T: 1
                ************************
                Attached SCSI devices:
                ************************
                Host Number: 4  State: running
                scsi4 Channel 00 Id 0 Lun: 0
                        Attached scsi disk sdc      State: running
                scsi4 Channel 00 Id 0 Lun: 1
                        Attached scsi disk sde      State: running
                scsi4 Channel 00 Id 0 Lun: 2
                        Attached scsi disk sdg      State: running
                scsi4 Channel 00 Id 0 Lun: 3
                        Attached scsi disk sdi      State: running
                scsi4 Channel 00 Id 0 Lun: 4
                        Attached scsi disk sdk      State: running
                scsi4 Channel 00 Id 0 Lun: 5
                        Attached scsi disk sdm      State: running
                scsi4 Channel 00 Id 0 Lun: 6
                        Attached scsi disk sdp      State: running
                scsi4 Channel 00 Id 0 Lun: 7
                        Attached scsi disk sdq      State: running

Example of using iscsiadm to view LUNs running iSCSI without multipathing on RHEL series system

This example shows sample output from the iscsiadm command when it is issued in a Host Utilities environment that is running the iSCSI protocol without multipathing on a Red Hat Enterprise Linux 5 or 6 series system. This example uses a specific session ID.

Note: This example lists the available storage systems and LUNs for a session with a specific session ID. To view the details of all the sessions, you use the iscsiadm -m session -P 3 command.
# iscsiadm -m session  -P 3 -r 2
Target: iqn.1992-08.com.netapp:sn.101183016
        Current Portal: 10.72.199.71:3260,1001
        Persistent Portal: 10.72.199.71:3260,1001
                **********
                Interface:
                **********
                Iface Name: default
                Iface Transport: tcp
                Iface Initiatorname: iqn.1994-05.com.redhat:5e3e11e0104d
                Iface IPaddress: 10.72.199.119
                Iface HWaddress: default
                Iface Netdev: default
                SID: 2
                iSCSI Connection State: LOGGED IN
                iSCSI Session State: LOGGED_IN
                Internal iscsid Session State: NO CHANGE
                ************************
                Negotiated iSCSI params:
                ************************
                HeaderDigest: None
                DataDigest: None
                MaxRecvDataSegmentLength: 131072
                MaxXmitDataSegmentLength: 65536
                FirstBurstLength: 65536
                MaxBurstLength: 65536
                ImmediateData: Yes
                InitialR2T: No
                MaxOutstandingR2T: 1
                ************************
                Attached SCSI devices:
                ************************
                Host Number: 4  State: running
                scsi4 Channel 00 Id 0 Lun: 0
                        Attached scsi disk sdc      State: running
                scsi4 Channel 00 Id 0 Lun: 1
                        Attached scsi disk sde      State: running
                scsi4 Channel 00 Id 0 Lun: 2
                        Attached scsi disk sdg      State: running
                scsi4 Channel 00 Id 0 Lun: 3
                        Attached scsi disk sdi      State: running
                scsi4 Channel 00 Id 0 Lun: 4
                        Attached scsi disk sdk      State: running
                scsi4 Channel 00 Id 0 Lun: 5
                        Attached scsi disk sdm      State: running
                scsi4 Channel 00 Id 0 Lun: 6
                        Attached scsi disk sdp      State: running
                scsi4 Channel 00 Id 0 Lun: 7
                        Attached scsi disk sdq      State: running

Example of using iscsiadm command running iSCSI with DM-Multipath on SLES series system

This example shows sample output from the iscsiadm command when it is issued in a Host Utilities environment that is running the iSCSI protocol and DM-Multipath on a SUSE Linux Enterprise Server 10 or 11 series.

Note: This example lists the available storage systems and LUNs for a specific session. To view the details of all the sessions, you use the iscsiadm -m session -P 3 command.
# iscsiadm -m session --sid=0 -P 3 
iSCSI Transport Class version 2.0-724
iscsiadm version 2.0-868
Target: iqn.1992-08.com.netapp:sn.101180456
        Current Portal: 10.72.199.144:3260,1001
        Persistent Portal: 10.72.199.144:3260,1001
                **********
                Interface:
                **********
                Iface Name: default
                Iface Transport: tcp
                Iface Initiatorname: iqn.1996-04.de.suse:lnx.200.109
                Iface IPaddress: 10.72.200.109
                Iface HWaddress: default
                Iface Netdev: default
                SID: 1
                iSCSI Connection State: LOGGED IN
                iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
                ************************
                Negotiated iSCSI params:
                ************************
                HeaderDigest: CRC32C
                DataDigest: None
                MaxRecvDataSegmentLength: 131072
                MaxXmitDataSegmentLength: 65536
                FirstBurstLength: 65536
                MaxBurstLength: 65536
                ImmediateData: Yes
                InitialR2T: No
                MaxOutstandingR2T: 1
                ************************
                Attached SCSI devices:
                ************************
                Host Number: 47 State: running
                scsi47 Channel 00 Id 0 Lun: 2
                   Attached scsi disk sdj       State: running
                scsi47 Channel 00 Id 0 Lun: 1
                   Attached scsi disk sdf       State: running
                scsi47 Channel 00 Id 0 Lun: 0
                   Attached scsi disk sdb       State: running

Example of using iscsiadm command running iSCSI without multipathing on SLES series system

This example shows sample output from the iscsiadm command when it is issued in a Host Utilities environment that is running the iSCSI protocol without multipathing on a SUSE Linux Enterprise Server 10 or 11 series.

Note: This example lists the available storage systems and LUNs for a specific session. To view the details of all the sessions, you use the iscsiadm -m session -P 3 command.
# iscsiadm -m session --sid=N -P 3 
iSCSI Transport Class version 2.0-724
iscsiadm version 2.0-868
Target: iqn.1992-08.com.netapp:sn.101180456
        Current Portal: 10.72.199.144:3260,1001
        Persistent Portal: 10.72.199.144:3260,1001
                **********
                Interface:
                **********
                Iface Name: default
                Iface Transport: tcp
                Iface Initiatorname:iqn.1996-04.de.suse:lnx.200.109
                Iface IPaddress: 10.72.200.109
                Iface HWaddress: default
                Iface Netdev: default
                SID: 1
                iSCSI Connection State: LOGGED IN
                iSCSI Session State: LOGGED_IN
                Internal iscsid Session State: NO CHANGE
                ************************
                Negotiated iSCSI params:
                ************************
                HeaderDigest: CRC32C
                DataDigest: None
                MaxRecvDataSegmentLength: 131072
                MaxXmitDataSegmentLength: 65536
                FirstBurstLength: 65536
                MaxBurstLength: 65536
                ImmediateData: Yes
                InitialR2T: No
                MaxOutstandingR2T: 1
                ************************
                Attached SCSI devices:
                ************************
                Host Number: 47 State: running
                scsi47 Channel 00 Id 0 Lun: 2
                   Attached scsi disk sdj       State: running
                scsi47 Channel 00 Id 0 Lun: 1
                   Attached scsi disk sdf       State: running
                scsi47 Channel 00 Id 0 Lun: 0
                   Attached scsi disk sdb       State: running

Example of using iscsi-ls command running iSCSI without multipathing on RHEL series system

This example shows sample output from the iscsi-ls -l command when it is issued in a Host Utilities environment that is running the iSCSI protocol without multipathing on a Red Hat Enterprise Linux 4 series system.

# /sbin/iscsi-ls -l
*******************************************************************************
        SFNet iSCSI Driver Version ... 3.6.2 (27-Sep-2004 )
*******************************************************************************
TARGET NAME             : iqn.1992-08.com.netapp:sn.33604646
TARGET ALIAS            :
HOST NO                 : 0
BUS NO                  : 0
TARGET ID               : 0
TARGET ADDRESS          : 10.60.128.100:3260
SESSION STATUS          : ESTABLISHED AT Mon Jan  3 10:05:14 2005
NO. OF PORTALS          : 1
PORTAL ADDRESS 1        : 10.60.128.100:3260,1
SESSION ID              : ISID 00023d000001 TSID 103

DEVICE DETAILS :
--------------
LUN ID : 0
  Vendor: NETAPP Model: LUN Rev: 0.2
  Type:   Direct-Access                    ANSI SCSI revision: 04
  page83 type3: 60a980004f6443745359763759367733
  page83 type1:4e45544150502020204c554e204f644374535976375936773300000000000000
  page80: 4f6443745359763759367733
  Device: /dev/sdb
LUN ID : 1
  Vendor: NETAPP Model: LUN  Rev: 0.2
  Type:   Direct-Access                    ANSI SCSI revision: 04
  page83 type3: 60a980004f644374535976426253674b
  page83 type1:4e45544150502020204c554e204f644374535976426253674b00000000000000
  page80: 4f644374535976426253674b
  Device: /dev/sdc
*******************************************************************************