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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. Command ntpstat Shows unsynchronised (CentOS/RHEL)
  2. How to Configure Proxy in CentOS/RHEL/Fedora
  3. CentOS / RHEL 6 : How to Change the Volume Group Name for Root Disk Device
  4. Connection using SSH to a Host Not in DNS/hosts Stalls for Some Time at Connection Initiation
  5. iSCSI troubleshooting : Targets Not Detected After Reboot
  6. CentOS / RHEL 6 : How to limit memory resources for a specific user using cgroups
  7. Linux OS service ‘nfs’
  8. RedHat / CentOS : How to change currently active slave interface of bonding online
  9. Linux OS Service ‘vncserver’
  10. RHEL / CentOS : How to shrink LVM volume

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary