saveconfig.json(5)
πΈ saveconfig.json(5) πΈ
ok so bestie, welcome to the saveconfig.json page, straight outta the File Formats Manual. this is the saved configuration file for rtslib-fb and the LIO kernel target, and we're gonna get you fluent in it. no gatekeeping here π
β¨ NAME β¨
saveconfig.json β the saved configuration file for rtslib-fb and the LIO kernel target, fr fr.
π DESCRIPTION π
/etc/target/saveconfig.json is the default location for storing the config of the Linux kernel target, aka LIO. the tea is that the target lives in the kernel, so tools like targetctl or targetcli have to do the saving and restoring so your setup survives a reboot. it's giving persistence π
and here's the slay part: generating or modifying this file by hand, or with other tools, is also supported. this is for the girlies whose needs aren't met by the targetcli configuration shell, who can't use the rtslib Python library, but who also really don't wanna go directly messing with LIO's configfs interface. a whole gap, filled π«Ά
π¦ OVERVIEW π¦
the config file is in the "json" text format, which is both human-readable AND machine-readable, so it's iconic on two fronts at once. its format is very closely modeled on the layout and terminology that LIO uses. attributes may be string, boolean, or numeric values. and all sizes are expressed in bytes. all of them. every single one. periodt π
π LAYOUT π
β TOP LEVEL SUMMARY β
storage_objectsdescribes mappings of resources on the local machine that can be used to emulate block devices.fabric_modulesdescribes settings for LIO fabrics β the hardware or software protocols that transport SCSI commands β such asiSCSIor Fibre Channel over Ethernet (FCoE).targetsdescribes the SCSI target endpoints that export storage objects over a fabric.
π storage_objects π
ok so every storage object must contain name and plugin values. each name has to be unique for all storage objects of its plugin type. no dupes allowed, bestie, that's the vibe check.
plugin must be one of: fileio, block, pscsi, or ramdisk.
objects with a plugin value of fileio must also contain dev, which is the full path to the file that is backing the storage object. optional fileio attributes are wwn (string), write_back (boolean), and size (number). and heads up: if the file given in dev does not exist, then size must be present, and a backing file of that size will be created. no size, no file, no service π
objects with a plugin value of block must also contain dev, which is the full path to the block device that is backing the storage object. optional block attributes are wwn (string), write_back (boolean), and readonly (boolean).
objects with a plugin value of pscsi must also contain dev, which is the full path to the SCSI device that is backing the storage object. there are no optional attributes. that's it, that's the whole menu π
objects with a plugin value of ramdisk must also contain size (number), which is the size in bytes of the ramdisk. optional ramdisk attributes are wwn (string), and nullio (boolean).
and every single storage object definition may also contain an attributes object. this contains LIO attribute values, all of which are also optional. please see LIO documentation for more info on these π
π§ fabric_modules π§
this section is limited to setting discovery authentication settings for fabrics that support it (currently just iscsi). objects here should contain name (e.g. "iscsi"), userid, password, mutual_userid, and mutual_password string values.
π targets π
target configuration is modeled on iSCSI, in which a named target can contain multiple sub-configurations called Target Port Groups (TPGs). LIO follows this model for describing configuration even for fabrics that do not support TPGs. it's committed to the bit, honestly.
objects in targets contain just three attributes:
wwnis the world-wide name the target has been given. this may start with"iqn", or"naa", for example.fabricis the name of the fabric module this target is exported over. allowed values for this depend on the system configuration, but examples include"iscsi","loopback", and"tcm_fc".tpgsis a list of objects describing 1 or more TPGs, described below.
β¨ tpgs β¨
TPG object attributes are all optional. values not supplied will be set to default values. lowkey convenient.
tag(number) allows the tpg tag to be specified.enable(bool, default totrue) allows the TPG to be disabled or enabled.luns,portals, andnode_aclscontain further lists of objects, described below.- finally,
userid,password,mutual_userid, andmutual_passwordallow main-phase authentication values to be set for fabrics (like iSCSI) that support TPG-level authentication. (please seetargetcli(8)for details on TPG versus ACL-based authentication.) - and finally finally, TPGs can also contain optional
attributesandparameterslists, see LIO documentation for more information.
π₯ luns π₯
this list of objects maps storage objects to the TPG.
indexis a TPG-unique number for the assignment, which may be used as the LU number for fabrics that do not support ACL mappings.storage_objectis a string linking back to a storage object, of the format"/backstores/<plugin>/<name>", where<plugin>and<name>correspond to a storage object defined understorage_objects.
π portals π
portals describe connection endpoints for iSCSI targets. required values are ip_address (string) and port (number). iser (boolean) is an optional value to enable iSER. offload (boolean) is an optional value to enable hardware offload.
πΈ node_acls πΈ
this contains information about explicit initiator LUN mappings. node_wwn (string) must be present. authentication may also be set on a per-ACL basis with userid, password, mutual_userid, and mutual_password, similar to TPGs. mapped_luns is a list of mapped luns, described below. and finally, node_acls can contain an optional attributes list.
π mapped_luns π
objects in mapped_luns contain three required attributes:
write_protect(boolean) sets the write-protect status of the mapped LUN.tpg_lun(number) corresponds to an existing entry in the TPG'slunslist.indexis the LU number that the mapped LUN will claim.
π EXAMPLE CONFIGURATION π
since tools generate this file, one good way to understand its format is to use a tool like targetcli to configure a target, then run saveconfig, and view the resulting json file. learn by doing, bestie, that's the move π
π SEE ALSO π
π FILES π
/etc/target/saveconfig.json
π AUTHOR π
man page written by Andy Grover <agrover@redhat.com>.
π REPORTING BUGS π
report bugs via <targetcli-fb-devel@lists.fedorahosted.org> or <https://github.com/open-iscsi/rtslib-fb/issues>
ok that's the whole page, and yes you read every single line, we're so proud πβ¨
and for the cute sign-off: this came to you from the File Formats Manual, page saveconfig.json(5) β mwah, go configure something iconic π«Άπ
π¦ where this page comes from
- centos-stream 10: target-restore 2.1.76-12.el10 Β· Apache-2.0
- centos-stream 9: target-restore 2.1.76-1.el9 Β· ASL 2.0
- fedora 43: target-restore 2.2.3-4.fc43 Β· Apache-2.0
- fedora 43: target-restore 2.2.4-1.fc43 Β· Apache-2.0
- fedora 44: target-restore 2.2.3-5.fc44 Β· Apache-2.0
- fedora 44: target-restore 2.2.4-1.fc44 Β· Apache-2.0
- opensuse-leap 16.0: python-rtslib-fb-common 2.2.2-160000.2.2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms