← 返回命令列表

Linux command

iscsiadm 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Example

sudo iscsiadm -m session

Example

sudo iscsiadm -m node

Discover

sudo iscsiadm -m discovery -t sendtargets -p [ip_address]

Log in

sudo iscsiadm -m node -T [iqn] -p [ip_address]:3260 -l

Log out

sudo iscsiadm -m node -T [iqn] -p [ip_address]:3260 -u

Create

sudo iscsiadm -m node -o new -T [iqn] -p [ip_address]:3260

Example

sudo iscsiadm -m node -T [iqn] -p [ip_address]:3260 -o update -n node.session.auth.authmethod -v CHAP

说明

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.

参数

-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

FAQ

What is the iscsiadm command used for?

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.

How do I run a basic iscsiadm example?

Run `sudo iscsiadm -m session` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -m, --mode _MODE_ do in iscsiadm?

Operation mode: discovery, node, session, iface