{"id":492,"date":"2013-03-18T11:57:44","date_gmt":"2013-03-18T09:57:44","guid":{"rendered":"http:\/\/www.dmelody.com\/?p=492"},"modified":"2013-03-18T11:57:44","modified_gmt":"2013-03-18T09:57:44","slug":"iscsi-protocol-how-to-use-in-linux-environment-using-simple-dd-created-images","status":"publish","type":"post","link":"https:\/\/www.dmelody.com\/?p=492","title":{"rendered":"iSCSI protocol, how to use in Linux environment using simple DD created images."},"content":{"rendered":"<p>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&#8230; So will work only in LAN, or WAN.<\/p>\n<p>iSCSI target for Linux &#8211; sources for compiling.<\/p>\n<p>iSCSI initiator exists on following linux OS installations, windows is not supported:<\/p>\n<p>RHEL &#8211; 5.6\/7 6.0 and 6.1<br \/>\niSCSI consists of server and client sides. iSCSI target is installed on the server side and iSCSI initiator is used on the client.<\/p>\n<p>iSCSI target installation process:<\/p>\n<p>tar xvfz iscsitarget-1.4.20.2.tar.gz<br \/>\ncd iscsitarget-1.4.20.2<br \/>\nmake &#038;&#038; make install<br \/>\niSCSI target configuration process:<\/p>\n<p> vi \/etc\/iet\/ietd.conf (Add the following line \u2013 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)<br \/>\nTarget iqn.2001-04.com.example:storage.lun1<br \/>\nIncomingUser iscsi Password1<br \/>\nOutgoingUser iscsi Password1<br \/>\nLun 0 Path=\/media\/sdb1\/storage\/lun1.img,Type=fileio<br \/>\nAlias iscsi0<br \/>\n:wq<br \/>\ncd \/media\/sdb1\/storage\/<br \/>\ndd if=\/dev\/zero of=lun1.img bs=1024k count=10000 (the following line would create an image of 10GB size)<br \/>\nnote the above configuration of \/etc\/iet\/ietd.conf should point to correct path of the image file<br \/>\nrestart the &#8220;\/etc\/init.d\/iscsi-target restart&#8221; to load the new configuration<br \/>\niSCSI 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:<br \/>\niscsiadm -m discovery -t st -p 10.76.5.125<br \/>\niscsiadm -m node<br \/>\niscsiadm -m node &#8211;targetname &#8220;iqn.2001-04.com.example:storage.lun1&#8221; &#8211;portal &#8220;10.76.5.125:3260&#8221; &#8211;op=update &#8211;name node.session.auth.authmethod &#8211;value=CHAP<br \/>\niscsiadm -m node &#8211;targetname &#8220;iqn.2001-04.com.example:storage.lun1&#8221; &#8211;portal &#8220;10.76.5.125:3260&#8221; &#8211;op=update &#8211;name node.session.auth.username &#8211;value=iscsi<br \/>\niscsiadm -m node &#8211;targetname &#8220;iqn.2001-04.com.example:storage.lun1&#8221; &#8211;portal &#8220;10.76.5.125:3260&#8221; &#8211;op=update &#8211;name node.session.auth.password &#8211;value=Password1<br \/>\niscsiadm -m node &#8211;targetname &#8220;iqn.2001-04.com.example:storage.lun1&#8221; &#8211;portal &#8220;10.76.5.125:3260&#8221; &#8211;login<br \/>\nvi \/etc\/iscsi\/iscsid.conf and verify the following line exist: node.startup = automatic<br \/>\nVerify with fdisk -l that the new device name is added correctly<br \/>\nNow you can process to formatting and partitioning<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230; So will work only in LAN, or WAN. iSCSI target for Linux &#8211; sources for compiling. iSCSI initiator exists on following linux OS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[210],"tags":[241,239,94,240,39],"class_list":["post-492","post","type-post","status-publish","format-standard","hentry","category-linux-stuff","tag-hack","tag-iscsi","tag-linux","tag-storage","tag-technology"],"_links":{"self":[{"href":"https:\/\/www.dmelody.com\/index.php?rest_route=\/wp\/v2\/posts\/492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dmelody.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dmelody.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dmelody.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dmelody.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=492"}],"version-history":[{"count":2,"href":"https:\/\/www.dmelody.com\/index.php?rest_route=\/wp\/v2\/posts\/492\/revisions"}],"predecessor-version":[{"id":494,"href":"https:\/\/www.dmelody.com\/index.php?rest_route=\/wp\/v2\/posts\/492\/revisions\/494"}],"wp:attachment":[{"href":"https:\/\/www.dmelody.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dmelody.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dmelody.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}