The Linux SCSI Target Wiki

Revision as of 05:17, 20 May 2015 by Marcf (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Downloads page contains the instructions for all free download repositories.


Linux inclusion

Versions of LIO and targetcli are included in most Linux distributions per default. Here is an overview over the most popular distributions:

Distribution Version[Linux 1] Release Archive Install Source git[Linux 2] Documentation
CentOS 6.2 2011-12-20 CentOS mirror su -c 'yum install fcoe-target-utils' targetcli-fb.git Tech Notes
Debian 7.0 ("wheezy") TBA Debian pool su -c 'apt-get install targetcli' targetcli
Fedora 16, 17/18 2011-11-08 Fedora Rawhide su -c 'yum install targetcli' targetcli-fb.git Target Wiki
openSUSE 12.1 2011-11-08 Requires manual installation from targetcli.
RHEL 6.2 2011-11-16 Fedora Rawhide su -c 'yum install fcoe-target-utils' targetcli-fb.git Tech Notes
Scientific Linux 6.2 2012-02-16 SL Mirror su -c 'yum install fcoe-target-utils' targetcli-fb.git Tech Notes
SLES SP2 2012-02-15 Requires manual installation from targetcli.
Ubuntu PrecisePangolin v12 2012-04-26 Ubuntu universe su -c 'apt-get install targetcli' targetcli
  1. The distribution release where LIO was included first.
  2. Technical support, and qualified backports to other kernels and distributions are available from Datera.



targetcli is the general management platform for LIO. It comprises a shell that uses the LinuxIO library through a well-defined API, and is available under the Apache License, version 2.0 (Apache License). Everyone is welcome to contribute.

targetcli was released on October 14, 2009 (2009-10-14), and supports all fabric modules, including FCoE, Fibre Channel, IBM vSCSI, iSCSI, iSER, SRP, tcm_loop, and vHost. It is is based on a modular, extensible architecture, with plug-in modules for additional functionality.

targetcli consists of three Python modules (download and build instructions):


If your Linux distribution doesn't already contain an adequate targetcli version, or targetcli can't be installed as described above, you can manually install it from the Datera repositories as follows.

Clone GIT repositories

The source code of the three targetcli components (configshell, RTSlib, targetcli) is available for downloaded from their GIT repositories, respectively:

$ git clone
$ git clone
$ git clone

Install and Build

Please follow the distribution-specific instructions:


Run targetcli as 'root' as follows:

# PYTHONPATH=. ./scripts/targetcli



target-pending.git (v4.1.0-rcX) is for kernel developers and users who want to use the latest LIO code before it becomes available in the mainline Linux Kernel. This tree tracks Linus' mainline and follows the quarterly kernel release schedule. It is intended for kernel developers who are interested in contributing to the upstream LIO code, and are comfortable running and debugging bleeding edge kernel code. It involves building a complete running Linux kernel and associated modules, and expects the user to have experience with configuring, building and installing kernels.

Starting with 3.5-rc code in June 2012, the target-pending.git tree is now setup using a work-flow similar to Kvm-Git-Workflow using the following branch structure:

If you're a developer, usually developing against 'for-next' is okay. If 'for-next' is unstable for you or you need a new upstream API, work against 'auto-next', but let the maintainers know that when posting your patch.

If you're working on a fix for the current cycle, work against upstream or 'master' (they should be equivalent most of the time).

If you're a sub-maintainer, post git pull requests against 'for-next' or 'master', according to your merge target.


Clone GIT repositories

The source code of the LinuxIO (target_core.ko) engine is available for download from its GIT repository. First, close the full git tree:

$ git clone git:// target-pending.git

Show the available remote branches:

$ cd target-pending.git/
$ git branch -vr

Resolve dependencies

Install the necessary kernel development packages, including gcc, make, libncurses-dev.


On a Debian based system these packages (gcc, make, libncurses5-dev) can be installed as follows:

$ su -c 'apt-get install gcc make libncurses5-dev kernel-devel'
$ su -c 'yum install gcc make ncurses-devel kernel-devel'
$ su -c 'zypper install gcc make ncurses-devel kernel-devel'
$ su -c 'apt-get install gcc make ncurses-devel kernel-devel'

Select modules

To configure the kernel build (hardware dependent), run:

$ make menuconfig

Enable the LIO (target_core.ko) module and the desired backend driver modules.

Also, enable the desired fabric drivers for iSCSI (iscsi.ko), FCoE (tcm_fc.ko), tcm_loop (loopback.ko), and Firewire SBP-2:

         Device Drivers  --->
                 <M> Generic Target Core Mod (TCM) and ConfigFS Infrastructure  --->

                 --- Generic Target Core Mod (TCM) and ConfigFS Infrastructure
                   <M>   TCM/IBLOCK Subsystem Plugin for Linux/BLOCK
                   <M>   TCM/FILEIO Subsystem Plugin for Linux/VFS
                   <M>   TCM/pSCSI Subsystem Plugin for Linux/SCSI
                   <M>   TCM Virtual SAS target and Linux/SCSI LDD fabric loopback module
                   <M>   TCM_FC fabric Plugin 
                   <M> iSCSI Target Mode Stack
                   <M>   FireWire SBP-2 fabric module
Mellanox InfiniBand

Optionally, enable the InfiniBand target module (srpt.ko), plus the umad and verbs modules:

        Device Drivers --->
                <M> InfiniBand support  --->

                --- InfiniBand support                     
                   <M>   InfiniBand userspace MAD support                             
                   <M>   InfiniBand userspace access (verbs and CM)  
                   <M>   InfiniBand SCSI RDMA Protocol target support           
QLogic Fibre Channel

Optionally, enable the QLogic Fibre Channel target module (qla2xxx.ko), including its SCSI LLD:

        Device Drivers --->
                 SCSI device support  --->
                         [*] SCSI low-level drivers  --->

                 --- SCSI low-level drivers   
                   <M>   QLogic QLA2XXX Fibre Channel Support
                   <M>   TCM_QLA2XXX fabric module for Qlogic 2xxx series target mode HBAs
USB Gadget

Optionally, enable the USB Gadget module:

        Device Drivers --->
                [*] USB support  ---> 
                         <M>   USB Gadget Support  --->        

                --- USB Gadget Support 
                  <M>     USB Gadget Target Fabric Module


Build the Linux kernel with the selected modules:

$ make bzImage ; make modules 


Install the Linux kernel with the selected modules:

$ su -c 'make modules_install ; make install'

Rebuild initrd

If necessary, back up and rebuild the initial RAM disk initrd depending on the distribution.


Rebuild initrd by running the following command:

$ su -c 'update-initrd -c -k $(uname -r)'

Rebuild initrd by running the following command:

$ su -c 'mkinitrd -f /boot/initramfs-$(uname -r).img $(uname -r)'

Rebuild initrd by running the following command:

$ su -c 'mkinitrd'

Rebuild initrd by running the following command:

$ su -c 'update-initramfs -c -k $(uname -r)'


Please post your comments, questions or bug reports here:

Please see Support for more information.

See also

External links

Personal tools
Google AdSense