• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Understanding iscsiadm Utility in CentOS / RHEL

by admin

Internet Small Computer System Interface (iSCSI) is an IP-based standard for connecting storage devices. iSCSI uses IP networks to encapsulate SCSI commands, allowing data to be transferred over long distances. iSCSI provides shared storage among a number of client systems. Storage devices are attached to servers (targets). Client systems (initiators) access the remote storage devices over IP networks. To the client systems, the storage devices appear to be locally attached. iSCSI uses the existing IP infrastructure and does not require any additional cabling, as is the case with Fibre Channel (FC) storage area networks.

Open-iSCSI persistent configuration is implemented as a database, which consists of a hierarchy of files and directories in the /var/lib/iscsi/ directory:

# ls -l /var/lib/iscsi
total 0
drwxr-xr-x. 2 root root 6 Jun 27  2017 ifaces
drwxr-xr-x. 2 root root 6 Jun 27  2017 isns
drwxr-xr-x. 2 root root 6 Jun 27  2017 nodes
drwxr-xr-x. 2 root root 6 Jun 27  2017 send_targets
drwxr-xr-x. 2 root root 6 Jun 27  2017 slp
drwxr-xr-x. 2 root root 6 Jun 27  2017 static

Use the iscsiadm utility to update, delete, insert, and query the persistent database. Also use this utility to establish a session between a target and an initiator. Several different operational modes are available for the command.

  • discoverydb: Updates or queries the Open-iSCSI database records
  • discovery: Performs a discovery operation
  • node: Performs an operation on a portal (IP:port) on an iSCSI target
  • session: Performs an operation on a TCP connection between an initiator and a target
  • iface: Performs an operation on a network interface

Additional options to iscsiadm include:

  • -type – Specify the discover type.
  • -portal – Specify the iSCSI target portal.

iscsiadm connection commands

1. Discover targets at a given IP address:

# iscsiadm --mode discoverydb --type sendtargets --portal 192.168.1.10 --discover

2. Login into a iscsi target (must use a node record id found by the discovery).

# iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --login

3. Logout from a iscsi target.

# iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --logout

4. List node records:

# iscsiadm --mode node

5. Display all data for a given node record:

# iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. AdGuardHome – A network-wide software for blocking ads & tracking (Command Examples)
  2. “git prune” Command Examples
  3. Understanding Basic File Permissions and ownership in Linux
  4. flex: Lexical analyzer generator (Based on lex)
  5. rfkill: command not found
  6. ufw: command not found
  7. How to Install SSHFS on CentOS/RHEL/Ubuntu
  8. nmcli Command Examples in Linux (Cheat Sheet)
  9. How to use FTP under Linux to transfer files
  10. How to control resource (cgroup) with systemd for user process group in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright