LinuxCommandLibrary

iscsiadm

TLDR

Show active sessions

$ sudo iscsiadm -m session
copy
List all known nodes
$ sudo iscsiadm -m node
copy
Discover iSCSI targets on a portal
$ sudo iscsiadm -m discovery -t sendtargets -p [ip_address]
copy
Log in to an iSCSI target
$ sudo iscsiadm -m node -T [iqn] -p [ip_address]:3260 -l
copy
Log out from an iSCSI target
$ sudo iscsiadm -m node -T [iqn] -p [ip_address]:3260 -u
copy
Create a node manually (for CHAP authentication)
$ sudo iscsiadm -m node -o new -T [iqn] -p [ip_address]:3260
copy
Configure CHAP authentication
$ sudo iscsiadm -m node -T [iqn] -p [ip_address]:3260 -o update -n node.session.auth.authmethod -v CHAP
copy

SYNOPSIS

iscsiadm -m mode [options]

DESCRIPTION

iscsiadm is the command-line tool for managing iSCSI initiator connections. It handles discovery of iSCSI targets, authentication configuration, and session management.
iSCSI allows block storage to be accessed over IP networks, presenting remote storage as local SCSI devices. The initiator (client) connects to targets (storage) using IQNs (iSCSI Qualified Names) for identification.

PARAMETERS

-m, --mode MODE

Operation mode: discovery, node, session, iface
-t, --type TYPE
Discovery type: sendtargets, isns
-p, --portal IP:PORT
Target portal address
-T, --targetname IQN
Target iSCSI Qualified Name
-l, --login
Log in to target
-u, --logout
Log out from target
-o, --op OP
Operation: new, delete, update, show
-n, --name NAME
Parameter name
-v, --value VALUE
Parameter value

CAVEATS

Requires root privileges. The iscsid daemon must be running. CHAP credentials must be configured before login for authenticated targets. Changes to node configuration require logout/login to take effect.

HISTORY

iscsiadm is part of the Open-iSCSI project, which provides the standard iSCSI implementation for Linux. iSCSI was standardized in RFC 3720 in 2004.

SEE ALSO

iscsid(8), targetcli(8), lsblk(8)

Copied to clipboard