TargetCLI on Debian

Install Debian

Partition

leave space for a zfs zpool

Add some useful packages

apt-get install vim curl sudo ntfs-3g

Install TargetCLI

apt-get install targetcli-fb

Install ZFS

apt-get install zfs-dkms

ZFS Backstores

zpool create -f storagepool1 /dev/vda3
zfs create -V 20Gb storagepool1/vol1
shows up as /dev/zvol/storagepool1/vol1
zpool iostat storagepool1

Setup iSCSI Targets

Block Targets

Backstores

Setup ACLS and AUTH

pSCSI and FC Targets

Installing from iso and booting debian over iscsi

Install from ISO

Start install sequence and get up to disk partitions section

Edit /etc/iscsi/initiatorname.iscsi

switch to VT2

edit to add the correct IQN to match the target acls

Edit /etc/iscsi/iscsid.conf

set node.session.auth.authmethod = CHAP
set node.session.auth.username = username
set node.session.auth.password = password

Find, kill then restart iscsid

kill -9 PID
/sbin/iscsid

Contiune to follow normal process

Switch back to VT1

References

https://www.server-world.info/en/note?os=Debian_12&p=iscsi&f=3

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/managing_storage_devices/configuring-an-iscsi-target_managing-storage-devices#creating-a-fileio-storage-object_configuring-an-iscsi-target