LinuxXVIII · Enterprise StorageiSCSI
iSCSI - block storage over IP
What you'll learn
- Explain how iSCSI transports SCSI over TCP/IP
- Connect to an iSCSI target with open-iscsi
- Mount and use the iSCSI block device
- Configure multipath for redundancy
Prerequisites
Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09
iSCSI transports SCSI commands over TCP/IP, providing block storage over the network. It is the most common SAN protocol for Linux deployments, especially with cost-effective Ethernet instead of Fibre Channel.
How iSCSI works
iSCSI has two components: the target (the storage) and the initiator (the host). The initiator sends SCSI commands over TCP to the target, which executes them on its disks and returns the results. The host sees the result as a local block device (/dev/sdX or /dev/mapper/mpathX).
$ iscsiadm -m sessiontcp: [1] 10.0.0.10:3260,1 iqn.2000-01.com.synology:target-1 (non-flash)Connecting to an iSCSI target
$ iscsiadm -m discovery -t sendtargets -p 10.0.0.10; iscsiadm -m node -L all10.0.0.10:3260,1 iqn.2000-01.com.synology:target-1
Logging in to [iface: default, target: iqn.2000-01.com.synology:target-1, portal: 10.0.0.10,3260] (multiple)
Login to [iface: default, target: iqn.2000-01.com.synology:target-1, portal: 10.0.0.10,3260] successful.Mounting and using the LUN
$ lsblk; fdisk /dev/sdb; mkfs.ext4 /dev/sdb1; mount /dev/sdb1 /mnt/iscsiMultipath for redundancy
$ multipath -llmpath0 (3600508...) dm-3 SYNOLOGY,iSCSI Disk
size=1.0T features='1 queue_if_no_path' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| |- 1:0:0:0 sda 8:0 active ready running
| `- 2:0:0:0 sdb 8:16 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
|- 1:0:1:0 sdc 8:32 active ready running
`- 2:0:1:0 sdd 8:48 active ready runningKnowledge check
Knowledge check · 3 questions
Q1. What command discovers available iSCSI targets on a portal?
Q2. CHAP authenticates an iSCSI session but leaves the data it carries in clear text on the wire.
Q3. Which of the following are correct iSCSI practices? Select all that apply.
Passing score: 75%. Answers are checked in this browser.