iSCCI target with TGT

tested on Slackware64 14.2

INSTALL

as binary

slackpkg search tgt

or from scratch

slackpkg search libmpc

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/
make -j4 > ../tgt.log
make install
cp scripts/initd.sample /etc/init.d/tgtd
ls -lF /etc/init.d/tgtd

SETUP

ls -lF /dev/drbd1 /dev/drbd2
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.drbd:storage1.lun1>
        backing-store /dev/drbd1
</target>

<target iqn.drbd:storage1.lun2>
        backing-store /dev/drbd2
</target>
EOF

FURTHER REQUIREMENTS

handy symlink

cd ~/
ln -s /etc/tgt/targets.conf

deps

slackpkg search perl-config-general
slackpkg search libaio
ldd `which tgtd`

OPERATIONS

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

(RE)START

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

STATUS

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

STOP

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

ENABLE AT STARTUP

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

RESOURCES


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun