{
    "mode": "man",
    "parameter": "ISCSIADM",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/ISCSIADM/8/json",
    "generated": "2026-06-14T12:21:06Z",
    "synopsis": "iscsiadm  -m  discoverydb [-hV] [-d debuglevel] [-P printlevel] [-I iface -t type -p ip:port\n[-lD] ] | [ [-p ip:port -t type] [-o operation] [-n name] [-v value] [-lD] ]\niscsiadm -m discovery [-hV] [-d  debuglevel]  [-P  printlevel]  [-I  iface]  [-t  type]  [-p\nip:port] [-l]\niscsiadm -m node [-hV] [-d debuglevel] [-P printlevel] [-L all,manual,automatic,onboot] [-W]\n[-U all,manual,automatic,onboot] [-S] [ [-T targetname -p ip:port -I iface] [-l|-u|-R|-s] ] [\n[-o operation] [-n name] [-v value] [-p ip:port] ]\niscsiadm  -m  session  [-hV]  [-d  debuglevel]  [-P  printlevel] [-r sessionid|sysfsdir [-R]\n[-u|-s|-o new] ]\niscsiadm -m iface [-hV] [-d debuglevel] [-P printlevel] [-I ifacename | -H hostno|MAC] [ [-o\noperation]  [-n name] [-v value] ] [ -C ping [-a ip] [-b packetsize] [-c count] [-i interval]\n]\niscsiadm -m fw [-d debuglevel] [-l] [-W]\niscsiadm -m host [-P printlevel] [-H hostno|MAC] [ [-C chap [-x chaptblidx] ] | [-C flashn‐\node  [-A  portaltype]  [-x  flashnodeidx]  ]  | [-C stats] ] [ [-o operation] [-n name] [-v\nvalue] ]",
    "sections": {
        "NAME": {
            "content": "iscsiadm - open-iscsi administration utility\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "iscsiadm  -m  discoverydb [-hV] [-d debuglevel] [-P printlevel] [-I iface -t type -p ip:port\n[-lD] ] | [ [-p ip:port -t type] [-o operation] [-n name] [-v value] [-lD] ]\n\niscsiadm -m discovery [-hV] [-d  debuglevel]  [-P  printlevel]  [-I  iface]  [-t  type]  [-p\nip:port] [-l]\n\niscsiadm -m node [-hV] [-d debuglevel] [-P printlevel] [-L all,manual,automatic,onboot] [-W]\n[-U all,manual,automatic,onboot] [-S] [ [-T targetname -p ip:port -I iface] [-l|-u|-R|-s] ] [\n[-o operation] [-n name] [-v value] [-p ip:port] ]\n\niscsiadm  -m  session  [-hV]  [-d  debuglevel]  [-P  printlevel] [-r sessionid|sysfsdir [-R]\n[-u|-s|-o new] ]\n\niscsiadm -m iface [-hV] [-d debuglevel] [-P printlevel] [-I ifacename | -H hostno|MAC] [ [-o\noperation]  [-n name] [-v value] ] [ -C ping [-a ip] [-b packetsize] [-c count] [-i interval]\n]\n\niscsiadm -m fw [-d debuglevel] [-l] [-W]\n\niscsiadm -m host [-P printlevel] [-H hostno|MAC] [ [-C chap [-x chaptblidx] ] | [-C flashn‐\node  [-A  portaltype]  [-x  flashnodeidx]  ]  | [-C stats] ] [ [-o operation] [-n name] [-v\nvalue] ]\n",
            "subsections": [
                {
                    "name": "iscsiadm -k priority",
                    "content": ""
                }
            ]
        },
        "DESCRIPTION": {
            "content": "The iscsiadm utility is a command-line tool allowing discovery and login to iSCSI targets, as\nwell as access and management of the open-iscsi database.\n\nOpen-iscsi  does  not use the term node as defined by the iSCSI RFC, where a node is a single\niSCSI initiator or target. Open-iscsi uses the term node to refer to a portal on a target.\n\nFor session mode, a session id (sid) is used. The sid of a session can be  found  by  running\niscsiadm  -m  session -P 1. The session id and sysfs path are not currently persistent and is\npartially determined by when the session is setup.\n\nNote that many of the node and discovery operations require that the iSCSI daemon (iscsid) be\nrunning.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-a --ip=",
                    "content": "ipaddr can be IPv4 or IPv6.\n\nThis option is only valid for ping submode.\n",
                    "flag": "-a"
                },
                {
                    "name": "-A --portal",
                    "content": "Specify the portal type for the new flash node entry to be created.\n\nThis  option is only valid for flashnode submode of host mode and only with new opera‐\ntion.\n",
                    "flag": "-A",
                    "long": "--portal"
                },
                {
                    "name": "-b --packetsize=",
                    "content": "Specify the ping packetsize.\n\nThis option is only valid for ping submode.\n",
                    "flag": "-b"
                },
                {
                    "name": "-c --count=",
                    "content": "count specify number of ping iterations.\n\nThis option is only valid for ping submode.\n",
                    "flag": "-c"
                },
                {
                    "name": "-C --submode=",
                    "content": "Specify the submode for mode. op must be name of submode.\n\nCurrently iscsiadm support ping as submode for iface. For example:\n\niscsiadm -m iface -I ifacename -C ping -a ipaddr -b packetsize -c count -i interval\n\nFor host, it supports chap , flashnode and stats as submodes. For example:\n\niscsiadm -m host -H hostno -C chap -x chaptblidx -o operation\n\niscsiadm -m host -H hostno -C flashnode -x flashnodeidx -o operation\n\niscsiadm -m host -H hostno -C stats\n",
                    "flag": "-C"
                },
                {
                    "name": "-d --debug=",
                    "content": "print debugging information. Valid values for debuglevel are 0 to 8.\n",
                    "flag": "-d"
                },
                {
                    "name": "-h --help",
                    "content": "display help text and exit\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-H --host=",
                    "content": "The host argument specifies the SCSI host to use for the operation. It can be the scsi\nhost  number  assigned to the host by the kernel's scsi layer, or the MAC address of a\nscsi host.\n",
                    "flag": "-H"
                },
                {
                    "name": "-i --interval=",
                    "content": "interval specify delay between two ping iterations.\n\nThis option is only valid for ping submode.\n",
                    "flag": "-i"
                },
                {
                    "name": "-I --interface=",
                    "content": "The interface argument specifies the iSCSI interface to use for the operation.   iSCSI\ninterfaces  (iface) are defined in /etc/iscsi/ifaces. For hardware iSCSI (qla4xxx) the\niface config must have the hardware address (iface.hwaddress = port's MAC address) and\nthe  driver/transportname  (iface.transportname). The iface's name is then the file‐\nname of the iface config. For software iSCSI, the iface config must  have  either  the\nhardware   address   (iface.hwaddress),   or   the   network  layer's  interface  name\n(iface.netifacename), and it must have the driver/transportname\n\nThe available drivers/iscsitransports are tcp  (software  iSCSI  over  TCP/IP),  iser\n(software  iSCSI  over  InfiniBand), qla4xxx (Qlogic 4XXXX and 82XXX HBAs), cxgb3i and\ncxgb4i (Chelsio T3 and T4 adapters), bnx2i (QLogic Netextreme II  adapters),  be2iscsi\n(Emulex 10G adapter), qedi (QLogic QEDI 25/40/100Gb adapter), and ocs (Emulex One Con‐\nnect storage).  Some of these are considered  experimental,  as  they  are  not  fully\ntested.\n\nThe hwaddress is the MAC address or for software iSCSI it may be the special value de‐\nfault which directs the initiator to not bind the session to a specific  hardware  re‐\nsource  and  instead allow the network or InfiniBand layer to decide what to do. There\nis no need to create an iface config with the default behavior. If you do not  specify\nan iface, then the default behavior is used.\n\nAs  mentioned  above  there is a special iface name default. There are others which do\nnot bind the session to a specific card, but instead bind the session  to  the  trans‐\nport: iser, cxgb3i, cxgb4i, and bnx2i.\n\nIn discovery mode multiple interfaces can be specified by passing in multiple -I/--in‐\nterface instances. For example:\n\nsh# iscsiadm -m discoverydb -t st -p ip:port -I iface0 -I iface2 --discover\n\nWill direct iscsiadm to setup the node db to create records which will create sessions\nthrough the two intefaces passed in.\n\nIn node mode, only a single interface is supported in each call to iscsiadm.\n\nThis option is valid for discovery, node and iface mode.\n",
                    "flag": "-I"
                },
                {
                    "name": "-k --killiscsid=",
                    "content": "Currently  priority must be zero. This will immediately stop all iscsid operations and\nshutdown iscsid. It does not logout any sessions. Running this command is the same  as\ndoing  killall iscsid. Neither should normally be used, because if iscsid is doing er‐\nror recovery or if there is an error while iscsid is not running, the system  may  not\nbe able to recover.  This command and iscsid's SIGTERM handling are experimental.\n",
                    "flag": "-k"
                },
                {
                    "name": "-D --discover",
                    "content": "Discover targets using the discovery record with the  recid matching the the discovery\ntype and portal passed in. If there is no matching record, it will  be  created  using\nthe  iscsid.conf  discovery  settings.  This must be passed in discoverydb mode to in‐\nstruct iscsiadm to perform discovery.\n\nThis option is only valid for SendTargets discovery mode.\n",
                    "flag": "-D",
                    "long": "--discover"
                },
                {
                    "name": "-l --login",
                    "content": "For node and fw mode, login to a specified record. For discovery mode,  login  to  all\ndiscovered targets.\n\nThis option is only valid for discovery and node modes.\n",
                    "flag": "-l",
                    "long": "--login"
                },
                {
                    "name": "-L --loginall=",
                    "content": "For  node  mode,  login all sessions with the node or conn startup values passed in or\nall running session, except ones marked onboot, if all is passed in.\n\nThis option is only valid for node mode (it is valid but not  functional  for  session\nmode).\n",
                    "flag": "-L"
                },
                {
                    "name": "-W ---no",
                    "content": "In  node,  discovery,  or  firmware mode, do not wait for a response from the targets.\nThis means that success will be returned if the command is able to send the login  re‐\nquests, whether or not they succeed. In this case, it will be up to the caller to poll\nfor success (i.e. session creation).\n",
                    "flag": "-W"
                },
                {
                    "name": "-m --mode",
                    "content": "specify the mode. op must be one of discovery, discoverydb, node, fw,  host  iface  or\nsession.\n\nIf  no  other options are specified: for discovery, discoverydb and node, all of their\nrespective records are displayed; for session, all active sessions and connections are\ndisplayed;  for  fw, all boot firmware values are displayed; for host, all iSCSI hosts\nare displayed; and for iface, all ifaces setup in /etc/iscsi/ifaces are displayed.\n",
                    "flag": "-m",
                    "long": "--mode"
                },
                {
                    "name": "-n --name=",
                    "content": "In node mode, specify a field name in a record. In flashnode  submode  of  host  mode,\nspecify name of the flash node parameter.\n\nFor use with the update operator.\n",
                    "flag": "-n"
                },
                {
                    "name": "-o --op=",
                    "content": "Specifies  a database operator op. op must be one of new, delete, update, show or non‐\npersistent.\n\nFor iface mode, apply and applyall  are also applicable.\n\nFor flashnode submode of host mode, login and logout are also applicable.\n\nThis option is valid for all modes except fw. Delete should not be used on  a  running\nsession. If it is iscsiadm will stop the session and then delete the record.\n\nnew  creates  a new database record for a given object. In node mode, the recid is the\ntarget name and portal (IP:port). In iface mode, the recid is the iface name. In  dis‐\ncovery mode, the recid is the portal and discovery type.\n\nIn  session mode, the new operation logs in a new session using the same node database\nand iface information as the specified session.\n\nIn discovery mode, if the recid and new operation is passed in, but the --discover ar‐\ngument  is not, then iscsiadm will only create a discovery record (it will not perform\ndiscovery). If the --discover argument is passed in  with  the  portal  and  discovery\ntype,  then  iscsiadm  will  create the discovery record if needed, and it will create\nrecords for portals returned by the target that do not yet have a node DB record.\n\ndelete deletes a specified recid. In discovery mode, if iscsiadm is performing discov‐\nery it will delete records for portals that are no longer returned.\n\nupdate  will  update the recid with name to the specified value. In discovery mode, if\niscsiadm is performing discovery the recid, name  and value arguments are not  needed.\nThe  update operation will operate on the portals returned by the target, and will up‐\ndate the node records with info from the config file and command line.\n\nshow is the default behaviour for node, discovery and iface mode. It is also used when\nthere  are  no commands passed into session mode and a running sid is passed in.  name\nand value are currently ignored when used with show.\n\nnonpersistent instructs iscsiadm to not manipulate the node DB.\n\napply will cause the network settings to take effect on the specified iface.\n\napplyall will cause the network settings to take effect on all the  ifaces  whose  MAC\naddress or host number matches that of the specific host.\n\nlogin will log into the specified flash node entry.\n\nlogout does the logout from the given flash node entry.\n",
                    "flag": "-o"
                },
                {
                    "name": "-p --portal=",
                    "content": "Use  target  portal  with ip-address ip and port. If port is not passed in the default\nport value is 3260.\n\nIPv6 addresses can be specified as [ddd.ddd.ddd.ddd]:port or ddd.ddd.ddd.ddd.\n\nHostnames can also be used for the ip argument.\n\nThis option is only valid for discovery, or for node operations with the new operator.\n\nThis should be used along with --target in node mode, to specify what  the  open-iscsi\ndocs  refer to as a node or node record. Note: open-iscsi's use of the word node, does\nnot match the iSCSI RFC's iSCSI Node term.\n",
                    "flag": "-p"
                },
                {
                    "name": "-P --print=",
                    "content": "If in node mode print nodes in tree format. If in session mode print sessions in  tree\nformat. If in discovery mode print the nodes in tree format.\n",
                    "flag": "-P"
                },
                {
                    "name": "-T --targetname=",
                    "content": "Use target targetname.\n\nThis  should  be used along with --portal in node mode, to specify what the open-iscsi\ndocs refer to as a node or node record. Note: open-iscsi's use of the word node,  does\nnot match the iSCSI RFC's iSCSI Node term.\n",
                    "flag": "-T"
                },
                {
                    "name": "-r --sid=",
                    "content": "Use session ID sid. The sid of a session can be found from running iscsiadm in session\nmode with the --info argument.\n\nInstead of sid, a sysfs path containing the session can be used.   For  example  using\none   of   the   following:  /sys/devices/platform/hostH/sessionS/targetH:B:I/H:B:I:L,\n/sys/devices/platform/hostH/sessionS/targetH:B:I, or  /sys/devices/platform/hostH/ses‐\nsionS, for the sysfsdir argument would result in the session with sid S to be used.\n\nsid | sysfsdir is only required for session mode.\n",
                    "flag": "-r"
                },
                {
                    "name": "-R --rescan",
                    "content": "In  session  mode,  if  sid  is  also passed in rescan the session. If no sid has been\npassed in  rescan all running sessions.\n\nIn node mode, rescan a session running through the target, portal, iface tuple  passed\nin.\n",
                    "flag": "-R",
                    "long": "--rescan"
                },
                {
                    "name": "-s --stats",
                    "content": "Display  session statistics.  This option when used with host mode, displays host sta‐\ntistics.\n",
                    "flag": "-s",
                    "long": "--stats"
                },
                {
                    "name": "-S --show",
                    "content": "When displaying records, do not hide masked values, such as  the  CHAP  secret  (pass‐\nword).\n\nThis option is only valid for node and session mode.\n",
                    "flag": "-S",
                    "long": "--show"
                },
                {
                    "name": "-t --type=",
                    "content": "type must be sendtargets (or abbreviated as st), slp, isns or fw. Currently only send‐\ntargets, fw, and iSNS is supported, see the DISCOVERY TYPES section.\n\nThis option is only valid for discovery mode.\n",
                    "flag": "-t"
                },
                {
                    "name": "-u --logout",
                    "content": "logout for a specified record.\n\nThis option is only valid for node and session mode.\n",
                    "flag": "-u",
                    "long": "--logout"
                },
                {
                    "name": "-U --logoutall=",
                    "content": "logout all sessions with the node or conn startup values passed in or all running ses‐\nsion, except ones marked onboot, if all is passed in.\n\nThis  option  is  only valid for node mode (it is valid but not functional for session\nmode).\n",
                    "flag": "-U"
                },
                {
                    "name": "-v --value=",
                    "content": "Specify a value for use with the update operator.\n\nThis option is only valid for node mode and flashnode submode of host mode.\n",
                    "flag": "-v"
                },
                {
                    "name": "-V --version",
                    "content": "display version and exit\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-x --index=",
                    "content": "Specify the index of the entity to operate on.\n\nThis option is only valid for chap and flashnode submodes of host mode.\n",
                    "flag": "-x"
                }
            ]
        },
        "DISCOVERY TYPES": {
            "content": "iSCSI defines 3 discovery types: SendTargets, SLP, and iSNS.\n\nA special discovery type called  fw  (for  firmware)  is  also  supported,  for  discoverying\nfirmware interfaces, and populating the interface database in the process.\n",
            "subsections": [
                {
                    "name": "SendTargets",
                    "content": "A  native  iSCSI  protocol  which allows each iSCSI target to send a list of available\ntargets to the initiator.\n\nSLP    Optionally an iSCSI target can use the Service Location Protocol (SLP) to announce the\navailable  targets. The initiator can either implement SLP queries directly or can use\na separate tool to acquire the information about available targets.\n\niSNS   iSNS (Internet Storage Name Service) records information about storage volumes  within\na  larger  network.  To  utilize iSNS, pass the address and optionally the port of the\niSNS server to do discovery to.\n\nfw     Firmware mode.  Several NICs and systems contain a mini iSCSI initiator which  can  be\nused  for  boot.  To get the values used for boot the fw option can be used.  Doing fw\ndiscovery, does not store persistent records in the node or discovery DB, because  the\nvalues are stored in the system's or NIC's resource.\n\nPerforming  fw discovery will print the portals, like with other discovery methods. To\nsee other settings like CHAP values and initiator settings, like  you  would  in  node\nmode, run iscsiadm -m fw.\n\nNote that the SLP implementation is under development and currently is not supported.\n"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "On success 0 is returned. On error one of the return codes below will be returned.\n\nCommands  that operate on multiple objects (sessions, records, etc), iscsiadm/iscsistart will\nreturn the first error that is encountered.  iscsiadm/iscsistart will attempt to execute  the\noperation on the objects it can. If no objects are found ISCSIERRNOOBJSFOUND is returned.\n\n0      ISCSISUCCESS - command executed successfully.\n\n1      ISCSIERR - generic error code.\n\n2      ISCSIERRSESSNOTFOUND - session could not be found.\n\n3      ISCSIERRNOMEM - could not allocate resource for operation.\n\n4      ISCSIERRTRANS - connect problem caused operation to fail.\n\n5      ISCSIERRLOGIN - generic iSCSI login failure.\n\n6      ISCSIERRIDBM - error accessing/managing iSCSI DB.\n\n7      ISCSIERRINVAL - invalid argument.\n\n8      ISCSIERRTRANSTIMEOUT - connection timer exired while trying to connect.\n\n9      ISCSIERRINTERNAL - generic internal iscsid/kernel failure.\n\n10     ISCSIERRLOGOUT - iSCSI logout failed.\n\n11     ISCSIERRPDUTIMEOUT - iSCSI PDU timedout.\n\n12     ISCSIERRTRANSNOTFOUND - iSCSI transport module not loaded in kernel or iscsid.\n\n13     ISCSIERRACCESS - did not have proper OS permissions to access iscsid or execute isc‐\nsiadm command.\n\n14     ISCSIERRTRANSCAPS - transport module did not support operation.\n\n15     ISCSIERRSESSEXISTS - session is logged in.\n\n16     ISCSIERRINVALIDMGMTREQ - invalid IPC MGMT request.\n\n17     ISCSIERRISNSUNAVAILABLE - iSNS service is not supported.\n\n18     ISCSIERRISCSIDCOMMERR - a read/write to iscsid failed.\n\n19     ISCSIERRFATALLOGIN - fatal iSCSI login error.\n\n20     ISCSIERRISCSIDNOTCONN - could not connect to iscsid.\n\n21     ISCSIERRNOOBJSFOUND - no records/targets/sessions/portals found to execute  opera‐\ntion on.\n\n22     ISCSIERRSYSFSLOOKUP - could not lookup object in sysfs.\n\n23     ISCSIERRHOSTNOTFOUND - could not lookup host.\n\n24     ISCSIERRLOGINAUTHFAILED - login failed due to authorization failure.\n\n25     ISCSIERRISNSQUERY - iSNS query failure.\n\n26     ISCSIERRISNSREGFAILED - iSNS registration/deregistration failed.\n\n27     ISCSIERROPNOTSUPP - operation not support\n\n28     ISCSIERRBUSY - device or resource in use\n\n29     ISCSIERRAGAIN - operation failed, but retrying later may succeed\n\n30     ISCSIERRUNKNOWNDISCOVERYTYPE - unknown discovery type\n\n31     ISCSIERRCHILDTERMINATED - child process terminated\n\n32     ISCSIERRSESSIONNOTCONNECTED - session likely not connected\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "Discover targets at a given IP address:\n\nsh# iscsiadm --mode discoverydb --type sendtargets --portal 192.168.1.10 --discover\n\nLogin, must use a node record id found by the discovery:\n\nsh#    iscsiadm    --mode    node   --targetname   iqn.2001-05.com.doe:test   --portal\n192.168.1.1:3260 --login\n\nLogout:\n\nsh#   iscsiadm   --mode   node    --targetname    iqn.2001-05.com.doe:test    --portal\n192.168.1.1:3260 --logout\n\nList node records:\n\nsh# iscsiadm --mode node\n\nDisplay all data for a given node record:\n\nsh#    iscsiadm    --mode    node   --targetname   iqn.2001-05.com.doe:test   --portal\n192.168.1.1:3260\n",
            "subsections": []
        },
        "FILES": {
            "content": "/etc/iscsi/iscsid.conf\nThe configuration file read by iscsid and iscsiadm on startup.\n\n/etc/iscsi/initiatorname.iscsi\nThe file containing the iSCSI InitiatorName and InitiatorAlias read by iscsid and isc‐‐\nsiadm on startup.\n\n/etc/iscsi/nodes/\nThis directory contains the nodes with their targets.\n\n/etc/iscsi/sendtargets\nThis directory contains the portals.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "iscsid(8)\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Open-iSCSI project <http://www.open-iscsi.com/>\nAlex Aizman <itn780@yahoo.com>\nDmitry Yusupov <dmitryyus@yahoo.com>\n\n\n\nNov 2020                                   ISCSIADM(8)",
            "subsections": []
        }
    },
    "summary": "iscsiadm - open-iscsi administration utility",
    "flags": [
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "ipaddr can be IPv4 or IPv6. This option is only valid for ping submode."
        },
        {
            "flag": "-A",
            "long": "--portal",
            "arg": null,
            "description": "Specify the portal type for the new flash node entry to be created. This option is only valid for flashnode submode of host mode and only with new opera‐ tion."
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": "Specify the ping packetsize. This option is only valid for ping submode."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "count specify number of ping iterations. This option is only valid for ping submode."
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": "Specify the submode for mode. op must be name of submode. Currently iscsiadm support ping as submode for iface. For example: iscsiadm -m iface -I ifacename -C ping -a ipaddr -b packetsize -c count -i interval For host, it supports chap , flashnode and stats as submodes. For example: iscsiadm -m host -H hostno -C chap -x chaptblidx -o operation iscsiadm -m host -H hostno -C flashnode -x flashnodeidx -o operation iscsiadm -m host -H hostno -C stats"
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "print debugging information. Valid values for debuglevel are 0 to 8."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "display help text and exit"
        },
        {
            "flag": "-H",
            "long": null,
            "arg": null,
            "description": "The host argument specifies the SCSI host to use for the operation. It can be the scsi host number assigned to the host by the kernel's scsi layer, or the MAC address of a scsi host."
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": "interval specify delay between two ping iterations. This option is only valid for ping submode."
        },
        {
            "flag": "-I",
            "long": null,
            "arg": null,
            "description": "The interface argument specifies the iSCSI interface to use for the operation. iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware iSCSI (qla4xxx) the iface config must have the hardware address (iface.hwaddress = port's MAC address) and the driver/transportname (iface.transportname). The iface's name is then the file‐ name of the iface config. For software iSCSI, the iface config must have either the hardware address (iface.hwaddress), or the network layer's interface name (iface.netifacename), and it must have the driver/transportname The available drivers/iscsitransports are tcp (software iSCSI over TCP/IP), iser (software iSCSI over InfiniBand), qla4xxx (Qlogic 4XXXX and 82XXX HBAs), cxgb3i and cxgb4i (Chelsio T3 and T4 adapters), bnx2i (QLogic Netextreme II adapters), be2iscsi (Emulex 10G adapter), qedi (QLogic QEDI 25/40/100Gb adapter), and ocs (Emulex One Con‐ nect storage). Some of these are considered experimental, as they are not fully tested. The hwaddress is the MAC address or for software iSCSI it may be the special value de‐ fault which directs the initiator to not bind the session to a specific hardware re‐ source and instead allow the network or InfiniBand layer to decide what to do. There is no need to create an iface config with the default behavior. If you do not specify an iface, then the default behavior is used. As mentioned above there is a special iface name default. There are others which do not bind the session to a specific card, but instead bind the session to the trans‐ port: iser, cxgb3i, cxgb4i, and bnx2i. In discovery mode multiple interfaces can be specified by passing in multiple -I/--in‐ terface instances. For example: sh# iscsiadm -m discoverydb -t st -p ip:port -I iface0 -I iface2 --discover Will direct iscsiadm to setup the node db to create records which will create sessions through the two intefaces passed in. In node mode, only a single interface is supported in each call to iscsiadm. This option is valid for discovery, node and iface mode."
        },
        {
            "flag": "-k",
            "long": null,
            "arg": null,
            "description": "Currently priority must be zero. This will immediately stop all iscsid operations and shutdown iscsid. It does not logout any sessions. Running this command is the same as doing killall iscsid. Neither should normally be used, because if iscsid is doing er‐ ror recovery or if there is an error while iscsid is not running, the system may not be able to recover. This command and iscsid's SIGTERM handling are experimental."
        },
        {
            "flag": "-D",
            "long": "--discover",
            "arg": null,
            "description": "Discover targets using the discovery record with the recid matching the the discovery type and portal passed in. If there is no matching record, it will be created using the iscsid.conf discovery settings. This must be passed in discoverydb mode to in‐ struct iscsiadm to perform discovery. This option is only valid for SendTargets discovery mode."
        },
        {
            "flag": "-l",
            "long": "--login",
            "arg": null,
            "description": "For node and fw mode, login to a specified record. For discovery mode, login to all discovered targets. This option is only valid for discovery and node modes."
        },
        {
            "flag": "-L",
            "long": null,
            "arg": null,
            "description": "For node mode, login all sessions with the node or conn startup values passed in or all running session, except ones marked onboot, if all is passed in. This option is only valid for node mode (it is valid but not functional for session mode)."
        },
        {
            "flag": "-W",
            "long": null,
            "arg": null,
            "description": "In node, discovery, or firmware mode, do not wait for a response from the targets. This means that success will be returned if the command is able to send the login re‐ quests, whether or not they succeed. In this case, it will be up to the caller to poll for success (i.e. session creation)."
        },
        {
            "flag": "-m",
            "long": "--mode",
            "arg": null,
            "description": "specify the mode. op must be one of discovery, discoverydb, node, fw, host iface or session. If no other options are specified: for discovery, discoverydb and node, all of their respective records are displayed; for session, all active sessions and connections are displayed; for fw, all boot firmware values are displayed; for host, all iSCSI hosts are displayed; and for iface, all ifaces setup in /etc/iscsi/ifaces are displayed."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "In node mode, specify a field name in a record. In flashnode submode of host mode, specify name of the flash node parameter. For use with the update operator."
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "Specifies a database operator op. op must be one of new, delete, update, show or non‐ persistent. For iface mode, apply and applyall are also applicable. For flashnode submode of host mode, login and logout are also applicable. This option is valid for all modes except fw. Delete should not be used on a running session. If it is iscsiadm will stop the session and then delete the record. new creates a new database record for a given object. In node mode, the recid is the target name and portal (IP:port). In iface mode, the recid is the iface name. In dis‐ covery mode, the recid is the portal and discovery type. In session mode, the new operation logs in a new session using the same node database and iface information as the specified session. In discovery mode, if the recid and new operation is passed in, but the --discover ar‐ gument is not, then iscsiadm will only create a discovery record (it will not perform discovery). If the --discover argument is passed in with the portal and discovery type, then iscsiadm will create the discovery record if needed, and it will create records for portals returned by the target that do not yet have a node DB record. delete deletes a specified recid. In discovery mode, if iscsiadm is performing discov‐ ery it will delete records for portals that are no longer returned. update will update the recid with name to the specified value. In discovery mode, if iscsiadm is performing discovery the recid, name and value arguments are not needed. The update operation will operate on the portals returned by the target, and will up‐ date the node records with info from the config file and command line. show is the default behaviour for node, discovery and iface mode. It is also used when there are no commands passed into session mode and a running sid is passed in. name and value are currently ignored when used with show. nonpersistent instructs iscsiadm to not manipulate the node DB. apply will cause the network settings to take effect on the specified iface. applyall will cause the network settings to take effect on all the ifaces whose MAC address or host number matches that of the specific host. login will log into the specified flash node entry. logout does the logout from the given flash node entry."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "Use target portal with ip-address ip and port. If port is not passed in the default port value is 3260. IPv6 addresses can be specified as [ddd.ddd.ddd.ddd]:port or ddd.ddd.ddd.ddd. Hostnames can also be used for the ip argument. This option is only valid for discovery, or for node operations with the new operator. This should be used along with --target in node mode, to specify what the open-iscsi docs refer to as a node or node record. Note: open-iscsi's use of the word node, does not match the iSCSI RFC's iSCSI Node term."
        },
        {
            "flag": "-P",
            "long": null,
            "arg": null,
            "description": "If in node mode print nodes in tree format. If in session mode print sessions in tree format. If in discovery mode print the nodes in tree format."
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": "Use target targetname. This should be used along with --portal in node mode, to specify what the open-iscsi docs refer to as a node or node record. Note: open-iscsi's use of the word node, does not match the iSCSI RFC's iSCSI Node term."
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": "Use session ID sid. The sid of a session can be found from running iscsiadm in session mode with the --info argument. Instead of sid, a sysfs path containing the session can be used. For example using one of the following: /sys/devices/platform/hostH/sessionS/targetH:B:I/H:B:I:L, /sys/devices/platform/hostH/sessionS/targetH:B:I, or /sys/devices/platform/hostH/ses‐ sionS, for the sysfsdir argument would result in the session with sid S to be used. sid | sysfsdir is only required for session mode."
        },
        {
            "flag": "-R",
            "long": "--rescan",
            "arg": null,
            "description": "In session mode, if sid is also passed in rescan the session. If no sid has been passed in rescan all running sessions. In node mode, rescan a session running through the target, portal, iface tuple passed in."
        },
        {
            "flag": "-s",
            "long": "--stats",
            "arg": null,
            "description": "Display session statistics. This option when used with host mode, displays host sta‐ tistics."
        },
        {
            "flag": "-S",
            "long": "--show",
            "arg": null,
            "description": "When displaying records, do not hide masked values, such as the CHAP secret (pass‐ word). This option is only valid for node and session mode."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "type must be sendtargets (or abbreviated as st), slp, isns or fw. Currently only send‐ targets, fw, and iSNS is supported, see the DISCOVERY TYPES section. This option is only valid for discovery mode."
        },
        {
            "flag": "-u",
            "long": "--logout",
            "arg": null,
            "description": "logout for a specified record. This option is only valid for node and session mode."
        },
        {
            "flag": "-U",
            "long": null,
            "arg": null,
            "description": "logout all sessions with the node or conn startup values passed in or all running ses‐ sion, except ones marked onboot, if all is passed in. This option is only valid for node mode (it is valid but not functional for session mode)."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "Specify a value for use with the update operator. This option is only valid for node mode and flashnode submode of host mode."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "display version and exit"
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": "Specify the index of the entity to operate on. This option is only valid for chap and flashnode submodes of host mode."
        }
    ],
    "examples": [
        "Discover targets at a given IP address:",
        "sh# iscsiadm --mode discoverydb --type sendtargets --portal 192.168.1.10 --discover",
        "Login, must use a node record id found by the discovery:",
        "sh#    iscsiadm    --mode    node   --targetname   iqn.2001-05.com.doe:test   --portal",
        "192.168.1.1:3260 --login",
        "Logout:",
        "sh#   iscsiadm   --mode   node    --targetname    iqn.2001-05.com.doe:test    --portal",
        "192.168.1.1:3260 --logout",
        "List node records:",
        "sh# iscsiadm --mode node",
        "Display all data for a given node record:",
        "sh#    iscsiadm    --mode    node   --targetname   iqn.2001-05.com.doe:test   --portal",
        "192.168.1.1:3260"
    ],
    "see_also": [
        {
            "name": "iscsid",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/iscsid/8/json"
        }
    ]
}