My server info:
Linux Microknoppix 2.6.39.3 #21 SMP PREEMPT Sat Jul 23 09:48:39 CEST 2011 i686 GNU/Linux
modprobe iscsi_trgt
results in
FATAL: Module iscsi_trgt not found.
So I run
# apt-get install module-assistant debhelper
then
# m-a a-i iscsitarget
It fails with error
log:
iscsitarget-source.buildlog.2.6.39.3.1 contents:
dh_clean -k
dh_clean: dh_clean -k is deprecated; use dh_prep instead
#/usr/bin/make -C /usr/src/linux KERNEL_SOURCES=/usr/src/linux MODVERSIONS=detect KERNEL=linux-2.6.39.3 KDIR=/usr/src/linux SUBDIRS=/usr/src/modules/iscsitarget/kernel modules
/usr/bin/make -C /usr/src/linux SUBDIRS=/usr/src/modules/iscsitarget/kernel modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.39.3'
CC [M] /usr/src/modules/iscsitarget/kernel/tio.o
CC [M] /usr/src/modules/iscsitarget/kernel/iscsi.o
CC [M] /usr/src/modules/iscsitarget/kernel/nthread.o
CC [M] /usr/src/modules/iscsitarget/kernel/wthread.o
/usr/src/modules/iscsitarget/kernel/wthread.c: In function 'worker_thread':
/usr/src/modules/iscsitarget/kernel/wthread.c:75:3: error: implicit declaration of function 'copy_io_context' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/modules/iscsitarget/kernel/wthread.o] Error 1
make[2]: *** [_module_/usr/src/modules/iscsitarget/kernel] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-2.6.39.3'
make[1]: *** [binary-modules] Error 2
make[1]: Leaving directory `/usr/src/modules/iscsitarget'
make: *** [kdist_build] Error 2
I've done most of the work of creating a new partition, volume group, etc..., here is a rough guide to what I've done so far:
Boot to UBCD, open partition manager, resize partition so there is some free space
Create a new partition, but no formatting type /dev/sda3
Boot back into linux root shell
aptitude install iscsitarget iscsitarget-modules-`uname -r`
First we set up the target (server2): Open /etc/default/iscsitarget...
vi /etc/default/iscsitarget
... and set ISCSITARGET_ENABLE to true:
ISCSITARGET_ENABLE=true
root@Microknoppix:/sbin# vgcreate vg0 /dev/sda3
No physical volume label read from /dev/sda3
Physical volume "/dev/sda3" successfully created
Volume group "vg0" successfully created
Then create 75GB lun under vgo named storage_lun1
root@Microknoppix:~# lvcreate -L75G -n storage_lun1 vg0
Logical volume "storage_lun1" created
vi /etc/iet/ietd.conf - add the following lines to file vi /etc/iet/ietd.conf
Target iqn.2001-04.com.example:storage.lun1
IncomingUser user p@ssw0rd
OutgoingUser
Lun 0 Path=/dev/vg0/storage_lun1,Type=fileio
Alias LUN1
#MaxConnections 6
root@Microknoppix:/dev/vg0# vi /etc/iet/initiators.allow
add to end of file:
iqn.2001-04.com.example:storage.lun1 192.168.60.234
/etc/init.d/iscsitarget start
error Starting iSCSI enterprise target service: FATAL: Module iscsi_trgt not found.
So did an: apt-get install module-assistant debhelper
then: m-a a-i iscsitarget
(which also installed kernel headers)
I'd like to get my win7 ultimate box at 192.168.60.234 to connect to the target lun but here is where I am stuck.
Get the latest version from SVN because the one in Debian and Ubuntu usually fails to compile. I had the same error and the latest-greatest compiles like charm.
Or you had better to use SCST, because it is more stable.