iscsiadm 用法

data from

Understanding iscsiadm Utility in CentOS / RHEL
Discovering iSCSI targets using Send Targets


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.


  1. Discover targets at a given IP address:

iscsiadm –mode discoverydb –type sendtargets –portal –discover

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

iscsiadm –mode node –targetname –portal –login

  1. Logout from a iscsi target.

iscsiadm –mode node –targetname –portal –logout

  1. List node records:

iscsiadm –mode node

  1. Display all data for a given node record:

iscsiadm –mode node –targetname –portal

command detail

specify the iSCSI qualified name (IQN)

The initiator name that you choose must match the iSCSI name given to the Storwize® V7000 host object for this system.

Edit the /etc/iscsi/initiatorname.iscsi file to specify the IQN name. The following example shows a sample name:

discovery command

Run the discovery command on linux host:

iscsiadm –mode discovery –type sendtargets –portal 192.0.2.* 复制
#where 192.0.2.
is the IP address of the iSCSI target on the Storwize V7000 clustered system.

When you use the discovery command, you can substitute:
* -m for –mode
* -t for –type
* -p for –portal

connect to a specific portal on a discovered target.

The Storwize® V7000 system supports only one iSCSI session between an initiator and a target.

On the Linux host, use the following command to log on to the Storwize V7000 system target:

iscsiadm –mode node –target –portal 192.0.2.* –login

# iscsiadm –mode node –target –portal 192.0.2.* –login
Logging in to [iface: default, target:, portal: 192.0.2.,3260] (multiple)
Login to [iface: default, target:, portal: 192.0.2.
,3260] successful.

When the login command completes, the device nodes for the Storwize V7000 system volumes that are mapped to the host are created on Linux host system.

[2:0:0:0] disk IBM 2145 0000 /dev/sda
[2:0:0:1] disk IBM 2145 0000 /dev/sdb 复制

Categorized as tool

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.