0
I made a simple script file on my linux machine to mount a iscsi drive.
iscsiadm –m node --targetname THE_TARGET_IQN --login
mount /dev/sdb1 /home/mounted
The problem is, When I exceuted this script, It always fail at first time. Likes this.
/etc/init.d# ./iscsi
Loggin to [iface: default, target: targetname, portal: THE_TARGET_IQN (multiple)
Loggin to [iface: default, target: targetname, portal: THE_TARGET_IQN successful.
mount: special device /dev/sdb1 does not exist
/etc/init.d# ./iscsi
isciadm: default:1 session requested, but 1 already present.
isciadm: Could not log into all portals
/etc/init.d#
I think that If I can insert some delay between two lines, It will be fine. Is this reasonable?. Please advise me for this.
What's the relationship between the first & second lines? – Xen2050 – 2017-12-13T22:22:31.840
The first one is engaging a ISCSI And second one is to mount a ISCSI volume – Andrei Kim – 2017-12-14T05:19:25.367
I don't have
iscsiadm
on my system, but a web man page doesn't appear to have any options to make it wait before returning to the terminal... little weird that it returns immediately before it's finished, but it looks like sleep is your best option, +1 to Deeh – Xen2050 – 2017-12-14T18:05:42.887