Updated: 28 September 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9

CentOS/RHEL 7 are end of life; these steps are for AlmaLinux 9 / Rocky Linux 9 and Ubuntu 24.04 / Debian 12. An iSCSI initiator (client) connects to storage shared over the network by an iSCSI target and uses it like a local disk.

1. Install

dnf install iscsi-initiator-utils     # AlmaLinux / Rocky
apt install open-iscsi                 # Ubuntu / Debian

2. Set the initiator name

The target allows clients by this name. Edit /etc/iscsi/initiatorname.iscsi, for example InitiatorName=iqn.2026-09.com.example:client1, then systemctl restart iscsid.

3. Discover and log in

iscsiadm -m discovery -t sendtargets -p 192.0.2.50
iscsiadm -m node -T iqn.2026-09.com.example:target1 -p 192.0.2.50 --login
lsblk                          # the LUN appears as a new disk, e.g. /dev/sdb

4. Use the disk

mkfs.xfs /dev/sdb
mkdir -p /mnt/iscsi
echo "UUID=$(blkid -s UUID -o value /dev/sdb) /mnt/iscsi xfs _netdev 0 0" >> /etc/fstab
mount -a

The _netdev option makes the system wait for the network before mounting. Sessions log in again automatically at boot.

CHAP authentication

If the target requires CHAP, set node.session.auth.authmethod = CHAP, node.session.auth.username and node.session.auth.password in /etc/iscsi/iscsid.conf before discovery.

Log out

umount /mnt/iscsi
iscsiadm -m node -T iqn.2026-09.com.example:target1 -p 192.0.2.50 --logout

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket