LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 08-26-2014, 11:04 AM   #1
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Rep: Reputation: Disabled
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?
 
Old 08-26-2014, 12:21 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.

Last edited by MensaWater; 08-26-2014 at 12:22 PM.
 
Old 08-26-2014, 04:37 PM   #3
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Original Poster
Rep: Reputation: Disabled
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.
 
Old 08-27-2014, 08:00 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.
 
Old 08-27-2014, 09:26 AM   #5
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Original Poster
Rep: Reputation: Disabled
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.

Last edited by usao; 08-27-2014 at 09:28 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] pacemaker - iscsi: how to set up iscsi targets/logical units? eantoranz Linux - Server 9 01-02-2013 08:38 AM
What is the recommended way to setup Linux with iSCSI targets the_gripmaster Red Hat 3 06-17-2011 07:51 AM
RHEL4 enumerate iSCSI targets joeldavis Linux - Enterprise 2 05-23-2011 09:04 AM
Loading iscsi targets on reboot Neruocomp *BSD 0 06-28-2010 10:03 AM
iSCSI Targets for Tape (character) Devices ben.kuiper Linux - Networking 3 03-15-2007 10:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 03:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration