SETTING UP ISCSI INITIATOR WITH OPEN-ISCSI

tested on Slackware64 14.2

INSTALL FROM SCRATCH

fetch the latest release and also for ISNS.

wget https://github.com/open-iscsi/open-isns/archive/v0.98/open-isns-0.98.tar.gz
tar xzf open-isns-0.98.tar.gz
cd open-isns-0.98/
./configure
make -j4 > ../isns..log && echo BUILT
make install
make install_hdrs
make install_lib
cd ../

wget https://github.com/open-iscsi/open-iscsi/archive/2.0.876/open-iscsi-2.0.876.tar.gz
tar xzf open-iscsi-2.0.876.tar.gz
cd open-iscsi-2.0.876/
ls -l /lib/modules/`uname -r`/build/Makefile
updatedb
locate isns-proto.h

make -j4 > ../iscsi.log && echo BUILT
make install
#make kernel

cp etc/initd/initd.redhat /etc/init.d/iscsid
ls -lF /etc/init.d/iscsid
chmod +x /etc/init.d/iscsid

INITIATOR SETUP

change the default initiator name,

vi /etc/iscsi/initiatorname.iscsi

InitiatorName=iqn.2005-03.org.open-iscsi:10a21693fc3d
InitiatorName=iqn.2018-10.su.os3:INITIATOR-HOSTNAME
InitiatorName=iqn.initiator:INITIATOR-HOSTNAME

/etc/init.d/iscsid start

REACHING THE LUNS

discover & clean-up,

iscsiadm -m discovery -t st -p storage1
iscsiadm -m discovery -p storage1 -o delete

login/logout to all,

iscsiadm -m node -L all
iscsiadm -m node -U all

or login to only one target,

iscsiadm -m node --targetname=iqn.drbd:storage1.lun1 --login
iscsiadm -m node --targetname=iqn.drbd:storage1.lun2 --login

and check,

fdisk -l | grep /dev/sd
iscsiadm -m session -P3 | less #/Attached
iscsiadm -m session -P3 | grep Attached

OPERATIONS

START

/etc/init.d/iscsid start

STATUS

/etc/init.d/iscsid status
ps auxww | grep iscsid
iscsiadm -m session -P1 | grep Initiatorname
iscsiadm -m node
iscsiadm -m session -P1 | grep ^Target
iscsiadm -m session -P3 | grep Attached

STOP

/etc/init.d/iscsid stop
#pkill -9 iscsid

SHOOTING

debian init script does not work,

cp etc/initd/initd.debian /etc/init.d/iscsid

/etc/init.d/iscsid: line 18: /lib/lsb/init-functions: No such file or directory

==> using initd.redhat instead

RESOURCES


HOME | GUIDES | BENCHMARKS | html