Saturday, May 3, 2008

Setting up iSCSI target on Debian etch

Todays adventure is setting up iSCSI target on debian !

First off, a normal installation of debian etch, using the defaults and nothing particularly special, afterwards, i search google for a debian package of iscsi target, and well, i find debian provides one for testing, one for unstable and one in backports :D yay, i quickly add the debian backports repository, and try to install it by doing apt-get install iscsitarget, and i get the following


Setting up iscsitarget (0.4.15+svn145-1~bpo40+1) ...
Starting iSCSI enterprise target service: FATAL: Module iscsi_trgt not found.
netlink fd: Connection refused
failed.



i looked this file using apt-file and googled around a little, but found nothing particularly helpful, but i noticed that there is a package called iscsitarget-source, which is not usual unless the source is needed to install a package, other wise source is usually provided seperately, so i apt-got it and there you have it in /usr/src/iscsitarget.tar.bz2, i extract the archive. now what, i see no doc or README in that archive, i look back at the packs installed, and notice that debian got module-assistant as a dependency for iscsitarget-source ... sure thing, thats the way to go, so i run module-assistant, try to select iscsitarget to build, and then fall back to the main menu and do "prepare" which gets a bunch of new packages and installs them.

Back to modules-assistant ... select ... iscsitarget ... ok ... build .... build fails!! :( i look at the errors, the first one i can see was:

CC [M] /usr/src/modules/iscsitarget/kernel/tio.o
In file included from /usr/src/modules/iscsitarget/kernel/tio.c:7:
/usr/src/modules/iscsitarget/kernel/iscsi.h:236: error: field ‘rx_hash’ has incomplete type

nothing before seems to be relevent to the error or triggering it, so i started asking around, and there you go , #debian-backports on oftc irc network guys tell me that it needs a newer kernel, and so does /usr/share/doc/iscsitarget-source/README.Debian which i didnt read before, so i need to install a newer kernel, which i still find in etch-backports. so i lookup which kernels are available and i do apt-get install linux-image-2.6.22-4-686 and linux-headers-2.6.22-4-686 and reboot.

now back to module-assistant, select, build, install,exit ... /etc/init.d/iscsitarget start ... all starts successfully :) now i can go ahead and play with the /etc/ietd.conf file (iscsi enterprise target daemon conf file).

Note:I wonder ... why would iSCSI target have anything in the kernel space ?

3 comments:

Devocionales Cristianos said...

Hi, I have the same problem that you have already faced, but, in backports for etch there is no 2.6.22 kernel version, just 2.6.18, and the documentation for iscsitarget says that it is needed 2.6.14 and above, so, what do you suggest me to do???

Thanks in advance

Devocionales Cristianos said...

Ok, it's me again, and of course I have not idea if you would read this comments for your few months ago post. But nothing to lose. What kernel version and debian release were you using at the instalation?

Regards

Jئـl;;;ïoJl said...

according to debian etch backports, as of october 29,2008 -> http://packages.debian.org/search?suite=etch-backports&section=all&arch=any&searchon=names&keywords=linux+image

i can see that they have 2.6.24 and 2.6.25 kernel ! at the time of the writing the 2.6.22 kernel was available .