TGT-SETUP-LUN(8)
πΈ TGT-SETUP-LUN(8) β bestie, this is the manual page for tgt-setup-lun πΈ
hiii okay so this is TGT-SETUP-LUN(8), aka the manual page for tgt-setup-lun in section 8, and the header manual tag is literally [FIXME: manual]. We're folding that in right here so nothing gets lost, bestie π
π NAME π
tgt-setup-lunβ a helper script that creates a target, adds a device to the target, and defines initiators that can connect to the target.
β¨ SYNOPSIS β¨
The whole summoning spell is:
tgt-setup-lun -d <device> -n <targetname> [-b <bsname>] [-t <transport>]
[-C <control_port>] [initiator_IP...] [-h]
π¦ DESCRIPTION π¦
So it creates a target according to the supplied target_name. Important vibe check: tgtd must be running. No cap, that's non-negotiable.
The format of the default IQN generated from the target name is:
iqn.2001-04.com.<hostname>-<target_name>
β¦or a complete IQN may be given. Either way, the target name must be unique β literally unique, okay? Don't be out here reusing names π
The script then adds the requested device to the target. If specific IP addresses are defined, it adds them to the list of allowed initiators for that target. If no IP addresses is defined, it defines that the target accepts any initiator. That's the whole plot π«Ά
bestie, tgtd must be running. Like, actually running. The script is not gonna manifest it out of vibes β¨
π EXAMPLES π
Create a target that uses /dev/sdb1 and allows connections only from 192.168.10.81:
tgt-setup-lun -d /dev/sdb1 -n my_target 192.168.10.81
Create a target that uses /dev/sdb1 and allows connections only from 192.168.10.81 and 192.168.10.82:
tgt-setup-lun -d /dev/sdb1 -n my_target 192.168.10.81 192.168.10.82
Create a target that uses /dev/sdb1 and allows connections from any initiator:
tgt-setup-lun -d /dev/sdb1 -n my_target
Display help:
tgt-setup-lun -h
π AUTHOR π
Written by Erez Zilber. Shoutout to Erez, iconic behavior β¨
π§ SEE ALSO π§
π REPORTING BUGS π
Report bugs to <stgt@vger.kernel.org>.
π COPYRIGHT π
Copyright Γ―ΒΏΒ½ Voltaire Ltd. 2008.
mwah π final sign-off cuteness: source/version is [FIXME: source], date is 11/01/2026, and the manual name is TGT-SETUP-LUN(8). bye bestie, go slay your targets π«Άπ
π¦ where this page comes from
- alpine 3.24: scsi-tgt-doc 1.0.98-r0 Β· GPL-2.0-only
- arch rolling: tgt 1.0.98-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms