ISCSI target

From Tom's notes
Jump to navigation Jump to search

Setup

Install:

emerge tgt

Start service:

/etc/init.d/tgtd start
rc-update add tgtd default

Create a target:

tgtadm --lld iscsi --mode target --op new --tid=1 --targetname iqn.2007-01.be.hacks:nexus1

List targets:

tgtadm --lld iscsi --mode target --op show

Add a LUN to the target:

tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b /dev/vg0/iscsi1

Grant public access:

tgtadm --lld iscsi --mode target --op bind --tid 1 -I ALL

Save config

tgt-admin --dump > /etc/tgt/targets.conf