I apologize if this has been asked in the list before, I did some
research but did not find a clear answer/recommendation.

Currently, I use udev to monitor new devices added by the open-iscsi
initiator. This works great. However, when the target is disconnected I
get timeout messages in the kernel log but the device nodes in /dev/
still exists. Thus, no udev events.

As noted in a few of the messages in the archives, doing a rescan does
not automatically delete the LUNs. So the following script was
suggested:

        scsi_sz=`sg_readcap /dev/sdko | grep address | sed s'/.*blocks=//'`
        kernel_sz=`cat /sys/block/sdko/device/block\:sdko/size`

        if (($scsi_sz==$kernel_sz)); then
                echo "Good."
        else
                echo "Do the deletion of the block device."
                echo 1 > /sys/block/sdko/device/delete
        fi

This looks like it will do the trick. But I am wondering if this is still
the recommended approach as the above suggestion was made in 2008.

Thanks,
Amit

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to