Why iscsiadm command does not create proper directory structure in /var/lib/iscsi/nodes?

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux 5.8
  • iscsi-initiator-utils-6.2.0.872-13.el5
  • kernel-2.6.18-308.11.1.el5

Issue

  • iscsiadm does not create proper directory structure in /var/lib/iscsi/nodes

Resolution

Create iscsi target using below commands will create directory structure in /var/lib/iscsi/nodes

# iscsiadm -m discovery -t st -p _ip_of_iscsi_target:3260
# iscsiadm -m node -T iqn.target_name -p _ip_of_iscsi_target:3260 -l 

Root Cause

discovering iscsi target with below command

# iscsiadm -m node -o new -T iqn.target_name -p _ip_of_iscsi_target:3260 

will not crate dirctory stucture in /var/lib/iscsi/nodes as below command is responsible for creating it

# iscsiadm -m discovery -t st -p _ip_of_iscsi_target:3260

Diagnostic Steps

If iscsi target is discovered from client side using below command

# iscsiadm -m node -o new -T iqn.target_name -p _ip_of_iscsi_target:3260

then in /var/lib/iscsi/nodes directory we will have file containing iscsi information instead of directory

# pwd 
/var/lib/iscsi/nodes

# ls -ltr
total 4
-rw------- 1 root root 1772 Jul 22 05:24 _ip_of_iscsi_target:3260 <---- this should be directory instared of file

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments