iSCSI: how to remove and add host target

There are times at certain environment that the supposed to be fixed IP Address
of the shared storage have to change.
Althought ,am having difficulties to contemplate the reality that it actually changed twice!

so, from the earlier on, the factory setting is something like
then goes to another set of “fixed” IP Address.
And now the third round of this..

the result, whenever this one changed.. all the client trying to attach to this
particular iSCSI storage, it need to probe for new IP.
And as past IP setting .. it was saying “portal unreachable”..
in this case only one out of two setting is up.
resulting a failure in status.. the storage not mounted..

[root@node1~]# /etc/init.d/iscsi restart
Stopping iSCSI daemon: 
iscsid dead but pid file exists                            [  OK  ]
Starting iSCSI daemon:                                     [  OK  ]
                                                           [  OK  ]
Setting up iSCSI targets: Logging in to [iface: default, target:, portal:,3260]
Login to [iface: default, target:, portal:,3260]: successful
 Logging in to [iface: default, target:, portal:,3260]
Login to [iface: default, target:, portal:,3260]: failure
                                                           [  FAILED  ]

so, the question.. how to remove those invalid target ?
Here is how to delete old target.
replace the ip with the old IP setting.

iscsiadm -m node -p --op=delete

to add the new one ..

iscsiadm -m discovery -t sendtargets -p

after that tweak the udev rules ..

vi /etc/udev/rules.d/buffalo.rules

type the following content to it..

  KERNEL=="sd*", SUBSYSTEMS=="scsi", ATTRS{model}=="VIRTUAL-DISK", SYMLINK+="usbhd%n

so.. it would sym-link the iSCSI drive to

udevcontrol reload_rules
# restart iscsi..
/etc/init.d/iscsi restart 

see the new dev ..

shall had something like this..

ll /dev
lrwxrwxrwx 1 root root          3 Dec 22 23:02 usbhd -> sdb
lrwxrwxrwx 1 root root          4 Dec 22 23:02 usbhd1 -> sdb1

which later can be used by cluster suite to mount /dev/usbhd1 to something like /data
which is transparent/similar on both nodes regardless it had the USB drive/dongle or anything connected to its
system at the same time.

Get Free Email Updates!

Signup now and receive an email once I publish new content.

I will never give away, trade or sell your email address. You can unsubscribe at any time.


Related Post

2 Responses

  1. Patrick says:

    I was just curious as to what you use for your desktop OS? Is it primarily CentOS or Ubuntu? I’m considering CentOS but I haven’t seen many articles about really using it for a workstation.

  2. owen says:

    Did you get further into GWT?

    Btw GWT is just javascript compiled via Java’s JRE, and the produced code is simply javascript. So if you want to code JS the most professional way – like IDE dev support, step debugging, and unit tests – use GWT.

    For me, I just love java. C# had a great future but Microsoft managed to screw it up somehow.


Anything to add?