Linux (commonly pronounced LIH-N?ks in English; variants exist) is a Unix-like computer operating system. Linux is one of the most prominent examples of free software and open source development: typically all underlying source code can be freely modified, used, and redistributed by anyone.

Tags | | |

Centos ISCSI initiator

To mount and use an ISCSI volume you'll need to install the following tools:



yum install iscsi-initiator-utils


Now locate the targets (drives) on the ISCSI server.



/sbin/iscsiadm -m discovery -t sendtargets -p 192.168.0.4
/etc/init.d/iscsi restart


Once the above starts ok, you can use fdisk -l to see your new disk, then just format and treat it as you would any other disc.




I ran into an interesting problem on one clients configuration though, the client had a ISCI server behind a NAT router. When the CentOS box would try to connect I would get the following eror:


iscsiadm: Could not login to [iface: default, target: iqn.1986-03.com.sun:02:8c8d457f-bd70-4b0f-8f8a-xxxx, portal: 192.168.0.101,3260]:
iscsiadm: initiator reported error (8 - connection timed out)
iscsiadm: Could not log into all portals. Err 8.


It took forever to figure out what was going on, I had to do TCP dumps and finally relized what was going wrong, while the discovery worked correctly, when the client tried to connect to the server, it was sending the request to the NAT address, and that client and server where on different networks. So I edited the config file for that node:



sudo nano /var/lib/iscsi/nodes/IQN name/IP-address/default


Then I looked for the following lines:
node.discovery_address = xxx.xxx.xxx.xxx
node.conn[0].address = 192.168.0.101
I then changed the 2nd line to match the top line, ran /etc/init.d/iscsi restart and BOOM, she was working like a champ!



Comments

Feel free to leave a comment or question

Name: (Optional but appreciated):

Comment:

Use [code] [/code] for code block style



Security Code: