storage

iSCSI protocol, how to use in Linux environment using simple DD created images.

On 18/03/2013, in Linux stuff, by admin

First of all, iSCSI protocol cannot run in NATed environment, due to protocol implementation which makes the LUN scan over different TCP session, and ports which are used there are not trivial… So will work only in LAN, or WAN.

iSCSI target for Linux – sources for compiling.

iSCSI initiator exists on following linux OS installations, windows is not supported:

RHEL – 5.6/7 6.0 and 6.1
iSCSI consists of server and client sides. iSCSI target is installed on the server side and iSCSI initiator is used on the client.

iSCSI target installation process:

tar xvfz iscsitarget-1.4.20.2.tar.gz
cd iscsitarget-1.4.20.2
make && make install
iSCSI target configuration process:

vi /etc/iet/ietd.conf (Add the following line – we are going to use images created by using the dd utility, see the example for creating the image files below (delete everything else there)
Target iqn.2001-04.com.example:storage.lun1
IncomingUser iscsi Password1
OutgoingUser iscsi Password1
Lun 0 Path=/media/sdb1/storage/lun1.img,Type=fileio
Alias iscsi0
:wq
cd /media/sdb1/storage/
dd if=/dev/zero of=lun1.img bs=1024k count=10000 (the following line would create an image of 10GB size)
note the above configuration of /etc/iet/ietd.conf should point to correct path of the image file
restart the “/etc/init.d/iscsi-target restart” to load the new configuration
iSCSI initiator configuration process: (note the IP address is the IP address of the iSCSI target server, the following commands are automatically added to the iSCSI initiator configuration:
iscsiadm -m discovery -t st -p 10.76.5.125
iscsiadm -m node
iscsiadm -m node –targetname “iqn.2001-04.com.example:storage.lun1” –portal “10.76.5.125:3260” –op=update –name node.session.auth.authmethod –value=CHAP
iscsiadm -m node –targetname “iqn.2001-04.com.example:storage.lun1” –portal “10.76.5.125:3260” –op=update –name node.session.auth.username –value=iscsi
iscsiadm -m node –targetname “iqn.2001-04.com.example:storage.lun1” –portal “10.76.5.125:3260” –op=update –name node.session.auth.password –value=Password1
iscsiadm -m node –targetname “iqn.2001-04.com.example:storage.lun1” –portal “10.76.5.125:3260” –login
vi /etc/iscsi/iscsid.conf and verify the following line exist: node.startup = automatic
Verify with fdisk -l that the new device name is added correctly
Now you can process to formatting and partitioning

Tagged with: