tgt-admin — Linux SCSI Target Configuration Tool
tgt-admin [-e --execute] [--delete <value>] [--offline <value>] [--ready <value>] [-s --show] [-C --control-port <NNNN>] [-c --conf <file>] [--ignore-errors] [-f --force] [-p --pretend] [--dump] [-v --verbose] [-h --help]
tgt-admin is a utility which allows a persistent configuration of targets and luns. It uses tgtadm commands to create, delete and show targets.
-e, --executeRead /etc/tgt/targets.conf and execute tgtadm commands. If the target already exists, it won't be processed. See --update.
-d, --delete <value>Delete all or selected targets. The target will be deleted only if it's not used (no initiator is connected to it).
If you want to delete targets which are in use, you have to add the "--force" flag.
Example usage:
--delete ALL - delete all targets
--delete tid=4 - delete target 4
(target with tid 4)
--delete iqn.2008-08.com.example:some.target
- delete this target
--offlinePut all or selected targets in offline state.
Example usage:
--offline ALL - offline all targets
--offline tid=4 - offline target 4
(target with tid 4)
--offline iqn.2008-08.com.example:some.target
- offline this target
--readyPut all or selected targets in ready state.
Example usage:
--ready ALL - ready all targets
--ready tid=4 - ready target 4
(target with tid 4)
--ready iqn.2008-08.com.example:some.target
- ready this target
--update <value>Update all or selected targets. The target will be updated only if it's not used (no initiator is connected to it).
If you want to update targets which are in use, you have to add "--force" flag.
Example usage:
--update ALL - ready all targets
--update tid=4 - ready target 4
(target with tid 4)
--update iqn.2008-08.com.example:some.target
- update this target
-s, --showShow all the targets.
-C, --control-port <NNNN>It is possible to run multiple concurrent instances of tgtd on a host. This argument is used to control which instance the tgt-admin command will operate on.
-c, --conf <configuration file>Specify an alternative configuration file instead of /etc/tgt/target.conf, which is the default.
--ignore-errorsContinue even if tgtadm exits with non-zero code.
-f, --forceForce some operations even if the target is in use.
-p, --pretendOnly print tgtadm options which would be used; don't execute any actions. Assumes -v.
--dumpDump current tgtd configuration. Note: does not include detailed parameters, like write caching.
-v, --verboseIncrease verbosity (show tgtadm commands used).
-h, --helpDisplay a list of available options and exit.
The defualt configuration file is /etc/tgt/target.conf. It defines all the targets and their properties. The configuration file is in XML format and uses tags. Configuration file contains several target blocks, where each block contains target's properties such as storage devices, initator ACL and authorization information. You can include other config files using: include /etc/tgt/xen/*.conf.
backing-storeDefines a virtual device on the target.
direct-storeDefines a direct mapped device with the same properties as the physical device (such as VENDOR_ID, SERIAL_NUM, etc.)
initiator-addressAllows connections only from the specified IP address. Defaults to ALL if no "initiator-address" is specified.
incominguserDefine iscsi incoming authentication setting. If no "incominguser" is specified, it is not used.
outgoinguserDefine iscsi outgoing authentication setting. If no "outgoinguser" is specified, it is not used.