TGTD(8)

πŸ’… TGTD(8) β€” the SCSI Target Daemon, but make it make sense

okay bestie, welcome to tgtd(8) β€” that's the manual page for tgtd, and yes we're gonna get through it together 🫢


✨ NAME ✨

tgtd β€” literally The SCSI Target Daemon. that's the whole name. iconic.


✨ SYNOPSIS ✨

tgtd

tgtd [-C --control-port <INTEGER>] [-d --debug <INTEGER>]
     [-f --foregound] [-h --help] [--iscsi <...>]

(and yes, --foregound is spelled like that in the synopsis β€” not me, don't come for me 😭 the OPTIONS section below says --foreground. both appear in the original. keep your eyes peeled.)


✨ DESCRIPTION ✨

So Tgtd is a SCSI Target daemon. it's out here providing SCSI target service to a network β€” like, that's its whole job, no cap. the most common service it does is iSCSI, but other services are supported too. it's giving main character energy in your storage stack πŸ’…


✨ DEVICE TYPES ✨

Tgtd supports both emulated devices and passthrough of real devices. obsessed.

Here's what it can emulate πŸŽ€

  • disk β€” Normal disk device. Emulates a SCSI harddisk.
  • tape β€” Tape device. Emulates a SCSI tape drive.
  • cd β€” CD device. Emulates a SCSI DVD burner.
  • changer β€” Media changer. Emulate the changer device for a virtual tape library or DVD jukebox.

✨ OPTIONS ✨

  • -d --debug <INTEGER> β€” set this to a non-zero value and you get additional debugging messages logged. little treat for when you're snooping πŸ”
  • -f --foreground β€” runs the daemon in the foreground. no backgrounding, she's right there with you.
  • -h --help β€” prints help text to the screen. the classic.
  • -C --control-port <INTEGER> β€” okay so this comamnd is used to specify the control port to use for this instance of tgtd. the whole point? it lets you run multiple instances of TGTD on a host 🌈

and TGTADM has a matching argument so you can control which instance you connect to. matching set, cute πŸ’–

  • --iscsi <...> β€” iSCSI specific options. peep the ISCSI section below for the options specific to this frontend πŸ‘‡

✨ ISCSI OPTIONS ✨

these parameters apply only to the iSCSI frontend. fyi πŸ¦‹

portal=<ip-address[:port]>

this one binds tgtd to a specific ip-address/portal and/or port. by default tgtd binds to port 3260 on the wildcard address ⭐

the ip-address part (the bit before the ":") can be missing β€” that's how you designate the wildcard address with a none-default port.

example: to bind tgtd to a specific address and port
tgtd --iscsi portal=192.0.2.1:3260
example: to bind tgtd to any address but a none-default port
tgtd --iscsi portal=:3251

nop_interval=<integer>

sets the default interval for sending NOP-OUT to probe for connected initiators πŸ‘€ heads up though: this parameter only controls the default value for targets β€” individual targets can be controlled using tgtadm.

default value is 0, which means the feature is disabled β€” TGTD will not send any NOP-OUT probes. so like, nothing happens unless you opt in 🫢

nop_count=<integer>

sets the default for after how many failed probes TGTD will consider the initiator dead and tear down the session πŸ’€ same deal: this only controls the default value for targets, and individual targets can be controlled using tgtadm.

default value is 0.

example: send NOP-OUT every 5 seconds and abort the session after 6 failures
tgtd --iscsi portal=192.0.2.1:3260,nop_interval=5,nop_count=6

✨ ENVIRONMENT VARIABLES ✨

TGT_IPC_SOCKET=<path>

when you set this, tgtd and tgtadm will use the specified path as the IPC socket instead of the default:

/var/run/tgtd/socket.0

that's it. that's the whole env var. slay ✨


✨ SEE ALSO ✨

targets.conf(5), tgtadm(8), tgt-admin(8), tgtimg(8), tgt-setup-lun(8) β€” go read those next, bestie, they're the whole friend group πŸ’œ

also: https://github.com/fujita/tgt


this program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details. ⚠️

you should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/.


k bye ily, go configure some targets πŸ’– this has been [FIXME: source], dated 11/01/2026 β€” the TGTD(8) page, now with 100% more personality and 0% fewer facts πŸŽ€βœ¨

πŸ“¦ where this page comes from