LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   How to setup iSCSI targets on CentOS 6.5 with 2.x kernel? (https://www.linuxquestions.org/questions/centos-111/how-to-setup-iscsi-targets-on-centos-6-5-with-2-x-kernel-4175516433/)

usao 08-26-2014 11:04 AM

How to setup iSCSI targets on CentOS 6.5 with 2.x kernel?
 
My attempts to follow web-based setup instructions have hit a snag. Im being told that I cannot setup iSCSI targets unless I have a 3.x kernel, and all the CentOS installs I know of are 2.x.
Has anyone worked around this issue? Is there a fix or workaruond?
Is it recommended to upgrade the kernel to 3.x even though it's CentOS 6.5?

MensaWater 08-26-2014 12:21 PM

I haven't done iSCSI but I'm pretty sure it is supported on RHEL6.x and therefore on CentOS6.x which is compiled from the RHEL sources.

This link specifically talks about setup of iSCSI targets on CentOS6.5:
http://www.tecmint.com/create-centra...argetin-linux/

Just as a note:
Do NOT try to update your CentOS6.x system from its current 2.6.x kernel to a 3.x kernel. If you need a 3.x you should go to CentOS7 as the latter was built around the 3.x and the former was built around 2.6.x.

Also FYI:
2.4.x and 2.6.x were significantly different so saying 2.x isn't really telling folks enough about what level of kernel is in use.

usao 08-26-2014 04:37 PM

Thanks for the link. Ill dig through that tonight.
As a summary (in one post) the steps and results I got on 2 different boxes were the same. In both cases, im getting the same error.
Have I missed any steps or done something wrong here?

# uname -rv
2.6.32-431.17.1.el6.x86_64 #1 SMP Wed May 7 23:32:49 UTC 2014
# yum install -y scsi-target-utils
# service tgtd start
# chkconfig tgtd on
# dd if=/dev/zero of=/iscsi/img01.img count=0 bs=1 seek=1G
# cat /etc/tgt/targets.conf
default-driver iscsi
<target iqn.2014-08.dssi:target1>
backing-store /iscsi/img01.img
initiator-address 10.0.0.254
</target>
# tgtadm --mode target --op show
Target 1: iqn.2014-08.dssi:target1
System information:
Driver: iscsi
State: ready
I_T nexus information:
LUN information:
LUN: 0
Type: controller
SCSI ID: IET 00010000
SCSI SN: beaf10
Size: 0 MB, Block size: 1
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
Backing store type: null
Backing store path: None
Backing store flags:
Account information:
ACL information:
# /etc/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.

MensaWater 08-27-2014 08:00 AM

As noted before I've not worked with iSCSI at all (we have Fibre SAN here).

However, looking at your post I see you did "service tgtd start" near the beginning but later just before your error you tried "/etc/init.d/tgtd start". Both commands start the same service. That is to say in Redhat style init based systems such as CentOS the "service" command is just a shortcut to executing the full path of an init script which is in /etc/init.d.

This means you tried to start the service after it was already running so it may have failed simply due to that. Try running "service tgtd restart" which should stop the service then restart it. (Some init scripts don't allow restart so you might have to do "service tgtd stop" then "service tgtd start" instead.

usao 08-27-2014 09:26 AM

Thanks. I tried multiple time to stop/start the service, but I get the error each time.
The error pops-up if I use either the init script or the service command.
Is anyone familiar with the tgtadm command and perhaps sees an incorrect option list?

[root@hpse1 ~]# service tgtd status
tgtd (pid 4785 4784) is running...
[root@hpse1 ~]# service tgtd stop
Stopping SCSI target daemon: [ OK ]
[root@hpse1 ~]# service 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.


All times are GMT -5. The time now is 07:59 PM.