From 1b4b03c776eec64daf08b7ef9b34e06307dba278 Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Tue, 22 May 2012 18:11:43 +0300 Subject: [PATCH] up: Linux initiator does not like "/" in target name change all "/" to "." in target name. Signed-off-by: Boaz Harrosh --- up | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/up b/up index ffe78ee..cda26f8 100755 --- a/up +++ b/up @@ -32,9 +32,6 @@ TGTADM=./tgt/usr/tgtadm otgtd_name=otgtd OTGTD=./tgt/usr/$otgtd_name -# Make target name the hostname -TARGETNAME="${1//\//\.}$(hostname)" - case $1 in down) killall -s SIGINT $otgtd_name @@ -78,7 +75,10 @@ load_target() { mkdir -p $1/ -$TGTADM --lld iscsi --mode target --op new --tid $2 --targetname="$TARGETNAME"-"$1" +# Make target name the hostname +TARGETNAME="$(hostname)""${1//\//.}" + +$TGTADM --lld iscsi --mode target --op new --tid $2 --targetname="$TARGETNAME" $TGTADM --lld iscsi --mode target \ --op bind --tid $2 --initiator-address ALL