25.2. Creating an iSCSI Initiator
25.2. Creating an iSCSI Initiator In Red Hat Enterprise Linux 7, the iSCSI service is lazily started by default: the service starts after running the iscsiadm command. Procedure 25.7. Creating an iSCSI Initiator Install iscsi-initiator-utils : If the ACL was given a custom name in Section 25.1.6, "Configuring ACLs" , modify the /etc/iscsi/initiatorname.iscsi file accordingly. For example: Discover the target: Log in to the target with the target IQN you discovered in step 3: This procedure can be followed for any number of initators connected to the same LUN so long as their specific initiator names are added to the ACL as described in Section 25.1.6, "Configuring ACLs" . Find the iSCSI disk name and create a file system on this iSCSI disk: Replace disk_name with the iSCSI disk name displayed in /var/log/messages . Mount the file system: Replace /mount/point with the mount point of the partition. Edit the /etc/fstab to mount the file system automatically when the system boots: Replace disk_name with the iSCSI disk name. Log off from the target:
yum install iscsi-initiator-utils -y cat /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.2006-04.com.example.node1 # vi /etc/iscsi/initiatorname.iscsi iscsiadm -m discovery -t st -p target-ip-address 10.64.24.179:3260,1 iqn.2006-04.com.example:3260 iscsiadm -m node -T iqn.2006-04.com.example:3260 -l Logging in to [iface: default, target: iqn.2006-04.com.example:3260, portal: 10.64.24.179,3260] (multiple) Login to [iface: default, target: iqn.2006-04.com.example:3260, portal: 10.64.24.179,3260] successful. grep "Attached SCSI" /var/log/messages # mkfs.ext4 /dev/ disk_name mkdir /mount/point # mount /dev/ disk_name /mount/point vim /etc/fstab /dev/ disk_name /mount/point ext4 _netdev 0 0 iscsiadm -m node -T iqn.2006-04.com.example:3260 -u