LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   iSCSI target configuration help (https://www.linuxquestions.org/questions/centos-111/iscsi-target-configuration-help-4175516208/)

usao 08-24-2014 11:37 AM

iSCSI target configuration help
 
Running Cent OS 6.5 on an HP rackmount server. Read some notes on the web about setting up iSCSI targets and tried the following:

yum -y install scsi-target-utils
dd if=/dev/zero of=/iscsi/img01.img count=0 bs=1 seek=2T

Added the following entry to /etc/tgt/targets.conf:

<target iqn.2014-08.com.bar.foo:target1>
backing-store /iscsi/img01.img
initiator-address 10.0.0.254
</target>

Here's the problem:
# /etc/rc.d/init.d/tgtd start
Starting SCSI target daemon: [ OK ]
tgtadm: invalid request
Command:
tgtadm -C 0 --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /iscsi/img01.img
exited with code: 22.

smallpond 08-24-2014 05:45 PM

Try:

Code:

grep CONFIG_ISCSI_TARGET /boot/config-`uname -r`

usao 08-25-2014 09:36 AM

[root@hpse1 ~]# grep CONFIG_ISCSI_TARGET /boot/config-`uname -r`
[root@hpse1 ~]# uname -r
2.6.32-431.17.1.el6.x86_64
[root@hpse1 ~]# ls -l /boot/conf*
-rw-r--r--. 1 root root 105200 May 7 16:58 /boot/config-2.6.32-431.17.1.el6.x86_64
-rw-r--r--. 1 root root 105195 Nov 21 2013 /boot/config-2.6.32-431.el6.x86_64

Does this mean im not runing the corect kernel and I need a reboot?

usao 08-25-2014 10:18 AM

After reboot, kernel version matches to /boot file config.

[root@hpse1 ~]# grep CONFIG_ISCSI_TARGET /boot/config-`uname -r`
[root@hpse1 ~]# l /boot/config-`uname -r`
-rw-r--r--. 1 root root 105200 May 7 16:58 /boot/config-2.6.32-431.17.1.el6.x86_64

[root@hpse1 ~]# grep ISCSI /boot/config-`uname -r`
CONFIG_SCSI_ISCSI_ATTRS=m
CONFIG_ISCSI_TCP=m
CONFIG_ISCSI_BOOT_SYSFS=m
CONFIG_SCSI_CXGB3_ISCSI=m
CONFIG_SCSI_CXGB4_ISCSI=m
CONFIG_SCSI_BNX2_ISCSI=m
CONFIG_BE2ISCSI=m
CONFIG_SCSI_QLA_ISCSI=m
CONFIG_ISCSI_IBFT_FIND=y
CONFIG_ISCSI_IBFT=m

smallpond 08-25-2014 11:54 AM

It means your kernel does not support ISCSI target mode, only initiator.

usao 08-25-2014 12:00 PM

Quote:

Originally Posted by smallpond (Post 5226967)
It means your kernel does not support ISCSI target mode, only initiator.

How can I "fix" that? I already installed the "scsi-target-utils" package, is there something else which is needed?

smallpond 08-25-2014 12:52 PM

Looks to me like iSCSI target code was added to the 3.1 kernel, so it won't exist in older kernels unless somebody backported it.

usao 08-25-2014 12:56 PM

Quote:

Originally Posted by smallpond (Post 5227001)
Looks to me like iSCSI target code was added to the 3.1 kernel, so it won't exist in older kernels unless somebody backported it.

Ok, I don't know how to change the kernel to 3+, so ill have to wait for CentOS to upgrade I guess...

osucowboy0510 08-31-2014 10:17 AM

Well you can download a kernel and make support for iscsi target mode i have it enabled on my box works like a charm

usao 08-31-2014 05:53 PM

I have no idea how to go about doing that. I was told that the default CentOS 6.5 would work, in fact there are several web-sites which say they built iscsi target support and I followed their instructions, but not having any luck.
What exactly is wrong/missing with the default kernel?


All times are GMT -5. The time now is 12:30 PM.