3. Centos 6 - iSCSI

最後更新: 2017-11-21


Centos6 - initiator



yum install iscsi-initiator-utils






/sbin/iscsiadm - open-iscsi administration utility

/sbin/iscsid - Open-iSCSI daemon

/sbin/iscsi-iname - iSCSI initiator name generation tool

/sbin/iscsistart - iSCSI boot tool

/sbin/iscsiuio - iSCSI UserSpace I/O driver (driver for the Broadcom NetXtreme II )


  • /var/lib/iscsi/ifaces
  • /var/lib/iscsi/isns
  • /var/lib/iscsi/nodes - This directory contains the nodes with their targets.
  • /var/lib/iscsi/send_targets - This directory contains the portals.
  • /var/lib/iscsi/slp
  • /var/lib/iscsi/static


Centos6 - iscsiadm (Client)


# Check version

iscsiadm -V

iscsiadm version 6.2.0-873.10.el6

# Usage:

mode: (-m)

  • discovery
  • node
  • session

# Discover targets at a given IP address:

iscsiadm --mode discovery --type sendtargets --portal

iscsiadm -m discovery -t st -p

# Login, must use a node record id found by the discovery:

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

# Logout:

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

# List node records:

            iscsiadm --mode node

# Display all data for a given node record:

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

# auto mount

/dev/sdb1 /mnt/logs ext3 defaults,auto,_netdev 0 0



-a, --ip=ipaddr
-c, --count=count

-H, --host=[hostno|MAC]
-I, --interface=[iface]   <-- /var/lib/iscsi/ifaces

-l, --login
-u, --logout
-m, --mode op
-p, --portal=ip[:port]
-T, --targetname=targetname
-s, --stats
-S, --show

# only valid for discovery mode.
-t, --type=type (st, isns or fw)

st (SendTargets)

A native iSCSI protocol which allows each iSCSI target to send a list of available  targets  to the initiator.

isns (Internet Storage Name Service)

records information about storage volumes within a larger network.


Several  NICs and systems contain a mini iSCSI initiator which can be used for boot.
To get the values used for boot the fw option can be used.


0      ISCSI_SUCCESS - command executed successfully.
5      ISCSI_ERR_LOGIN - generic iSCSI login failure.