These instructions are written with assistance from https://wiki.debian.org/SAN/iSCSI
iSCSI is a network transport mechanism for exporting block devices between machines.
The block devices themselves are completely standard (there's no "iSCSI header" or similar added to the device itself), which means you can share:
The device (or file) you're sharing doesn't have to be formatted first (you can readily format it on the client system after sharing it), and it can contain any sort of file system you like (ext, fat, iso9660…)
As far as the client machine is concerned, it simply gets a new /dev/sdX device, which can be used in the usual ways.
iSCSI uses the term initiator for the client end (the machine which requests access to the device/s being shared by the server), and target for the server end (which has the real device/s being made available to client machine/s).
Note that iSCSI is a device-level share, not a file-system share, therefore it knows (and cares) nothing about what files are on the device, but it also neither knows nor cares about any local usage of the files on the device, so unless you really know what you're doing, you should never share over iSCSI a device which is already in use (ie: mounted) on the local (server) system.
The iSCSI target service will not stop you doing this.
There are two ways of doing this, depending on which version of Debian / Devuan you are starting from.
For Debian 8 Jessie / Devuan 1 Jessie and below, you configure the target using iscsitarget.
For Debian 9 Stretch / Devuan 2 Ascii and above, you configure the target using targetcli-fb.
In my opinion iscsitarget is by far easier to work with, and the configuration files are much smaller and easier to read, but unfortunately it's not possible to upgrade a Jessie machine to Stretch / Ascii and keep iscsitarget working. Such is the cost of "progress"…
This is the same for any version of Debian or Devuan, using open-iscsi.
Fairly obviously, iSCSI can be used to mount a device or partition on a remote machine so that you can use it as though it were local storage (perhaps on a machine which is already full to capacity with physical disks), however there are other purposes for which it can be used:
Go up
Return to main index.