How to setup iSCSI targets on CentOS 6.5 with 2.x kernel?
CentOSThis forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.