System information

This command displays the session/device state, session ID (sid), some negotiated parameters, and
the SCSI devices accessible through the session.
For shorter output (for example, to display only the sid-to-node mapping), run:
# iscsiadm -m session -P 0
or
# iscsiadm -m session
These commands print the list of running sessions with the format:
driver [sid] target_ip:port,target_portal_group_tag proper_target_name
Examp le 25.1. O ut p u t o f t h e i sci sad m -m sessi o n comman d
For example:
# iscsiadm -m session
tcp [2] 10.15.84.19:3260,2 iqn.1992-08.com.netapp:sn.33615311
tcp [3] 10.15.85.19:3260,3 iqn.1992-08.com.netapp:sn.33615311
For more information about the iSCSI API, refer to /usr/share/d o c/i scsi -i ni ti ato r-
uti l s-version/R EAD ME.
25.2.2. iSCSI T arget Set up
Ad d a new t arg et
To add a new iSCSI target edit the /etc/tg t/targ ets. co nf configuration file. This file contains
many examples of different configuration options that have been commented out.
A basic target may be defined as:
Examp le 25.2. A basic t arg et
<target iqn.2008-09.com.example:server.target1>
backing-store /srv/images/iscsi-share.img
direct-store /dev/sdd
</target>
This example defines a single target with two LUNs. LUNs are described with either the backing-store
or direct-store directives where backing-store refers to either a file or a block device, and direct-store
refers to local SCSI devices. Device parameters, such as serial numbers and vendor names, will be
passed through to the new iSCSI LUN.
St art in g t h e t g t d service
To start the tgtd service, run:
Chapt er 2 5. O nline St orag e Manag ement
169