Configuration of iscsitarget and iSCSI initator in Linux

Source: Internet
Author: User
Tags dmesg
Linux iSCSI target configuration process

Article category: Operating System

I. Install iSCSI target for Linux
1. Operating System:
[Root @ rac2 ~] # Cat/etc/issue
Enterprise Linux as Release 4 (October Update 4)
Kernel R on an M
[Root @ rac2/] # uname-
Linux rac2.mycorpdomain.com 2.6.9-42.0.0.0.1.elsmp #1 SMP sun Oct 15 14:02:40 PDT 2006 i686 i686 i386 GNU/Linux
[Root @ rac2/] #

2. decompress the file
[Root @ rac2 ~] # Tar-xzvf iscsitarget-0.4.15.tar.gz
3. Compile
[Root @ rac2 ~] # Cd iscsitarget-0.4.15
[Root @ rac2 iscsitarget-0.4.15] # ls
Changelog copying Doc etc include kernel makefile patches readme. VMWare USR
[Root @ rac2 iscsitarget-0.4.15] # Make
[Root @ rac2 iscsitarget-0.4.15] # make install

 

4. Configuration
[Root @ maid iscsitarget-0.4.15] # vi/etc/ietd. conf
User userid superpassword
Target iqn.2001-04.com. Example: storage. disk2.sys1. XYZ
Lun 0/dev/sdb1 fileio
Alias lun0

5. Start the service
[Root @ rac2 etc] # cd/etc/init. d
[Root @ rac2 init. d] # ls

6. Check for verification
Dmesg-C

 

7. modify the configuration file:
Target iqn.2001-04.com. Example: storage. disk2.sys1. idisk
Lun 4 Path =/dev/sdb1, type = fileio
Alias SDB
The dmesg information is as follows:
Iscsi enterprise target software-version 0.4.15
Iotype_init (92) Register fileio
Iotype_init (92) Register blockio
Iotype_init (92) Register nullio
Log information:
Oct 25 16:31:35 test kernel: iSCSI enterprise target software-version 0.4.15
Oct 25 16:31:35 test kernel: iotype_init (92) Register fileio
Oct 25 16:31:35 test kernel: iotype_init (92) Register blockio
Oct 25 16:31:35 test kernel: iotype_init (92) Register nullio

I have been working on this place for a long time. I have been reading articles about the configuration files which can be configured as follows:
Target iqn.2001-04.com. Example: storage. disk2.sys1. XYZ
Lun 0/dev/sdb1 fileio
Alias Test
But I have never been able to. I used to be a virtual machine and re-installed redhat4u4. I still cannot. I installed redhat5, but I still cannot.

In the middle, I also tried to use the following configuration file:
User userid superpassword
Target iqn.2001-04.com. Example: storage. disk2.sys1. XYZ
Lun 0 Path =/dev/sdb1, type = fileio
Alias Test
But not yet. I finally found that I wrote the letter "type" in lower case.

2. Red Hat Linux iSCSI initiator Configuration
1. Operating System:
[Root @ Rac1 ~] # Cat/etc/issue
Enterprise Linux as Release 4 (October Update 4)
Kernel R on an M
[Root @ Rac1 ~] #
2. Install Initiator
[Root @ Rac1 ~] # Rpm-IVH iscsi-initiator-utils-4.0.3.0-4.i386.rpm
Warning: iscsi-initiator-utils-4.0.3.0-4.i386.rpm: V3 DSA Signature: nokey, key ID db42a60e
Preparing... ######################################## ### [100%]
1: iscsi-initiator-utils ################################### ####### [1, 100%]
[Root @ Rac1 ~] #
3. Modify the/etc/iscsid. conf file.
VI/etc/iscsid. conf
Modify the following three items:
Discoveryaddress = <IP address>
This needs to be set to the Group IP address of your uit array.
Sendasynctext = Yes
For the initiator to receive Vendor Specific async events from the target.
Continuous = Yes
To globally specify that all discovery sessions be kept open.
4. Start the service
[Root @ Rac1 etc] # service iSCSI start
Checking iSCSI config: [OK]
Loading iSCSI DRIVER: [OK]
Mknod: '/dev/iscsictl': file exists
Starting iscsid: [OK]
[Root @ Rac1 etc] #
5. Set the iscsi service
[Root @ Rac1 etc] # chkconfig -- list iSCSI
[Root @ Rac1 etc] # chkconfig -- add iSCSI
[Root @ Rac1 etc] # chkconfig -- add iSCSI
[Root @ Rac1 etc] # chkconfig iSCSI on
[Root @ Rac1 etc] # chkconfig -- list iSCSI
Iscsi 0: off 1: off 2: On 3: On 4: On 5: on 6: Off
6. view the SCSI Device
[Root @ Rac1 etc] # iSCSI-ls
**************************************** ***************************************
Sfnet iSCSI driver version.... 1.11-3 (02-may-2006)
**************************************** ***************************************
[Root @ Rac1 etc] #
7. Normally:
[Root @ Rac1 ~] # ISCSI-ls
**************************************** ***************************************
Sfnet iSCSI driver version.... 1.11-3 (02-may-2006)
**************************************** ***************************************
Target name: iqn.2001-04.com. Example: storage. disk2.sys1. idisk
Target alias:
Host ID: 6
Bus ID: 0
Target ID: 0
Target address: 172.25.1.100: 3260,1
Session Status: established at Thu Oct 25 00:46:13 CST 2007
Session ID: isid 00023d000001 tsih 200
**************************************** ***************************************
[Root @ Rac1 ~] #

8. You can see the newly added device through dmesg.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.