Re: [PATCH 1/1] doc: document tgtadm parameters for LUNs and SMC devices. Add example how to configure SMC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please review and apply these documentation patches.

thanks
ronnie sahlberg


On Thu, Apr 1, 2010 at 8:26 PM, ronnie sahlberg
<ronniesahlberg@xxxxxxxxx> wrote:
> Please find attached a patch to tgtadm that fixed numerous smaller
> issues and adds
>
> A section LUN PARAMETERS that describes all lun-specific parameters
> and how to set mode-pages.
> This replicates the first part of README.lu_configuration in the tgtadm manpage.
>
> A section SMC SPECIFIC LUN PARAMETERS that documents all lun
> parameters specific to smc devices.
> This replicates the second half of the README.lu_configuration file.
>
> Finally, since SMC configuration is "tricky", I added to the end of
> the SMC section a copy of the
> instructions on how to set up a fully functional DVD jukebox with two
> blank DVD-R disks
> from README.mmc
>
>
> regards
> ronnie sahlberg
>

Attachment: 0001-Update-the-tgtadm-manpage-and-add-two-new-sections.patch.gz
Description: GNU Zip compressed data

From 79b148687f2ea93381bbdb3278cf36751607c1b7 Mon Sep 17 00:00:00 2001
From: Ronnie Sahlberg <ronniesahlberg@xxxxxxxxx>
Date: Thu, 1 Apr 2010 20:17:07 +1100
Subject: [PATCH] Update the tgtadm manpage and add two new sections:

LUN PARAMETERS that describe parameters that apply to a LUN

SMC SPECIFIC LUN PARAMETERS that describes parameters specific
to the media changed device type.

This now replicates nost of the information from
README.lu_configuration in the more accessible tgtadm manpage.

As an example on how to configure a SMC device at the end of the
SMC section I copied the "how to create a dvd jukebox" example
from README.mmc

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@xxxxxxxxx>
---
 doc/htmlpages/tgtadm.8.html |  213 ++++++++++++++++++++++++---
 doc/manpages/tgtadm.8       |  267 ++++++++++++++++++++++++++++++----
 doc/tgtadm.8.xml            |  347 +++++++++++++++++++++++++++++++++++++++----
 3 files changed, 754 insertions(+), 73 deletions(-)

diff --git a/doc/htmlpages/tgtadm.8.html b/doc/htmlpages/tgtadm.8.html
index 673c8d8..86c11bf 100644
--- a/doc/htmlpages/tgtadm.8.html
+++ b/doc/htmlpages/tgtadm.8.html
@@ -1,40 +1,217 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>tgtadm</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="tgtadm.8"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>tgtadm &#8212; Linux SCSI Target Administration Utility</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">tgtadm [--control-port NNNN] --lld [driver] --op [operation] --mode [mode] [OPTION]...</code> </p></div></div><div class="refsect1" lang="en"><a name="id2476012"></a><h2>DESCRIPTION</h2><p>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>tgtadm</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="tgtadm.8"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>tgtadm &#8212; Linux SCSI Target Administration Utility</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">tgtadm [OPTIONS]...</code>  [-C --control-port &lt;port&gt;] [--lld &lt;driver&gt;] [--op &lt;operation&gt;] [--mode &lt;mode&gt;] [--tid &lt;tid&gt;] [-T --targetname &lt;targetname&gt;] [-Y --device-type &lt;type&gt;] [--lun &lt;lun&gt;] [--backing-store &lt;path&gt;] [--initiator-address &lt;address&gt;] [--name &lt;parameter&gt;] [--value &lt;value&gt;] [--params &lt;param=value[,param=value...]&gt;] [--help]</p></div></div><div class="refsect1" lang="en"><a name="id2476151"></a><h2>DESCRIPTION</h2><p>
       tgtadm is used to monitor and modify everything about Linux SCSI target
       software: targets, volumes, etc.
-    </p></div><div class="refsect1" lang="en"><a name="id2476023"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term"><code class="option">--control-port NNNN</code></span></dt><dd><p>
+    </p></div><div class="refsect1" lang="en"><a name="id2476163"></a><h2>OPTIONS</h2><div class="variablelist"><pre class="screen">
+Possible device-types are:
+    disk    : emulate a disk device
+    tape    : emulate a tape reader
+    ssc     : same as tape
+    cd      : emulate a DVD drive
+    changer : emulate a media changer device
+      </pre><dl><dt><span class="term"><code class="option">-C, --control-port=&lt;port&gt;</code></span></dt><dd><p>
 	    It is possible to run multiple concurrent instances of tgtd
 	    on a host. This argument is used to control which instance
 	    the tgtadm command will operate on.
+          </p></dd><dt><span class="term"><code class="option">-Y, --device-type=&lt;type&gt;</code></span></dt><dd><p>
+	    When creating a LUN, this parameter specifies the type of device
+	    to create. Default is disk.
           </p></dd><dt><span class="term"><code class="option">--lld [driver] --op new --mode target --tid=[id] --targetname [name]</code></span></dt><dd><p>
-	    add a new target with [id] and [name].
+	    Add a new target with [id] and [name].
           </p></dd><dt><span class="term"><code class="option">--lld [driver] --op delete --mode target --tid=[id]</code></span></dt><dd><p>
-	    delete specific target with [id]. The target must have no active I_T nexus.
+	    Delete specific target with [id]. The target must have no active I_T nexus.
           </p></dd><dt><span class="term"><code class="option">--lld [driver] --op show --mode target</code></span></dt><dd><p>
-	    show all the targets.
+	    Show all the targets.
           </p></dd><dt><span class="term"><code class="option">--lld [driver] --op show --mode target --tid=[id]</code></span></dt><dd><p>
-	    show target parameters of a target with [id].
+	    Show target parameters of a target with [id].
           </p></dd><dt><span class="term"><code class="option">--lld [driver] --op new --mode=logicalunit --tid=[id] --lun=[lun] --backing-store [path]</code></span></dt><dd><p>
-	    add a new logical unit with [lun] to specific target with [id]. The
+	    Add a new logical unit with [lun] to specific target with [id]. The
 	    logical unit is offered to the initiators. [path] must be block device
 	    files (including LVM and RAID devices) or regular files. lun0 is
 	    reserved for a special device automatically created.
           </p></dd><dt><span class="term"><code class="option">--lld [driver] --op delete --mode=logicalunit --tid=[id] --lun=[lun]</code></span></dt><dd><p>
-	    delete specific logical unit with [lun] that the target with [id] has.
+	    Delete specific logical unit with [lun] that the target with [id] has.
           </p></dd><dt><span class="term"><code class="option">--lld [driver] --op bind --mode=target --tid=[id] --initiator-address=[address]</code></span></dt><dd><p>
-	    add the address to the access lists of the target with [id]. Initiators
+	    Add the address to the access lists of the target with [id]. Initiators
 	    with the address can access to the target. 'ALL' is a special address
 	    to allow all initiators to access to a target.
           </p></dd><dt><span class="term"><code class="option">--lld [driver] --op unbind --mode=target --tid=[id] --initiator-address=[address]</code></span></dt><dd><p>
-	    delete the address from the access lists of the target with [id].
+	    Delete the address from the access lists of the target with [id].
           </p></dd><dt><span class="term"><code class="option">--lld [driver] --op update --mode=target --tid=[id] --name=[parameter] --value=[value]</code></span></dt><dd><p>
-	    change the value of [parameter] of the target with [id] to [value].
-          </p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>
-	    display version and exit.
+	    Change the value of [parameter] of the target with [id] to [value].
+          </p></dd><dt><span class="term"><code class="option">--lld [driver] --op update --mode=target --tid=[id] --params parameter=value[,...]</code></span></dt><dd><p>
+	    Sets/changes the value of one or more parameters.
           </p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>
-	    display a list of available options and exits.
-          </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2476223"></a><h2>iSNS</h2><p>
+	    Display a list of available options and exits.
+          </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2476392"></a><h2>LUN PARAMETERS</h2><p>
+      These parameters are only applicable for "--mode logicalunit".
+    </p><div class="variablelist"><pre class="screen">
+Example:
+
+tgtadm --lld iscsi --mode logicalunit --op update \
+       --tid &lt;TID&gt; --lun &lt;LUN&gt; \
+       --params vendor_id=TGTD,product_id=VirtualHD,product_rev=0103
+      </pre><pre class="screen">
+Example:
+
+tgtadm --lld iscsi --mode logicalunit --op update \
+       --tid 1 --lun 1 \
+       --params removable=1,sense_format=1,online=1
+      </pre><pre class="screen">
+Examples:
+
+Create mode page '2', subpage 0 and 14 bytes of data.
+This is Disconnect-Reconnect mode page.
+
+tgtadm --mode logicalunit --op update --tid 1 --lun 2 \
+         --params mode_page=2:0:14:0x80:0x80:0:0xa:0:0:0:0:0:0:0:0:0:0
+
+
+Create mode page '10', subpage 0 and 10 bytes of data.
+This is Control Extension mode page.
+
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 \
+         --params mode_page=10:0:10:2:0:0:0:0:0:0:0:2:0
+
+
+Create mode page '0x1c', subpage 0 and 10 bytes of data.
+This is Informational Exceptions Control mode page.
+
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 \
+         --params mode_page=0x1c:0:10:8:0:0:0:0:0:0:0:0:0
+      </pre><dl><dt><span class="term"><code class="option">vendor_id=&lt;string&gt;</code></span></dt><dd><p>
+	    This parameter sets the Vendor Identification string that a LUN
+	    will report in INQURY data.
+          </p></dd><dt><span class="term"><code class="option">product_id=&lt;string&gt;</code></span></dt><dd><p>
+	    This parameter sets the Product Identification string that a LUN
+	    will report in INQURY data.
+          </p></dd><dt><span class="term"><code class="option">product_rev=&lt;string&gt;</code></span></dt><dd><p>
+	    This parameter sets the Product Revision string that a LUN
+	    will report in INQURY data.
+          </p></dd><dt><span class="term"><code class="option">removable=&lt;0|1&gt;</code></span></dt><dd><p>
+	    This can be used to override/change the default setting for
+	    the removable flag. Disk devices default to non-removable while
+	    DVD and TAPE devices default to removable.
+          </p></dd><dt><span class="term"><code class="option">sense_format=&lt;0|1&gt;</code></span></dt><dd><p>
+	    This flag controls the format of sense data that the device will
+	    return. 0 = Clasic sense format, 1 = Support descriptor format.
+           </p></dd><dt><span class="term"><code class="option">online=&lt;0|1&gt;</code></span></dt><dd><p>
+	    This controls whether a device is online or not.
+          </p><p>
+	    Devices default to be online when created but can be brought offline
+	    using this parameter. Behaviour of offline devices depend on device
+	    type. An MMC/DVD device that is offline will report that there is
+	    no disk in the unit but the actual MMC/DVD unit itself can still
+	    be communicated with. All other device types will fail all I/O
+	    with a sense code of Not Ready.
+          </p></dd><dt><span class="term"><code class="option">mode_page=&lt;byte-string&gt;</code></span></dt><dd><p>
+	    This parameter is used to set specific mode pages for the device
+	    and the mode page contents. Most devices default to reasonable
+	    default mode pages automatically when the LUN is created, but this
+	    allows special settings.
+          </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2476572"></a><h2>SMC SPECIFIC LUN PARAMETERS</h2><p>
+      These parameters are only applicable for luns that are of type "changer"
+      i.e. the media changer device for a DVD Jukebox or a Virtual Tape Library.
+    </p><div class="variablelist"><pre class="screen">
+Example: How to create a DVD jukebox with eight disk trays and
+two empty DVD-R disks.
+
+
+# Create a target
+tgtadm --lld iscsi --mode target --op new --tid 1 -T iqn.2007-03:virtual-dvd:`hostname`
+
+# Create a DVD drive and give it a nice name
+# The dvd starts out without a backing store file, i.e. no disk loaded
+tgtadm --op new --mode logicalunit --tid 1 --lun 1 -Y cd
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 1 --params vendor_id=STGT_DVD,product_id=DVD101,product_rev=0010,scsi_sn=STGTDVD01,removable=1
+
+# We need a backend store file for the media changer
+if [ ! -f $HOME/smc ]; then
+	dd if=/dev/zero of=$HOME/smc bs=1k count=1
+fi
+
+# Create the SMC device and give it a nice name
+tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 2 -b $HOME/smc --device-type=changer
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params vendor_id=STK,product_id=L700,product_rev=0010,scsi_sn=XYZZY_0,removable=1
+
+# Add a Data Transfer devices (1 drive)
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=4,start_address=1,quantity=1
+
+# Specify that the DVD above (LUN 1) is the data transfer device we created
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=4,address=1,tid=1,lun=1
+
+# Medium Transport Elements (robot arm / picker)
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=1,start_address=16,quantity=1
+
+# define path to virtual media
+VTL=${HOME}/vtl
+mkdir -p ${VTL}
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params media_home=${VTL}
+
+# Storage Elements - 8 starting at addr 1024
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=2,start_address=1024,quantity=8
+
+# Add 'media' to slots 1 and 2 and leave the other 6 slots empty
+# slot 1
+# Create/"touch" empty writeable virtual DVD-R media
+touch ${VTL}/DISK_001
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=2,address=1024,barcode=DISK_001,sides=1
+
+# slot 2
+touch ${VTL}/DISK_002
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=2,address=1025,barcode=DISK_002,sides=1
+
+# Allow ALL initiators to connect to this target
+tgtadm --lld iscsi --mode target --op bind --tid 1 -I ALL
+
+# Show all our good work.
+tgtadm --lld iscsi --mode target --op show
+      </pre><dl><dt><span class="term"><code class="option">element_type=&lt;1|2|3|4&gt;</code></span></dt><dd><p>
+	    This controls which type of element a certain slot in the 
+	    jukebox/vtl is.
+          </p><pre class="screen">
+Slot types:
+ 1 -&gt; Medium Transport (picker arm)
+ 2 -&gt; Storage Element
+ 3 -&gt; Import/Export Element
+ 4 -&gt; Data Transfer device (CD drive, tape drive, MO drive etc)
+	  </pre></dd><dt><span class="term"><code class="option">address=&lt;1-65535&gt;</code></span></dt><dd><p>
+	    This is used to create/operate on a single slot.
+	    Address specifies the slot on which to perform the operation.
+          </p></dd><dt><span class="term"><code class="option">start_address=&lt;1-65535&gt;,quantity=&lt;1--65535&gt;</code></span></dt><dd><p>
+	    This is used to create/operate on an entire range of slots at once.
+	    Start_address specifies the first address to operate on and
+	    quantity specifies the number of consequtive slots.
+          </p></dd><dt><span class="term"><code class="option">sides=&lt;1|2&gt;</code></span></dt><dd><p>
+	    When creating storage elements, i.e. "element_type=2", this
+	    parameter specifies if the media has 1 or two sides to hold data.
+          </p></dd><dt><span class="term"><code class="option">barcode=&lt;string&gt;</code></span></dt><dd><p>
+	    This is used to assign a barcode to an element.
+          </p></dd><dt><span class="term"><code class="option">media_home=&lt;string&gt;</code></span></dt><dd><p>
+	    This parameter specifies a directory where all virtual media
+	    for the dvd/tape device elements are stored.
+          </p><p>
+	    To assign a media image file to a storage element slot,
+	    you assign "barcode" to be the name of the image file in
+	    the "media_home" directory.
+          </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2476743"></a><h2>iSNS PARAMETERS</h2><p>
       iSNS configuration for a target is by using the tgtadm command.
-    </p><div class="variablelist"><dl><dt><span class="term"><code class="option">iSNSServerIP</code></span></dt><dd><p>
+    </p><div class="variablelist"><pre class="screen">
+Example:
+
+tgtadm --op update --mode sys --name iSNSServerIP -v 192.168.11.133
+      </pre><pre class="screen">
+Example:
+
+tgtadm --op update --mode sys --name iSNS -v On
+      </pre><pre class="screen">
+Example:
+
+tgtadm --op update --mode sys --name iSNSServerPort -v 3205
+      </pre><pre class="screen">
+Example:
+
+tgtadm --op update --mode sys --name iSNSAccessControl -v Off
+      </pre><dl><dt><span class="term"><code class="option">iSNSServerIP</code></span></dt><dd><p>
 	    This specifies the IP address of the iSNS server. TGTD only
 	    supprots one iSNS server.
           </p></dd><dt><span class="term"><code class="option">iSNS</code></span></dt><dd><p>
@@ -43,9 +220,9 @@
 	    This setting specifies the port to use for iSNS.
           </p></dd><dt><span class="term"><code class="option">iSNSAccessControl</code></span></dt><dd><p>
 	    Enable/disable access control for iSNS.
-          </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2476322"></a><h2>SEE ALSO</h2><p>
+          </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2476842"></a><h2>SEE ALSO</h2><p>
       tgtd(8), tgt-admin(8), tgtimg(8), tgt-setup-lun(8).
       <a class="ulink" href="http://stgt.sourceforge.net/"; target="_top">http://stgt.sourceforge.net/</a>
-    </p></div><div class="refsect1" lang="en"><a name="id2476336"></a><h2>REPORTING BUGS</h2><p>
+    </p></div><div class="refsect1" lang="en"><a name="id2476856"></a><h2>REPORTING BUGS</h2><p>
       Report bugs to &lt;stgt@xxxxxxxxxxxxxxx&gt;
     </p></div></div></body></html>
diff --git a/doc/manpages/tgtadm.8 b/doc/manpages/tgtadm.8
index 7b9a708..d612a67 100644
--- a/doc/manpages/tgtadm.8
+++ b/doc/manpages/tgtadm.8
@@ -1,11 +1,11 @@
 .\"     Title: tgtadm
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 03/31/2010
+.\"      Date: 04/01/2010
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "TGTADM" "8" "03/31/2010" "" ""
+.TH "TGTADM" "8" "04/01/2010" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -13,129 +13,342 @@
 .SH "NAME"
 tgtadm - Linux SCSI Target Administration Utility
 .SH "SYNOPSIS"
-.HP 87
-\fBtgtadm [\-\-control\-port NNNN] \-\-lld [driver] \-\-op [operation] \-\-mode [mode] [OPTION]\.\.\.\fR
+.HP 20
+\fBtgtadm [OPTIONS]\.\.\.\fR [\-C\ \-\-control\-port\ <port>] [\-\-lld\ <driver>] [\-\-op\ <operation>] [\-\-mode\ <mode>] [\-\-tid\ <tid>] [\-T\ \-\-targetname\ <targetname>] [\-Y\ \-\-device\-type\ <type>] [\-\-lun\ <lun>] [\-\-backing\-store\ <path>] [\-\-initiator\-address\ <address>] [\-\-name\ <parameter>] [\-\-value\ <value>] [\-\-params\ <param=value[,param=value\.\.\.]>] [\-\-help]
 .SH "DESCRIPTION"
 .PP
 tgtadm is used to monitor and modify everything about Linux SCSI target software: targets, volumes, etc\.
 .SH "OPTIONS"
 .PP
-\fB\-\-control\-port NNNN\fR
+\fB\-C, \-\-control\-port=<port>\fR
 .RS 4
 It is possible to run multiple concurrent instances of tgtd on a host\. This argument is used to control which instance the tgtadm command will operate on\.
 .RE
 .PP
+\fB\-Y, \-\-device\-type=<type>\fR
+.RS 4
+When creating a LUN, this parameter specifies the type of device to create\. Default is disk\.
+.RE
+.sp
+.RS 4
+.nf
+Possible device\-types are:
+    disk    : emulate a disk device
+    tape    : emulate a tape reader
+    ssc     : same as tape
+    cd      : emulate a DVD drive
+    changer : emulate a media changer device
+      
+.fi
+.RE
+.PP
 \fB\-\-lld [driver] \-\-op new \-\-mode target \-\-tid=[id] \-\-targetname [name]\fR
 .RS 4
-add a new target with [id] and [name]\.
+Add a new target with [id] and [name]\.
 .RE
 .PP
 \fB\-\-lld [driver] \-\-op delete \-\-mode target \-\-tid=[id]\fR
 .RS 4
-delete specific target with [id]\. The target must have no active I_T nexus\.
+Delete specific target with [id]\. The target must have no active I_T nexus\.
 .RE
 .PP
 \fB\-\-lld [driver] \-\-op show \-\-mode target\fR
 .RS 4
-show all the targets\.
+Show all the targets\.
 .RE
 .PP
 \fB\-\-lld [driver] \-\-op show \-\-mode target \-\-tid=[id]\fR
 .RS 4
-show target parameters of a target with [id]\.
+Show target parameters of a target with [id]\.
 .RE
 .PP
 \fB\-\-lld [driver] \-\-op new \-\-mode=logicalunit \-\-tid=[id] \-\-lun=[lun] \-\-backing\-store [path]\fR
 .RS 4
-add a new logical unit with [lun] to specific target with [id]\. The logical unit is offered to the initiators\. [path] must be block device files (including LVM and RAID devices) or regular files\. lun0 is reserved for a special device automatically created\.
+Add a new logical unit with [lun] to specific target with [id]\. The logical unit is offered to the initiators\. [path] must be block device files (including LVM and RAID devices) or regular files\. lun0 is reserved for a special device automatically created\.
 .RE
 .PP
 \fB\-\-lld [driver] \-\-op delete \-\-mode=logicalunit \-\-tid=[id] \-\-lun=[lun]\fR
 .RS 4
-delete specific logical unit with [lun] that the target with [id] has\.
+Delete specific logical unit with [lun] that the target with [id] has\.
 .RE
 .PP
 \fB\-\-lld [driver] \-\-op bind \-\-mode=target \-\-tid=[id] \-\-initiator\-address=[address]\fR
 .RS 4
-add the address to the access lists of the target with [id]\. Initiators with the address can access to the target\. \'ALL\' is a special address to allow all initiators to access to a target\.
+Add the address to the access lists of the target with [id]\. Initiators with the address can access to the target\. \'ALL\' is a special address to allow all initiators to access to a target\.
 .RE
 .PP
 \fB\-\-lld [driver] \-\-op unbind \-\-mode=target \-\-tid=[id] \-\-initiator\-address=[address]\fR
 .RS 4
-delete the address from the access lists of the target with [id]\.
+Delete the address from the access lists of the target with [id]\.
 .RE
 .PP
 \fB\-\-lld [driver] \-\-op update \-\-mode=target \-\-tid=[id] \-\-name=[parameter] \-\-value=[value]\fR
 .RS 4
-change the value of [parameter] of the target with [id] to [value]\.
+Change the value of [parameter] of the target with [id] to [value]\.
 .RE
 .PP
-\fB\-\-version\fR
+\fB\-\-lld [driver] \-\-op update \-\-mode=target \-\-tid=[id] \-\-params parameter=value[,\.\.\.]\fR
 .RS 4
-display version and exit\.
+Sets/changes the value of one or more parameters\.
 .RE
 .PP
 \fB\-\-help\fR
 .RS 4
-display a list of available options and exits\.
+Display a list of available options and exits\.
+.RE
+.SH "LUN PARAMETERS"
+.PP
+These parameters are only applicable for "\-\-mode logicalunit"\.
+.PP
+\fBvendor_id=<string>\fR
+.RS 4
+This parameter sets the Vendor Identification string that a LUN will report in INQURY data\.
+.RE
+.PP
+\fBproduct_id=<string>\fR
+.RS 4
+This parameter sets the Product Identification string that a LUN will report in INQURY data\.
 .RE
-.SH "ISNS"
+.PP
+\fBproduct_rev=<string>\fR
+.RS 4
+This parameter sets the Product Revision string that a LUN will report in INQURY data\.
+.RE
+.sp
+.RS 4
+.nf
+Example:
+
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \e
+       \-\-tid <TID> \-\-lun <LUN> \e
+       \-\-params vendor_id=TGTD,product_id=VirtualHD,product_rev=0103
+      
+.fi
+.RE
+.PP
+\fBremovable=<0|1>\fR
+.RS 4
+This can be used to override/change the default setting for the removable flag\. Disk devices default to non\-removable while DVD and TAPE devices default to removable\.
+.RE
+.PP
+\fBsense_format=<0|1>\fR
+.RS 4
+This flag controls the format of sense data that the device will return\. 0 = Clasic sense format, 1 = Support descriptor format\.
+.RE
+.PP
+\fBonline=<0|1>\fR
+.RS 4
+This controls whether a device is online or not\.
+.sp
+Devices default to be online when created but can be brought offline using this parameter\. Behaviour of offline devices depend on device type\. An MMC/DVD device that is offline will report that there is no disk in the unit but the actual MMC/DVD unit itself can still be communicated with\. All other device types will fail all I/O with a sense code of Not Ready\.
+.RE
+.sp
+.RS 4
+.nf
+Example:
+
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \e
+       \-\-tid 1 \-\-lun 1 \e
+       \-\-params removable=1,sense_format=1,online=1
+      
+.fi
+.RE
+.PP
+\fBmode_page=<byte\-string>\fR
+.RS 4
+This parameter is used to set specific mode pages for the device and the mode page contents\. Most devices default to reasonable default mode pages automatically when the LUN is created, but this allows special settings\.
+.RE
+.sp
+.RS 4
+.nf
+Examples:
+
+Create mode page \'2\', subpage 0 and 14 bytes of data\.
+This is Disconnect\-Reconnect mode page\.
+
+tgtadm \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 2 \e
+         \-\-params mode_page=2:0:14:0x80:0x80:0:0xa:0:0:0:0:0:0:0:0:0:0
+
+
+Create mode page \'10\', subpage 0 and 10 bytes of data\.
+This is Control Extension mode page\.
+
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 2 \e
+         \-\-params mode_page=10:0:10:2:0:0:0:0:0:0:0:2:0
+
+
+Create mode page \'0x1c\', subpage 0 and 10 bytes of data\.
+This is Informational Exceptions Control mode page\.
+
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 2 \e
+         \-\-params mode_page=0x1c:0:10:8:0:0:0:0:0:0:0:0:0
+      
+.fi
+.RE
+.SH "SMC SPECIFIC LUN PARAMETERS"
+.PP
+These parameters are only applicable for luns that are of type "changer" i\.e\. the media changer device for a DVD Jukebox or a Virtual Tape Library\.
+.PP
+\fBelement_type=<1|2|3|4>\fR
+.RS 4
+This controls which type of element a certain slot in the jukebox/vtl is\.
+.sp
+.RS 4
+.nf
+Slot types:
+ 1 \-> Medium Transport (picker arm)
+ 2 \-> Storage Element
+ 3 \-> Import/Export Element
+ 4 \-> Data Transfer device (CD drive, tape drive, MO drive etc)
+	  
+.fi
+.RE
+.RE
+.PP
+\fBaddress=<1\-65535>\fR
+.RS 4
+This is used to create/operate on a single slot\. Address specifies the slot on which to perform the operation\.
+.RE
+.PP
+\fBstart_address=<1\-65535>,quantity=<1\-\-65535>\fR
+.RS 4
+This is used to create/operate on an entire range of slots at once\. Start_address specifies the first address to operate on and quantity specifies the number of consequtive slots\.
+.RE
+.PP
+\fBsides=<1|2>\fR
+.RS 4
+When creating storage elements, i\.e\. "element_type=2", this parameter specifies if the media has 1 or two sides to hold data\.
+.RE
+.PP
+\fBbarcode=<string>\fR
+.RS 4
+This is used to assign a barcode to an element\.
+.RE
+.PP
+\fBmedia_home=<string>\fR
+.RS 4
+This parameter specifies a directory where all virtual media for the dvd/tape device elements are stored\.
+.sp
+To assign a media image file to a storage element slot, you assign "barcode" to be the name of the image file in the "media_home" directory\.
+.RE
+.sp
+.RS 4
+.nf
+Example: How to create a DVD jukebox with eight disk trays and
+two empty DVD\-R disks\.
+
+
+# Create a target
+tgtadm \-\-lld iscsi \-\-mode target \-\-op new \-\-tid 1 \-T iqn\.2007\-03:virtual\-dvd:`hostname`
+
+# Create a DVD drive and give it a nice name
+# The dvd starts out without a backing store file, i\.e\. no disk loaded
+tgtadm \-\-op new \-\-mode logicalunit \-\-tid 1 \-\-lun 1 \-Y cd
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 1 \-\-params vendor_id=STGT_DVD,product_id=DVD101,product_rev=0010,scsi_sn=STGTDVD01,removable=1
+
+# We need a backend store file for the media changer
+if [ ! \-f $HOME/smc ]; then
+	dd if=/dev/zero of=$HOME/smc bs=1k count=1
+fi
+
+# Create the SMC device and give it a nice name
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op new \-\-tid 1 \-\-lun 2 \-b $HOME/smc \-\-device\-type=changer
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 2 \-\-params vendor_id=STK,product_id=L700,product_rev=0010,scsi_sn=XYZZY_0,removable=1
+
+# Add a Data Transfer devices (1 drive)
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 2 \-\-params element_type=4,start_address=1,quantity=1
+
+# Specify that the DVD above (LUN 1) is the data transfer device we created
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 2 \-\-params element_type=4,address=1,tid=1,lun=1
+
+# Medium Transport Elements (robot arm / picker)
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 2 \-\-params element_type=1,start_address=16,quantity=1
+
+# define path to virtual media
+VTL=${HOME}/vtl
+mkdir \-p ${VTL}
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 2 \-\-params media_home=${VTL}
+
+# Storage Elements \- 8 starting at addr 1024
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 2 \-\-params element_type=2,start_address=1024,quantity=8
+
+# Add \'media\' to slots 1 and 2 and leave the other 6 slots empty
+# slot 1
+# Create/"touch" empty writeable virtual DVD\-R media
+touch ${VTL}/DISK_001
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 2 \-\-params element_type=2,address=1024,barcode=DISK_001,sides=1
+
+# slot 2
+touch ${VTL}/DISK_002
+tgtadm \-\-lld iscsi \-\-mode logicalunit \-\-op update \-\-tid 1 \-\-lun 2 \-\-params element_type=2,address=1025,barcode=DISK_002,sides=1
+
+# Allow ALL initiators to connect to this target
+tgtadm \-\-lld iscsi \-\-mode target \-\-op bind \-\-tid 1 \-I ALL
+
+# Show all our good work\.
+tgtadm \-\-lld iscsi \-\-mode target \-\-op show
+      
+.fi
+.RE
+.SH "ISNS PARAMETERS"
 .PP
 iSNS configuration for a target is by using the tgtadm command\.
 .PP
 \fBiSNSServerIP\fR
 .RS 4
 This specifies the IP address of the iSNS server\. TGTD only supprots one iSNS server\.
+.RE
 .sp
 .RS 4
 .nf
 Example:
 
 tgtadm \-\-op update \-\-mode sys \-\-name iSNSServerIP \-v 192\.168\.11\.133
-	
+      
 .fi
 .RE
-.RE
 .PP
 \fBiSNS\fR
 .RS 4
 This setting enables(on)/disables(off) iSNS\.
+.RE
 .sp
 .RS 4
 .nf
-Example activating iSNS once configured:
+Example:
 
 tgtadm \-\-op update \-\-mode sys \-\-name iSNS \-v On
-	
+      
 .fi
 .RE
-.RE
 .PP
 \fBiSNSServerPort\fR
 .RS 4
 This setting specifies the port to use for iSNS\.
+.RE
 .sp
 .RS 4
 .nf
 Example:
 
 tgtadm \-\-op update \-\-mode sys \-\-name iSNSServerPort \-v 3205
-	
+      
 .fi
 .RE
-.RE
 .PP
 \fBiSNSAccessControl\fR
 .RS 4
 Enable/disable access control for iSNS\.
+.RE
 .sp
 .RS 4
 .nf
+Example:
+
 tgtadm \-\-op update \-\-mode sys \-\-name iSNSAccessControl \-v Off
-	
+      
 .fi
 .RE
-.RE
 .SH "SEE ALSO"
 .PP
 tgtd(8), tgt\-admin(8), tgtimg(8), tgt\-setup\-lun(8)\.
diff --git a/doc/tgtadm.8.xml b/doc/tgtadm.8.xml
index 7a53e4f..851e65d 100644
--- a/doc/tgtadm.8.xml
+++ b/doc/tgtadm.8.xml
@@ -14,7 +14,21 @@
 
 <refsynopsisdiv>
 	<cmdsynopsis>
-		<command>tgtadm [--control-port NNNN] --lld [driver] --op [operation] --mode [mode] [OPTION]...</command>
+		<command>tgtadm [OPTIONS]...</command>
+		<arg choice="opt">-C --control-port &lt;port&gt;</arg>
+		<arg choice="opt">--lld &lt;driver&gt;</arg>
+		<arg choice="opt">--op &lt;operation&gt;</arg>
+		<arg choice="opt">--mode &lt;mode&gt;</arg>
+		<arg choice="opt">--tid &lt;tid&gt;</arg>
+		<arg choice="opt">-T --targetname &lt;targetname&gt;</arg>
+		<arg choice="opt">-Y --device-type &lt;type&gt;</arg>
+		<arg choice="opt">--lun &lt;lun&gt;</arg>
+		<arg choice="opt">--backing-store &lt;path&gt;</arg>
+		<arg choice="opt">--initiator-address &lt;address&gt;</arg>
+		<arg choice="opt">--name &lt;parameter&gt;</arg>
+		<arg choice="opt">--value &lt;value&gt;</arg>
+		<arg choice="opt">--params &lt;param=value[,param=value...]&gt;</arg>
+		<arg choice="opt">--help</arg>
 	</cmdsynopsis>
 	
 </refsynopsisdiv>
@@ -31,7 +45,7 @@
     <title>OPTIONS</title>
 
     <variablelist>
-      <varlistentry><term><option>--control-port NNNN</option></term>
+      <varlistentry><term><option>-C, --control-port=&lt;port&gt;</option></term>
         <listitem>
           <para>
 	    It is possible to run multiple concurrent instances of tgtd
@@ -41,10 +55,27 @@
         </listitem>
       </varlistentry>
 
+      <varlistentry><term><option>-Y, --device-type=&lt;type&gt;</option></term>
+        <listitem>
+          <para>
+	    When creating a LUN, this parameter specifies the type of device
+	    to create. Default is disk.
+          </para>
+        </listitem>
+      </varlistentry>
+      <screen format="linespecific">
+Possible device-types are:
+    disk    : emulate a disk device
+    tape    : emulate a tape reader
+    ssc     : same as tape
+    cd      : emulate a DVD drive
+    changer : emulate a media changer device
+      </screen>
+
       <varlistentry><term><option>--lld [driver] --op new --mode target --tid=[id] --targetname [name]</option></term>
         <listitem>
           <para>
-	    add a new target with [id] and [name].
+	    Add a new target with [id] and [name].
           </para>
         </listitem>
       </varlistentry>
@@ -52,7 +83,7 @@
       <varlistentry><term><option>--lld [driver] --op delete --mode target --tid=[id]</option></term>
         <listitem>
           <para>
-	    delete specific target with [id]. The target must have no active I_T nexus.
+	    Delete specific target with [id]. The target must have no active I_T nexus.
           </para>
         </listitem>
       </varlistentry>
@@ -60,7 +91,7 @@
       <varlistentry><term><option>--lld [driver] --op show --mode target</option></term>
         <listitem>
           <para>
-	    show all the targets.
+	    Show all the targets.
           </para>
         </listitem>
       </varlistentry>
@@ -68,7 +99,7 @@
       <varlistentry><term><option>--lld [driver] --op show --mode target --tid=[id]</option></term>
         <listitem>
           <para>
-	    show target parameters of a target with [id].
+	    Show target parameters of a target with [id].
           </para>
         </listitem>
       </varlistentry>
@@ -76,7 +107,7 @@
       <varlistentry><term><option>--lld [driver] --op new --mode=logicalunit --tid=[id] --lun=[lun] --backing-store [path]</option></term>
         <listitem>
           <para>
-	    add a new logical unit with [lun] to specific target with [id]. The
+	    Add a new logical unit with [lun] to specific target with [id]. The
 	    logical unit is offered to the initiators. [path] must be block device
 	    files (including LVM and RAID devices) or regular files. lun0 is
 	    reserved for a special device automatically created.
@@ -87,7 +118,7 @@
       <varlistentry><term><option>--lld [driver] --op delete --mode=logicalunit --tid=[id] --lun=[lun]</option></term>
         <listitem>
           <para>
-	    delete specific logical unit with [lun] that the target with [id] has.
+	    Delete specific logical unit with [lun] that the target with [id] has.
           </para>
         </listitem>
       </varlistentry>
@@ -95,7 +126,7 @@
       <varlistentry><term><option>--lld [driver] --op bind --mode=target --tid=[id] --initiator-address=[address]</option></term>
         <listitem>
           <para>
-	    add the address to the access lists of the target with [id]. Initiators
+	    Add the address to the access lists of the target with [id]. Initiators
 	    with the address can access to the target. 'ALL' is a special address
 	    to allow all initiators to access to a target.
           </para>
@@ -105,7 +136,7 @@
       <varlistentry><term><option>--lld [driver] --op unbind --mode=target --tid=[id] --initiator-address=[address]</option></term>
         <listitem>
           <para>
-	    delete the address from the access lists of the target with [id].
+	    Delete the address from the access lists of the target with [id].
           </para>
         </listitem>
       </varlistentry>
@@ -113,15 +144,15 @@
       <varlistentry><term><option>--lld [driver] --op update --mode=target --tid=[id] --name=[parameter] --value=[value]</option></term>
         <listitem>
           <para>
-	    change the value of [parameter] of the target with [id] to [value].
+	    Change the value of [parameter] of the target with [id] to [value].
           </para>
         </listitem>
       </varlistentry>
 
-      <varlistentry><term><option>--version</option></term>
+      <varlistentry><term><option>--lld [driver] --op update --mode=target --tid=[id] --params parameter=value[,...]</option></term>
         <listitem>
           <para>
-	    display version and exit.
+	    Sets/changes the value of one or more parameters.
           </para>
         </listitem>
       </varlistentry>
@@ -129,15 +160,273 @@
       <varlistentry><term><option>--help</option></term>
         <listitem>
           <para>
-	    display a list of available options and exits.
+	    Display a list of available options and exits.
+          </para>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
+  </refsect1>
+
+  <refsect1><title>LUN PARAMETERS</title>
+    <para>
+      These parameters are only applicable for "--mode logicalunit".
+    </para>
+    <variablelist>
+
+      <varlistentry><term><option>vendor_id=&lt;string&gt;</option></term>
+        <listitem>
+          <para>
+	    This parameter sets the Vendor Identification string that a LUN
+	    will report in INQURY data.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry><term><option>product_id=&lt;string&gt;</option></term>
+        <listitem>
+          <para>
+	    This parameter sets the Product Identification string that a LUN
+	    will report in INQURY data.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry><term><option>product_rev=&lt;string&gt;</option></term>
+        <listitem>
+          <para>
+	    This parameter sets the Product Revision string that a LUN
+	    will report in INQURY data.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <screen format="linespecific">
+Example:
+
+tgtadm --lld iscsi --mode logicalunit --op update \
+       --tid &lt;TID&gt; --lun &lt;LUN&gt; \
+       --params vendor_id=TGTD,product_id=VirtualHD,product_rev=0103
+      </screen>
+
+
+      <varlistentry><term><option>removable=&lt;0|1&gt;</option></term>
+        <listitem>
+          <para>
+	    This can be used to override/change the default setting for
+	    the removable flag. Disk devices default to non-removable while
+	    DVD and TAPE devices default to removable.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry><term><option>sense_format=&lt;0|1&gt;</option></term>
+        <listitem>
+          <para>
+	    This flag controls the format of sense data that the device will
+	    return. 0 = Clasic sense format, 1 = Support descriptor format.
+           </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry><term><option>online=&lt;0|1&gt;</option></term>
+        <listitem>
+          <para>
+	    This controls whether a device is online or not.
+          </para>
+          <para>
+	    Devices default to be online when created but can be brought offline
+	    using this parameter. Behaviour of offline devices depend on device
+	    type. An MMC/DVD device that is offline will report that there is
+	    no disk in the unit but the actual MMC/DVD unit itself can still
+	    be communicated with. All other device types will fail all I/O
+	    with a sense code of Not Ready.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <screen format="linespecific">
+Example:
+
+tgtadm --lld iscsi --mode logicalunit --op update \
+       --tid 1 --lun 1 \
+       --params removable=1,sense_format=1,online=1
+      </screen>
+
+      <varlistentry><term><option>mode_page=&lt;byte-string&gt;</option></term>
+        <listitem>
+          <para>
+	    This parameter is used to set specific mode pages for the device
+	    and the mode page contents. Most devices default to reasonable
+	    default mode pages automatically when the LUN is created, but this
+	    allows special settings.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <screen format="linespecific">
+Examples:
+
+Create mode page '2', subpage 0 and 14 bytes of data.
+This is Disconnect-Reconnect mode page.
+
+tgtadm --mode logicalunit --op update --tid 1 --lun 2 \
+         --params mode_page=2:0:14:0x80:0x80:0:0xa:0:0:0:0:0:0:0:0:0:0
+
+
+Create mode page '10', subpage 0 and 10 bytes of data.
+This is Control Extension mode page.
+
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 \
+         --params mode_page=10:0:10:2:0:0:0:0:0:0:0:2:0
+
+
+Create mode page '0x1c', subpage 0 and 10 bytes of data.
+This is Informational Exceptions Control mode page.
+
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 \
+         --params mode_page=0x1c:0:10:8:0:0:0:0:0:0:0:0:0
+      </screen>
+
+
+    </variablelist>
+  </refsect1>
+
+
+  <refsect1><title>SMC SPECIFIC LUN PARAMETERS</title>
+    <para>
+      These parameters are only applicable for luns that are of type "changer"
+      i.e. the media changer device for a DVD Jukebox or a Virtual Tape Library.
+    </para>
+    <variablelist>
+
+      <varlistentry><term><option>element_type=&lt;1|2|3|4&gt;</option></term>
+        <listitem>
+          <para>
+	    This controls which type of element a certain slot in the 
+	    jukebox/vtl is.
           </para>
+	  <screen format="linespecific">
+Slot types:
+ 1 -> Medium Transport (picker arm)
+ 2 -> Storage Element
+ 3 -> Import/Export Element
+ 4 -> Data Transfer device (CD drive, tape drive, MO drive etc)
+	  </screen>
         </listitem>
       </varlistentry>
 
+      <varlistentry><term><option>address=&lt;1-65535&gt;</option></term>
+        <listitem>
+          <para>
+	    This is used to create/operate on a single slot.
+	    Address specifies the slot on which to perform the operation.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry><term><option>start_address=&lt;1-65535&gt;,quantity=&lt;1--65535&gt;</option></term>
+        <listitem>
+          <para>
+	    This is used to create/operate on an entire range of slots at once.
+	    Start_address specifies the first address to operate on and
+	    quantity specifies the number of consequtive slots.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry><term><option>sides=&lt;1|2&gt;</option></term>
+        <listitem>
+          <para>
+	    When creating storage elements, i.e. "element_type=2", this
+	    parameter specifies if the media has 1 or two sides to hold data.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry><term><option>barcode=&lt;string&gt;</option></term>
+        <listitem>
+          <para>
+	    This is used to assign a barcode to an element.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry><term><option>media_home=&lt;string&gt;</option></term>
+        <listitem>
+          <para>
+	    This parameter specifies a directory where all virtual media
+	    for the dvd/tape device elements are stored.
+          </para>
+          <para>
+	    To assign a media image file to a storage element slot,
+	    you assign "barcode" to be the name of the image file in
+	    the "media_home" directory.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <screen format="linespecific">
+Example: How to create a DVD jukebox with eight disk trays and
+two empty DVD-R disks.
+
+
+# Create a target
+tgtadm --lld iscsi --mode target --op new --tid 1 -T iqn.2007-03:virtual-dvd:`hostname`
+
+# Create a DVD drive and give it a nice name
+# The dvd starts out without a backing store file, i.e. no disk loaded
+tgtadm --op new --mode logicalunit --tid 1 --lun 1 -Y cd
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 1 --params vendor_id=STGT_DVD,product_id=DVD101,product_rev=0010,scsi_sn=STGTDVD01,removable=1
+
+# We need a backend store file for the media changer
+if [ ! -f $HOME/smc ]; then
+	dd if=/dev/zero of=$HOME/smc bs=1k count=1
+fi
+
+# Create the SMC device and give it a nice name
+tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 2 -b $HOME/smc --device-type=changer
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params vendor_id=STK,product_id=L700,product_rev=0010,scsi_sn=XYZZY_0,removable=1
+
+# Add a Data Transfer devices (1 drive)
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=4,start_address=1,quantity=1
+
+# Specify that the DVD above (LUN 1) is the data transfer device we created
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=4,address=1,tid=1,lun=1
+
+# Medium Transport Elements (robot arm / picker)
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=1,start_address=16,quantity=1
+
+# define path to virtual media
+VTL=${HOME}/vtl
+mkdir -p ${VTL}
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params media_home=${VTL}
+
+# Storage Elements - 8 starting at addr 1024
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=2,start_address=1024,quantity=8
+
+# Add 'media' to slots 1 and 2 and leave the other 6 slots empty
+# slot 1
+# Create/"touch" empty writeable virtual DVD-R media
+touch ${VTL}/DISK_001
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=2,address=1024,barcode=DISK_001,sides=1
+
+# slot 2
+touch ${VTL}/DISK_002
+tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=2,address=1025,barcode=DISK_002,sides=1
+
+# Allow ALL initiators to connect to this target
+tgtadm --lld iscsi --mode target --op bind --tid 1 -I ALL
+
+# Show all our good work.
+tgtadm --lld iscsi --mode target --op show
+      </screen>
+
     </variablelist>
   </refsect1>
 
-  <refsect1><title>iSNS</title>
+
+  <refsect1><title>iSNS PARAMETERS</title>
     <para>
       iSNS configuration for a target is by using the tgtadm command.
     </para>
@@ -150,12 +439,12 @@
 	    supprots one iSNS server.
           </para>
         </listitem>
-	<screen format="linespecific">
+      </varlistentry>
+      <screen format="linespecific">
 Example:
 
 tgtadm --op update --mode sys --name iSNSServerIP -v 192.168.11.133
-	</screen>
-      </varlistentry>
+      </screen>
 
       <varlistentry><term><option>iSNS</option></term>
         <listitem>
@@ -163,12 +452,12 @@ tgtadm --op update --mode sys --name iSNSServerIP -v 192.168.11.133
 	    This setting enables(on)/disables(off) iSNS.
           </para>
         </listitem>
-	<screen format="linespecific">
-Example activating iSNS once configured:
+      </varlistentry>
+      <screen format="linespecific">
+Example:
 
 tgtadm --op update --mode sys --name iSNS -v On
-	</screen>
-      </varlistentry>
+      </screen>
 
       <varlistentry><term><option>iSNSServerPort</option></term>
         <listitem>
@@ -176,12 +465,12 @@ tgtadm --op update --mode sys --name iSNS -v On
 	    This setting specifies the port to use for iSNS.
           </para>
         </listitem>
-	<screen format="linespecific">
+      </varlistentry>
+      <screen format="linespecific">
 Example:
 
 tgtadm --op update --mode sys --name iSNSServerPort -v 3205
-	</screen>
-      </varlistentry>
+      </screen>
 
       <varlistentry><term><option>iSNSAccessControl</option></term>
         <listitem>
@@ -189,10 +478,12 @@ tgtadm --op update --mode sys --name iSNSServerPort -v 3205
 	    Enable/disable access control for iSNS.
           </para>
         </listitem>
-	<screen format="linespecific">
-tgtadm --op update --mode sys --name iSNSAccessControl -v Off
-	</screen>
       </varlistentry>
+      <screen format="linespecific">
+Example:
+
+tgtadm --op update --mode sys --name iSNSAccessControl -v Off
+      </screen>
 
     </variablelist>
 
-- 
1.5.4.3


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux