How To


apt install open-iscsi


  • Edit initiatorname.conf, And Change Setting

vim /etc/iscsi/initiatorname.conf

InitiatorName=<your iscsi lun IQN>
  • Edit iscsid.conf

vim /etc/iscsi/iscsid.conf

node.session.auth.authmethod = CHAP
node.session.auth.username = username
node.session.auth.password = password
  • Restart Service

systemctl restart iscsid open-iscsi

  • Discover Target Serevr Using IP OR FQDN

iscsiadm -m discovery -t sendtargets -p <IP>

  • Connect iSCSI Target Volume

iscsiadm --mode node --targetname <IP>:iscsi01 --portal <IP> --login

  • Login/Logout All iSCSI Volume

# Login
iscsiadm -m node -l 
# Logout
iscsiadm -m node -u
  • After Login, You Can Use fdisk -l To Check iSCSI Volume’s Mount Point And Init Volume

fdisk -l
Disk /dev/sdc: 200 GiB, 214748364800 bytes, 419430400 sectors
Disk model: iSCSI Storage
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 8192 bytes / 8192 bytes

fdisk /dev/sdc
  • Format Disk And Mount Volume

mkfs.ext4 /dev/sdc1

mount /dev/sdc1 /mnt/
  • Verify Disk And Try

cd /mnt/
touch 123