LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   iscsi: which local device (/dev/sda, /dev/sdb) is used WITHOUT dmesg? (http://www.linuxquestions.org/questions/linux-software-2/iscsi-which-local-device-dev-sda-dev-sdb-is-used-without-dmesg-710718/)

knikkerr 03-11-2009 07:28 AM

iscsi: which local device (/dev/sda, /dev/sdb) is used WITHOUT dmesg?
 
Hi,

Running CentOS 5.2 (64bit)
kernel 2.6.27.9-smp
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....

Any thoughts?

regards,
Mark

aimon 03-18-2010 04:10 AM

You ever figure this out?
 
Hi, you ever figure this out? I am trying to find the device a specific target used and/or be able to specify the device it will use. Any help you can give would be appreciated.


Aimon

m.bhuvan 08-12-2010 06:31 AM

Quote:

Originally Posted by aimon (Post 3902869)
Hi, you ever figure this out? I am trying to find the device a specific target used and/or be able to specify the device it will use. Any help you can give would be appreciated.


Aimon

Hi , Hopefully /dev/disk/* will you provide the results for you.

ls -l /dev/disk/*

and
ls -l /dev/disk/by-path will be more helpfull to you.

aimon 08-13-2010 05:30 AM

Quote:

Originally Posted by m.bhuvan (Post 4063932)
Hi , Hopefully /dev/disk/* will you provide the results for you.

ls -l /dev/disk/*

and
ls -l /dev/disk/by-path will be more helpfull to you.


Good point! Not ideal.. but much better then dmesg. It does amaze me that you cant pre-specify the device name somehow.

Regards,

Aimon


All times are GMT -5. The time now is 10:52 PM.