(Tutorials) iSCSI

January 29, 2014

Testing iSCSI with 2 Raspberry Pi’s

  1. Important
  2. Setup an initiator (client) on rpi-2
  3. More info with initiator target
  4. Setup target
  5. Setup a target automatically
  6. Setup a target manually
  7. Add LUN
  8. Connect from initiator

rpi-1: target:
rpi-2: initiator:


Source: https://groups.google.com/forum/#!topic/open-iscsi/iAwrdax-mSA

"open-iscsi is only a initiator. For a target you need something like IET or SCST or tgt, or in RHEL5.3 I think there is scsi-target-utils which is a rpm/package of tgt (you might have to have some sort of special storage/clustering thing with red hat to get it though)."

Setup an initiator (client) on rpi-2

Source: http://elinux.org/RPi_iSCSI_Initiator

More info with initiator <-> target


Setup target

rpi-1# apt-get install tgt

Start tgt daemon

rpi-1# /usr/sbin/tgtd --iscsi portal=

You get “error” messages:

librdmacm: couldn't read ABI version. librdmacm: assuming: 4 CMA: unable to get RDMA device list (null): iser_ib_init(3263) Failed to initialize RDMA; load kernel modules? (null): fcoe_init(214) portal=

These can be safely ignored: we do not do RDMA (see url: http://osdir.com/ml/debian-bugs-dist/2010-09/msg08226.html )
Verify the daemon is running:

rpi-1# netstat -ntulp | grep 3260

Setup a target automatically

rpi-1# tgt-setup-lun -d /dev/loop0 -n my_target Using transport: iscsi Creating new target (name=iqn.2001-04.com.rpi-1-my_target, tid=1) Adding a logical unit (/dev/loop0) to target, tid=1 Accepting connections only from

Setup a target manually

rpi-1# tgtadm --lld iscsi --op new --mode target --tid 1 -T \ iqn.2013-11.nl.kwalinux:storage.disk1.rpi-1

The target name must be a globally unique name, the iSCSI standard defines the “iSCSI Qualified Name” as follows:
iqn.yyyy-mm.[:identifier]; yyyy-mm is the date at which the domain is valid; the identifier is freely selectable.


rpi-1# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /storage/disk1 rpi-1# tgtadm --lld iscsi --op show --mode target rpi-1# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

Connect from initiator

rpi-2# iscsiadm --mode discovery --type sendtargets --portal rpi-2# iscsiadm --mode node \ --targetname iqn.2013-11.nl.kwalinux:storage.disk1.rpi-1 \ --portal --login rpi-2# fdisk -l rpi-2# mount /dev/sda1 /mnt


"There's no future in time travel."

Powered by Wordpress. Theme by Shlomi Noach, openark.org
© 1997 - 2024 KwaLinux Trainingen | Algemene voorwaarden | KvK: 10147727 | BTW-id: NL001873211B65 | Disclaimer