RPi

iSCSI

Installation

sh# apt install open-iscsi

iscsiadm - operation modes

sh# iscsiadm --mode discovery --type sendtargets --portal 192.168.75.23
sh# iscsiadm --mode node --login
sh# iscsiadm --mode session 
sh# iscsiadm --mode node --logout
  • discovery
  • discoverydb
  • node
  • fw
  • host
  • iface
  • session

Login into iSCSI Target

By login into the target, the available LUN's (virtual disks) are associated with block devices on the initiator (client).

These block devices can than be mounted, just like any other block device.

  • LUN (Logical Unit Number)
    • lun's are similar to logical volumes(lvm)
    • lun's can be thought of as virtual disks

Example

By doing a discovery all targets get registered on the calling machine under the directory /etc/iscsi/nodes.

sh# iscsiadm --mode discovery --type sendtargets --portal 192.168.75.23
sh# ls -l /etc/iscsi/nodes
drw------- 3 root root 4096 Mar  1 15:38 iqn.2001-05.com.doe:test
sh# iscsiadm --mode node --login --targetname iqn.2001-05.com.doe:test --portal 192.168.75.23:3260
Login to ,iface: default, target: iqn.2001-05.com.doe:test, portal: 192.168.75.23:3260] successful.

Change the entry 'node.startup = manual' to 'node.startup = automatic', so the target gets registered automatically when the machine reboots.

sh# vi /etc/scsi/node/iqn.2001-

/etc/fstab

UUID=12345-... /media/git  ext4  _netdev  0   0