This page explains how to use LIO, the inkernel iscsi target, and the targetcli tool to configure LIO.

Quickstart

Install the software

LIO is shipped with the linux kernel.

The targetcli tool was packaged for Debian 7 as targetcli from the original source code produced by ?RisingTide Systems, now Datera. It was discontinued in Debian 8. Functioning packages can still be created from the source code for Debian 8.

There is a new package in Debian 9 named targetcli-fb ("free branch"). You may need to also install the package dbus if the system is not a new Debian 9 install (has been upgraded from Jessie). All configuration is done through the CLI by executing targetcli. A basic configuration is created upon first use.

Basic commands

"ls" lists the existing configuration tree. "help" or "help [command] provides help on the targetcli command line commands. Configuration changes should be made by navigating the tree and using the appropriate commands to add new enties.

The CLI supports autocomplete and lists available commands in each context when tab is hit.

Example workflow for adding a target:

Useful Errors

If you fail to login, the kernel on the iscsi target will tell you what the wwn of the machine trying to talk to it is. for example:

Configuration files and updates

Usage of the CLI is similar for the targetcli and targetcli-fb versions, but the configuration files are different and incompatible. targetcli stores its configuration in a text file in /etc/target/scsi_target.lio. targetcli-fb stores its configuration in /etc/rtslib-fb-target/saveconfig.json.

Reboots and Persistence

The configuration saved by targetcli utility has to be applied every time the system starts.

Starting with Debian 13 this can be achieved using rtslib-fb-targetctl.service systemd unit. It is provided as part of python3-rtslib-fb package, which should be already pulled in as a dependency when installing targetcli-fb. Make sure the unit is enabled by issuing the following command:

If using previous versions of Debian, you may need to add such unit manually: