iSCCI target with TGT

tested on Slackware64 14.2

INSTALL FROM SCRATCH

wget https://github.com/fujita/tgt/archive/v1.0.73/tgt-1.0.73.tar.gz
tar xzf tgt-1.0.73.tar.gz
cd tgt-1.0.73/
/usr/sbin/slackpkg install libmpc
make -j4 > make.log
make -j4 install

INSTALL FROM BINARY

slackpkg install tgt
#/sbin/installpkg /data/host/slackbuilds/tgt-1.0.73-x86_64-1_SBo.tgz

SETUP

ls -l /dev/drbd2
ls -l /dev/drbd3

rm -f /etc/tgt/targets.conf
rm -rf /etc/tgt/conf.d/

cat > /etc/tgt/targets.conf <<-EOF
default-driver iscsi
ignore-errors no

<target iqn.2018-10.su.os3:dark3.lun2>
        backing-store /dev/drbd2
</target>

<target iqn.2018-10.su.os3:dark3.lun3>
        backing-store /dev/drbd3
</target>
EOF

cd ~/
ln -s /etc/tgt/targets.conf
/usr/sbin/slackpkg install perl-config-general
/usr/sbin/slackpkg install libaio
ldd `which tgtd`

OPERATIONS

tail -n0 -F /var/log/* /var/log/*/*

(RE)START

/etc/rc.d/init.d/tgtd start
/etc/rc.d/init.d/tgtd restart

STATUS

/etc/rc.d/init.d/tgtd status
ps auxw | grep tgtd
tgt-admin -s
tgt-admin -s >/dev/null && echo UP || echo DOWN
tgtadm --mode target --op show

STOP

/etc/rc.d/init.d/tgtd stop
pkill -9 tgtd
ps auxw | grep tgtd

ENABLE AT STARTUP

cat >> /etc/rc.d/rc.local <<-EOF
/etc/rc.d/init.d/tgtd start
EOF

RESOURCES


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