TGTADM(8) [FIXME: manual] TGTADM(8) (NAME) tgtadm - SCSI Target (SYNOPSIS) tgtadm [OPTIONS]... [-C --control-port ] [-L --lld ] [-o --op ] [-m --mode ] [-t --tid ] [-T --targetname ] [-y --blocksize ] [-Y --device-type ] [-l --lun ] [-b --backing-store ] [-f --bsoflags {direct|sync}] [-S --bsopts {backing-store opt string}] [-E --bstype ] [-I --initiator-address
] [-Q --initiator-name ] [-n --name ] [-v --value ] [-P --params ] [-F --force] [-h --help] (DESCRIPTION) tgtadm SCSI (Linux SCSI target) . (OPTIONS) -C, --control-port tgtd . tgtadm . -y, --blocksize . . : tgtadm --lld iscsi --mode logicalunit --op new \ --tid --lun \ -b --blocksize=4096 -Y, --device-type LUN . disk . device-type : disk : tape : ssc : tape cd : DVD changer : (media changer) pt : (passthrough) /dev/sg -E, --bstype LUN (backend storage) . backend : rdwr : / . aio : / (Asynchronous I/O) rbd : RADOS Block Device Ceph sg : (passthrough) ssc : --lld --op new --mode target --tid --targetname (target) . --lld --op delete --mode target --tid . I_T nexus . --lld --op delete --force --mode target --tid . --lld --op show --mode target . --lld --op show --mode target --tid . --lld --op new --mode logicalunit --tid --lun --backing-store --bsopts= (logical unit) . (initiators) . ( LVM RAID) RBD --bstype rbd . lun0 . : tgt bs_rbd Ceph RBD ( tgtadm --mode system --op show ) rbd "rbdimage" bs_rbd : tgtadm --lld iscsi --op new --mode logicalunit --tid 1 \ --lun 1 --bstype=rbd --backing-store=rbdimage \ --bsopts="conf=/etc/ceph/ceph.conf;id=tgt" --lld --op delete --mode logicalunit --tid --lun . --lld --op bind --mode target --tid --initiator-address
. . 'ALL' . --lld --op bind --mode target --tid --initiator-name . . --lld --op unbind --mode target --tid --initiator-address
. --lld --op unbind --mode target --tid --initiator-name . --lld --op update --mode target --tid --name= --value= . --lld --op update --mode target --tid --params parameter=value<,...> . --lld --op update --mode logicalunit --tid --lun --params parameter=value<,...> . --lld --op start --mode lld lld tgtd. tgtd lld . --help . LUN (LUN PARAMETERS) "--mode logicalunit" . vendor_id= (Vendor Identification) LUN INQUIRY . product_id= (Product Identification) LUN INQUIRY . product_rev= (Product Revision) LUN INQUIRY . : tgtadm --lld iscsi --mode logicalunit --op update \ --tid --lun \ --params vendor_id=TGTD,product_id=VirtualHD,product_rev=0103 removable=<0|1> / (removable) . DVD . sense_format=<0|1> (sense data) . 0 = sense 1 = (descriptor format). online=<0|1> (online) . . . MMC/DVD MMC/DVD . I/O Not Ready . : tgtadm --lld iscsi --mode logicalunit --op update \ --tid 1 --lun 1 \ --params removable=1,sense_format=1,online=1 mode_page= (mode pages) . LUN . : '2' 0 . Disconnect-Reconnect . 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 '10' 0 . Control Extension . 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 '0x1c' 0 . Informational Exceptions Control . 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 readonly=<0|1> LUN . LUN . DISK . tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 1 \ --params readonly=1 thin_provisioning=<0|1> (thin-provisioning) LUN . LUN (sparse file) . TGTD sparse . SCSI UNMAP TGTD FALLOC_FL_PUNCH_HOLE . DISK . LUN FALLOC_FL_PUNCH_HOLE . thin- provisioning SSD ZVOL SCSI UNMAP (discard). tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 1 \ --params thin_provisioning=1 rotation_rate= LUN (RPM) . SSD . DISK . tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 1 \ --params rotation_rate=0 LUN SMC (SMC SPECIFIC LUN PARAMETERS) LUN "changer" ( Jukebox DVD VTL) . element_type=<1|2|3|4> jukebox/vtl . : 1 -> ( / picker arm) 2 -> (Storage Element) 3 -> / (Import/Export Element) 4 -> ( CD MO ...) address=<1-65535> . Address . start_address=<1-65535>,quantity=<1--65535> . start_address quantity . sides=<1|2> ( "element_type=2") . clear_slot=<1> . "Empty" . barcode= . tgtd . volume_tag= SMC . tgtd . . media_home= dvd/tape . "barcode" "media_home" . : DVD jukebox DVD-R. # tgtadm --lld iscsi --mode target --op new --tid 1 --targetname iqn.2007-03:virtual-dvd:`hostname` # DVD # dvd tgtadm --op new --mode logicalunit --tid 1 --lun 1 --device-type 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 # if [ ! -f $HOME/smc ]; then dd if=/dev/zero of=$HOME/smc bs=1k count=1 fi # SMC tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 2 --backing-store $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 # ( ) tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=4,start_address=1,quantity=1 # DVD (LUN 1) tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=4,address=1,tid=1,lun=1 # ( / picker) tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=1,start_address=16,quantity=1 # VTL=${HOME}/vtl mkdir -p ${VTL} tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params media_home=${VTL} # - tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=2,start_address=1024,quantity=8 # 'media' # # DVD-R tgtimg --op new --device-type cd --type dvd+r --file ${VTL}/DISK_001 tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=2,address=1024,barcode=DISK_001,volume_tag="A blank disk",sides=1 # tgtimg --op new --device-type cd --type dvd+r --file ${VTL}/DISK_002 tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 2 --params element_type=2,address=1025,barcode=DISK_002,volume_tag="My second blank disk",sides=1 # (ALL) tgtadm --lld iscsi --mode target --op bind --tid 1 --initiator-address ALL # tgtadm --lld iscsi --mode target --op show (PASSTHROUGH DEVICES) TGTD SG (passthrough) . --bstype=sg SG . --device-type=pt . --backing-store= TGTD (export) . --bsoflags={direct|sync} LUN . O_DIRECT "direct" O_SYNC "sync" . : /dev/sg4 TGTD. tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --bstype=sg --device-type=pt --backing-store=/dev/sg4 : O_SYNC. tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --bsoflags="sync" --backing-store=/data/100m_image.raw (HEADER DIGEST AND DATA DIGEST) (digest) . TGTD : None CRC32C. None TGTD CRC32C TGTD . / . tgtadm --op show --mode target --tid 1 ... HeaderDigest=None DataDigest=None ... CRC32C: tgtadm --op update --mode target --tid 1 -n HeaderDigest -v CRC32C None: tgtadm --op update --mode target --tid 1 -n DataDigest -v None CHAP (CHAP AUTHENTICATION) CHAP . CHAP . CHAP (bind) . CHAP . tgtadm --lld iscsi --op new --mode account --user ronnie --password password tgtadm --lld iscsi --op bind --mode account --tid 1 --user ronnie . tgtadm --lld iscsi --op show --mode account Account list: ronnie . tgtadm --lld iscsi --op show --mode target Target 1: iqn.ronnie.test ... Account information: ronnie ... NOP-OUT (NOP-OUT PROBES) TGTD NOP-OUT TCP . tgtd tgtadm . NOP-OUT tgtadm NOP-OUT . NOP-OUT . NOP-OUT . tgtadm --lld iscsi --op show --mode target Target 1: iqn.ronnie.test System information: Driver: iscsi State: ready Nop interval: 5 Nop count: 5 I_T nexus information: NOP-OUT tgtadm NOP-OUT . tgtadm --op update --mode target --tid 1 -n nop_count -v 5 tgtadm --op update --mode target --tid 1 -n nop_interval -v 5 ISCSI (ISCSI PORTALS) iSCSI . iSCSI : tgtadm --lld iscsi --op show --mode portal Portal: 10.1.1.101:3260,1 Portal: 127.0.0.1:3260,1 : tgtadm --lld iscsi --op new --mode portal --param portal=10.1.1.101:3260 : tgtadm --lld iscsi --op delete --mode portal --param portal=10.1.1.101:3260 ISCSI (ISCSI CONNECTIONS) iSCSI . iSCSI IP : tgtadm --lld iscsi --op show --mode conn --tid 1 Session: 2 Connection: 0 Initiator: iqn.2008-11.org.linux-kvm: IP Address: 127.0.0.1 iSCSI . iSCSI . tgtadm --lld iscsi --op delete --mode conn --tid 1 --sid 2 --cid 0 / (ONLINE/OFFLINE STATUS) (LUNs) tgtd (online) (offline) . LUN . check-condition . "PREVENT ALLOW MEDIUM REMOVAL" Offline . Online ( 'eject' ). Online/Offline / LUN tgtd . "Prevent removal" "Yes" " " . tgtadm --lld iscsi --mode target --op show ... LUN: 2 Type: cd/dvd SCSI ID: IET 00010002 SCSI SN: beaf12 Size: 3432 MB, Block size: 1 Online: Yes Removable media: Yes Prevent removal: Yes ... LUN LUN tgtadm . Offline . LUN ( ): tgtadm --tid 1 --lun 2 --op update --mode logicalunit -P Online=No ISNS (ISNS PARAMETERS) iSNS tgtadm . iSNSServerIP IP iSNS . TGTD iSNS . : tgtadm --op update --mode sys --name iSNSServerIP --value 192.168.11.133 iSNS iSNS (On) (Off) . : tgtadm --op update --mode sys --name iSNS --value On iSNSServerPort (port) iSNS . : tgtadm --op update --mode sys --name iSNSServerPort --value 3205 iSNSAccessControl / iSNS. : tgtadm --op update --mode sys --name iSNSAccessControl --value Off (SEE ALSO) tgtd(8), tgt-admin(8), tgtimg(8), tgt-setup-lun(8). https://github.com/fujita/tgt (REPORTING BUGS) [FIXME: source] 07/09/2026 TGTADM(8)