TGTIMG(8)
β¨ TGTIMG(8) β the Linux SCSI Target Framework Image File Utility β¨
okay bestie, gather round, because this is tgtimg from the tgt fam (you know, the Linux SCSI Target Framework crew), and she's the one who makes and manages the image files that TGTD device emulation eats for breakfast. π
πΈ SYNOPSIS πΈ
tgtimg [-o --op <operation>] [-Y --device-type <device-type>]
[-b --barcode <barcode>] [-s --size <size>]
[-t --type <media-type>] [-f --file <path>]
[-T --thin-provisioning]
tgtimg --help
π¦ DESCRIPTION π¦
tgtimg is literally the utility that creates and manages the image files used by TGTD device emulation. main character energy, truly. π
what she actually does is initialize device image files with all the extra metadata that TGTD emulation needs β think barcode, list of blocks, total size, that whole vibe. so when you hit her up, you're not just making a file, you're making a file with receipts. π
π OPTIONS π
-h,--helpβ shows you a help screen and exits. your girl is helpful like that. π«Ά-o,--op {new|show}β the operation, aka what you want her to do. eithernewto create a brand new image file, orshowto show the content of an image file that already exists. pick your fighter. β¨-Y,--device-type <type>β specifies the type of image file. the supported device types are:cd: to create media for a dvd devicedisk: to create media for a disk devicetape: to create media for a tape device
-t,--type <media-type>β when you're creating a new image, this tells her the type of media to emulate. the available mediatypes depend on the type of the device, so it's giving "it depends" but in a cute way. πΈ- supported media types for cd devices are:
dvd+r: create a blank writeable DVD+R disk
- supported media types for disk devices are:
disk: create an empty disk
- supported media types for tape devices are:
data: create a normal data tapeclean: create a cleaning tapeworm: create a worm
- supported media types for cd devices are:
-b,--barcode <barcode>β when you're creating a new image, this argument specifies the barcode to use with this image file. backup application software often uses barcodes to identify specific tapes, so this matters. and when you're emulating a VTL, make sure all your tape images use unique barcodes β no cap, duplicate barcodes are not the move. π-s,--size <size>β when you're creating a new image, this specifies the size in megabytes for the virtual tape image. π₯-f,--file <path>β the filename of the image file. yes, the actual file. love her. π-T,--thin-provisioningβ this argument makes the allocation of the image format use thin-provisioning. translation? the file created will be a sparse file that allocates blocks from the filesystem on demand. π§
β οΈ okay but be careful when using thin-provisioning, bestie. if the filesystem fills up, an iSCSI write to a thin-provisioned LUN can fail. initiators generally do not handle "out of space" errors gracefully β and by "gracefully" I mean they will not slay, they will throw hands. π
also, thin-provisioning uses FALLOC_FL_PUNCH_HOLE which is only available on some linux filesystems. and thin-provisioning can only be used for DISK images. periodt. π
π EXAMPLES π
to create a new 100MByte disk:
tgtimg --op new --device-type disk --type disk --size 100 --file /data/hd001.raw
to create a new tape image:
tgtimg --op new --device-type tape --barcode 12345 --size 100 --type data --file /data/tape001.img
to view the content of an existing image:
tgtimg --op show --device-type tape --file /data/tape001.img
to create a new blank DVD+R image:
tgtimg --op new --device-type cd --type dvd+r --file /data/dvd001.iso
π SEE ALSO π
tgtd(8), tgtadm(8), tgt-admin(8), tgt-setup-lun(8) β the whole friend group, honestly. iykyk. π
and the repo lives at https://github.com/fujita/tgt if you wanna go snooping. π¦
π REPORTING BUGS π
found a bug? report it to <stgt@vger.kernel.org> β they'll listen, fr fr. π«Ά
that's the whole page, bestie! this one's from the [FIXME: source] fam, dated 11/01/2026 β so like, the docs are a lil mysterious about their origin but the vibes are immaculate. go forth, make your image files, and don't forget your barcodes. mwah. ππ
β¨
π¦ 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