tgtimg — Linux SCSI Target Framework Image File Utility


tgtimg --op new --device-type tape
--barcode <code> --size <size> --type <type> --file <path>

tgtimg --op show --device-type tape --file=<path>

tgtimg --help


tgtimg is a utility to create and manage the image files used by the stgt tape emulation.

This command is used to initialize tape image files with the additional metadata, such as barcode, list of blocks, total size, etc that the tape emulation of TGTD needs.

You must use this command to initialize a file so that TGTD will\ recognize it as a tape image.


-h, --help

Show a help screen and exit.

-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.

-Y, --device-type <type>

This specifies the type of image file. The only valid type is tape.

-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.

-s, --size <size>

When creating a new image, this specifies the size in megabytes for the virtual tape image.

-t, --type {data|clean|worm}

When creating a new image, this specifies the type of media to emulate, normal data, cleaning image, or worm.

Data is a normal tape to read/write to and probably what you want to use.

-f, --file <path>

The filename of the image file.


To create a new 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


tgtd(8), tgtadm(8), tgt-admin(8), tgt-setup-lun(8).


Report bugs to <>