| TGTIMG(8) | [FIXME: manual] | TGTIMG(8) |
NAME
tgtimg - Linux SCSI Target Framework Image File Utility
SYNOPSIS
.HP 168u
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]
.HP 336u
tgtimg --help
.SH "DESCRIPTION"
.PP Tgtimg is a utility to create and manage the image files used by the TGTD
device emulation.
.PP This command is used to initialize device image files with the additional
metadata, such as barcode, list of blocks, total size, etc that the TGTD
emulation needs.
.SH "OPTIONS"
.PP -h, --help
Show a help screen and exit.
.RE
.PP -o, --op {new|show}
Operation. Is either new to create a new image file or show to show the
content of an existing image file.
.RE
.PP -Y, --device-type <type>
This specifies the type of image file.
.RE
Supported device types are :
cd : to create media for a dvd device
disk : to create media for a disk device
tape : to create media for a tape device
.PP -t, --type <media-type>
When creating a new image, this specifies the type of media to emulate. The
available mediatypes depend on the type of the device.
.RE
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 tape
clean : create a cleaning tape
worm : create a worm
.PP -b, --barcode <barcode>
When 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. When emulating a VTL, make sure that all tape images use
unique barcodes.
.RE
.PP -s, --size <size>
When creating a new image, this specifies the size in megabytes for the
virtual tape image.
.RE
.PP -f, --file <path>
The filename of the image file.
.RE
.PP -T, --thin-provisioning
This argument makes the allocation of the image format use thin-provisioning.
This means that the file created will be a sparse file that will allocate
blocks from the filesystem on demand.
Be careful when using thin-provisioning. If the filesystem fills up a iSCSI
write to a thin-provisioned LUN can fail. Initiators generally do not handle
"out of space" errors gracefully.
Thin-provisioning uses FALLOC_FL_PUNCH_HOLE which is only available on some
linux filesystems. Thin-provisioning can only be used for DISK images.
.RE
.SH "EXAMPLES"
.PP To create a new 100MByte disk
tgtimg --op new --device-type disk --type disk --size 100 --file /data/hd001.raw
.PP To create a new tape image
tgtimg --op new --device-type tape --barcode 12345 --size 100 --type data --file /data/tape001.img
.PP To view the content of an existing image
tgtimg --op show --device-type tape --file /data/tape001.img
.PP To create a new blank DVD+R image
tgtimg --op new --device-type cd --type dvd+r --file /data/dvd001.iso
.SH "SEE ALSO"
.PP tgtd(8), tgtadm(8), tgt-admin(8), tgt-setup-lun(8).
http://stgt.sourceforge.net/
.SH "REPORTING BUGS"
.PP Report bugs to <stgt@vger.kernel.org>
| 12/12/2025 | [FIXME: source] |