DirectAdmin / iscsi commands and important paths

  • Sunny
  • 0 Comment
  • No tags

iscsi commands


01. To install iscsi-initiator

yum install iscsi-initiator-utils

02. To find out InitiatorName

cat /etc/iscsi/initiatorname.iscsi

03. To discover all available targets

iscsiadm -m discovery -t sendtargets -p XX.XX.XXX.XX

04. To discover all available targets with verbosity

iscsiadm -d 2 -m discovery -t sendtargets -p XX.XX.XXX.XX

Note: We can increase verbosity by increasing the value giving to “-d” switch

05. To check the available iSCSI node(s) to connect [in other words, to make sessions]

iscsiadm -m node

06. To see active sessions

iscsiadm -m session

07. To login a session with mutual CHAP authentication

iscsiadm -m node -T -o update -n node.session.auth.authmethod -v CHAP
iscsiadm -m node -T -o update -n node.session.auth.username -v initiatorusername
iscsiadm -m node -T -o update -n node.session.auth.password -v sv0+XgpE46TB
iscsiadm -m node -T -o update -n node.session.auth.username_in -v targetusername
iscsiadm -m node -T -o update -n node.session.auth.password_in -v B/J1nSaWbvIt
iscsiadm -m node -T -p XX.XX.XX.XX --login

08. To logout a particular session

iscsiadm -m session --logout

09. To logout all sessions

iscsiadm -m node --logout all

10. To delete a target

iscsiadm -m node --op delete --targetname

11. Important paths


12. Mounting iSCSI drives.

a. Create partition on logged in iSCSI drive
b. Create file system on it.
c. Mount the partition with “_netdev” option via fstab


Leave a comment