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 -j16 > make.log && echo OK
make -j16 install
make -j16 install_hdrs
make -j16 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 -j16 > make.log && echo OK
make -j16 install
# make kernel

cp etc/initd/initd.redhat /etc/rc.d/init.d/iscsid
chmod +x /etc/rc.d/init.d/iscsid

INITIAL SETUP

change the default initiator name,

vi /etc/iscsi/initiatorname.iscsi

InitiatorName=iqn.2018-10.su.os3:HOSTNAME

OPERATIONS

START

/etc/init.d/iscsid start

STATUS

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

STOP

/etc/init.d/iscsid stop

REACHING THE LUNS

discover & clean-up,

target=dark3
iscsiadm -m discovery -t st -p $target
iscsiadm -m discovery -p $target -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.2018-10.su.os3:dark3.lun2 --login
iscsiadm -m node --targetname=iqn.2018-10.su.os3:dark3.lun3 --login

and check,

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

SHOOTING

debian init script does not work,

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

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

==> using initd.redhat instead

RESOURCES


Last update: 2018-10-13 | home | html | css