Simple iSCSI target (server) and initiator (client)

Posted on Sun 20 March 2011 by Pavlo Khmel

iSCSI (Internet Small Computer System Interface) - an Internet Protocol (IP)-based to provide data storage over network.
Protocol: tcp
Default port: 3260

System A, Target. IP:


yum install scsi-target-util

Configuration. There is example in configuration file /etc/tgt/targets.conf, and unused /dev/sdb:

# Sample target with one LUN only. Defaults to allow access for all initiators:
#    backing-store /dev/LVM/somedevice
    backing-store /dev/sdb


chkconfig tgtd on

Start service:

service tgtd start

System B, Initiator. IP:


yum install iscsi-initiator-utils

There is example in "man iscsiadm", how to discover new disks:

iscsiadm --mode discoverydb --type sendtargets --portal --discover,1

Autostart and start:

chkconfig iscsi on
service iscsi start

Verify status to find name of new disk:

service iscsi status
. . .
Attached scsi disk sdc State: running

Now file system can be created:

mkfs.ext4 /dev/sdc
mount /dev/sdc /mnt

During restart service use information from: