TARGETS.CONF(5) | [FIXME: manual] | TARGETS.CONF(5) |
targets.conf - Linux SCSI Target Configuration File
tgt-admin uses /etc/tgt/targets.conf to initialize tgtd configuration, by default. Its layout uses a HTML-like structure, with a hierarchy of nested tags to define targets and LUNs.
Global directives configure options that are global to tgtd's configuration, as well as defining exported targets, via target sections.
Target sections contain directives specific to one target device. They define each target's exported LUNs via "backing-store" and "direct-store" directives, as well as other target-wide options.
LUN directives ("backing-store" and "direct-store") may contain options specific to a single exported logical unit.
With the exception of target directives, each of these should occur at most once.
<target <IQN>>
Within this block should be target-level directives, as documented below.
The target definition ends with "</target>"
default-driver <lld>
include <path>
ignore-errors yes
control-port <port>
iSNSServerIP <addr>
iSNSAccessControl <value>
iSNSServerPort <port>
iSNS On
incomingdiscoveryuser <user> <userpassword>
outgoingdiscoveryuser <user> <userpassword>
Each target may export multiple block devices, or logical units (LUNs). For the purposes of LUN numbering, backing-store directives are processed before direct-store directives.
backing-store <path>
direct-store <path>
driver <lld>
initiator-address <addr>
initiator-name <addr>
incominguser <user> <userpassword>
outgoinguser <user> <userpassword>
controller_tid <val>
All of these may be listed at the target level (and apply to all LUNs) or within an individual LUN's definition, if it is defined using the container-style, multi-line definition, rather than single-line definition format:
<backing-store /dev/sdb1> # LUN directives go here </backing-store> <direct-store /dev/sdb1> # LUN directives go here </direct-store>
It is recommended to use either single-line or container-style LUN definitions within a target. Mixing styles can cause parser errors.
write-cache <val>
scsi_id <val>
scsi_sn <val>
vendor_id <val>
product_id <val>
product_rev <val>
sense_format <val>
removable <val>
path <val>
mode_page <val>
readonly <val>
device-type <val>
bs-type <val>
allow-in-use <val>
block-size <val>
lbppbe <val>
This is an internal option that should not be set directly.
la_lba <val>
optimal_xfer_gran <val>
optimal_xfer_len <val>
params <vals>
Example configuration file: <target iqn.2007-04.com.example:san.monitoring> backing-store /dev/san/monitoring # if no "incominguser" is specified, it is not used incominguser backup secretpass12 # defaults to ALL if no "initiator-address" is specified initiator-address 192.168.1.2 </target> <target iqn.2007-02.com.example:san.xen1> backing-store /dev/san/xen1-disk1 # LUN1 direct-store /dev/san/xen1-disk2 # LUN2 initiator-address 192.168.1.2 # Allowed IP initiator-address 192.168.5.6 # Allowed IP incominguser user1 secretpass12 incominguser user2 secretpass23 outgoinguser userA secretpassA </target> <target iqn.2007-02.com.example:san.xen2> backing-store /dev/san/xen2 </target> <target iqn.2007-06.com.example:san.vmware1> backing-store /dev/san/vmware1 </target>
/etc/tgt/targets.conf
/usr/share/doc/tgt/examples/targets.conf.example
tgtd(8), tgtadm(8), tgtimg(8), tgt-setup-lun(8). https://github.com/fujita/tgt
Report bugs to <stgt@vger.kernel.org>
09/08/2024 | [FIXME: source] |