/usr/bin/tgt-setup-lun: illegal option -- -
/usr/bin/tgt-setup-lun: line 25: basename: command not found
usage:
-n tgt_name -d dev -b bs_name -B block_size -t transport -C control_port [initiator_IP1 initiator_IP2 ...]
defaults:
backing store: rdwr
transport: iscsi
initiator: ALL
control port: -
examples:
-n tgt-1 -d /dev/sdb1 192.168.1.2
-n tgt-2 -d /tmp/null -b null -t iser
-n tgt-3 -d ~/disk3.bin -b rdwr 192.168.1.2 192.168.1.3
WARNING:
Please remember to set blocksize to 4096 for newer Advanced Format (4K) disks larger than 2TB. Otherwise, your existing filesystems will not be readable.
Examples (4) from the manual page, untested
tgt-setup-lun -d /dev/sdb1 -n my_target 192.168.10.81
.PP Create a target that uses /dev/sdb1 and allows connections only from 192.168.10.81:tgt-setup-lun -d /dev/sdb1 -n my_target 192.168.10.81 192.168.10.82
.PP Create a target that uses /dev/sdb1 and allows connections only from 192.168.10.81 and 192.168.10.82:tgt-setup-lun -d /dev/sdb1 -n my_target
.PP Create a target that uses /dev/sdb1 and allows connections from any initiator:tgt-setup-lun -h
.PP Display help:
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.