Mission: ISCSI on Linux
Currently I'm using CentOS 4.4 and got iscsitarget from sourceforge.net ...
Compile iscsitarget
[root@gw iscsitarget-0.4.5]# make
make -C usrmake[1]: Entering directory `/data/sources/iscsitarget-0.4.5/usr'cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o ietd.o ietd.ccc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o iscsid.o iscsid.ccc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o conn.o conn.ccc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o session.o session.ccc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o target.o target.ccc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o message.o message.ccc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o ctldev.o ctldev.ccc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o log.o log.ccc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o md5.o md5.ccc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o isns.o isns.ccc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o sha1.o sha1.ccc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o chap.o chap.ccc ietd.o iscsid.o conn.o session.o target.o message.o ctldev.o log.o md5.o isns.o sha1.o chap.o -o ietdcc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -c -o ietadm.o ietadm.ccc ietadm.o ctldev.o -o ietadmmake[1]: Leaving directory `/data/sources/iscsitarget-0.4.5/usr'make -C /usr/src/kernels/2.6.9-42.EL-i686/ SUBDIRS=/data/sources/iscsitarget-0.4.5/kernel modulesmake[1]: Entering directory `/usr/src/kernels/2.6.9-42.EL-i686' CC [M] /data/sources/iscsitarget-0.4.5/kernel/tio.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/iscsi.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/nthread.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/wthread.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/config.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/digest.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/conn.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/session.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/target.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/volume.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/iotype.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/file-io.o CC [M] /data/sources/iscsitarget-0.4.5/kernel/target_disk.o LD [M] /data/sources/iscsitarget-0.4.5/kernel/iscsi_trgt.o Building modules, stage 2. MODPOST CC /data/sources/iscsitarget-0.4.5/kernel/iscsi_trgt.mod.o LD [M] /data/sources/iscsitarget-0.4.5/kernel/iscsi_trgt.komake[1]: Leaving directory `/usr/src/kernels/2.6.9-42.EL-i686'
[root@gw iscsitarget-0.4.5]# make install
`usr/ietd' -> `/usr/sbin/ietd'`usr/ietadm' -> `/usr/sbin/ietadm'if [ -f /etc/debian_version ]; then \ install -v -m 755 etc/initd/initd.debian /etc/init.d/iscsi-target; \elif [ -f /etc/redhat-release ]; then \ install -v -m 755 etc/initd/initd.redhat /etc/init.d/iscsi-target; \elif [ -f /etc/slackware-version ]; then \ install -v -m 755 etc/initd/initd /etc/rc.d/iscsi-target; \else \ install -v -m 755 etc/initd/initd /etc/init.d/iscsi-target; \fi`etc/initd/initd.redhat' -> `/etc/init.d/iscsi-target'install: creating directory `/lib/modules/2.6.9-42.EL/kernel/iscsi'`kernel/iscsi_trgt.ko' -> `/lib/modules/2.6.9-42.EL/kernel/iscsi/iscsi_trgt.ko'depmod -aq
Configuration
# Example iscsi target configuration#
# Everything until the first target definition belongs
# to the global configuration.
# Right now this is only the user configuration used
# during discovery sessions:
IncomingUser joe secret
# Targets definitions start with "Target" and the target name.# The target name must be a globally unique name, the iSCSI# standard defines the "iSCSI Qualified Name" as follows:## iqn.yyyy-mm.
Target iqn.2001-04.com.example:storage.disk2.sys1.xyz # Users, who can access this target # (no users means anyone can access the target) IncomingUser joe secret # Lun definition # (right now only block devices are possible) Lun 0 /data fileio # Alias name for this target Alias Test # various iSCSI parameters # (not all are used right now, see also iSCSI spec for details) #MaxConnections 1 #InitialR2T yes #ImmediateData no #MaxRecvDataSegmentLength 8192 #MaxBurstLength 262144 #FirstBurstLength 65536 #DefaultTime2Wait 2 #DefaultTime2Retain 20 #MaxOutstandingR2T 8 #DataPDUInOrder yes #DataSequenceInOrder yes #ErrorRecoveryLevel 0 #Wthreads 8