iscsi: which local device (/dev/sda, /dev/sdb) is used WITHOUT dmesg?
Running CentOS 5.2 (64bit)
iscsiadm version 2.0-870
We have a backup script that uses iSCSI to attach volumes from an Equallogic. It's a script that's often busy for hours.
On the same server we have a restore-script to manually restore specific volumes.
How do you find out for _sure_ which local device (/dev/sda, /dev/sdb, ...) has just been attached to a target after an
# iscsiadm -l
I know you can check dmesg, but in the unfortunate event that both scripts have just logged in to (separate) volumes, the timing to automatically check dmesg might just return the wrong device.
Preferably, we'd assign a device during iscsiadm logon, but it would also be workable to check which device is used after successfully logging in. Unfortunately,
# iscsiadm -m node -r sessionid
doesn't show anything about which device is used.
Of course, we could hack an ugly mutex-alike structure using some kind of shared dir/file, but well....