# aptitude install iscsitarget iscsitarget-dkms
This will involve (automatically) building a kernel module for your specific machine, which means that binutils, cpp, gcc, kernel headers, make and all sorts of other stuff which you might not have expected, will get installed first.
Note that you do not need to reboot after the kernel module has been rebuilt - it gets installed automatically and works with your already-running kernel.
The next step is to create a configuration file for what you want to share from this machine.
The existing file /etc/iet/ietd.conf contains only comments, you can either overwrite it, rename it and create a new file, or edit it, as you prefer. Personally I rename it to ietd.conf.dist and then create my own ietd.conf. I do the same with initiators.allow.
I want to share the Logical Volume /dev/SCSItarget/share to any machine on my local network 192.168.42.0/24
/etc/iet/ietd.conf contains:
Target iqn.2017-04.de.dehy.retinal:SCSIshare Lun 0 Path=/dev/SCSItarget/share,Type=fileio,ScsiId=xyz,ScsiSN=xyz
/etc/iet/initiators.allow contains:
iqn.2017-04.de.dehy.retinal:SCSIshare 192.168.42.0/24
Notes:
Modify /etc/default/iscsitarget so that ISCSITARGET_ENABLE=true on the first line.
Once you've created those config files, restart the iSCSI service:
# /etc/init.d/iscsitarget restart
Note that the iSCSI service and the configured shares will be restarted automatically on reboot.
Go up
Return to main index.