Leonid Podolny wrote:

Hi, list,
Provided that I have a host, channel, id and lun of the physical scsi disk, 
what is a correct and portable way to know the /dev/sdX device name? I need the 
solution to be portable between different 2.6 kernel releases.
The full story is this. We have a testing lab. All the computers are connected 
to a FC switch, which in turn is connected to a rack of SCSI disks. All the 
disks are visible to all the computers. After investigating a couple of woodoos 
we found out that, say, /dev/sda on
one box does not necessarily point to the same physical disk as /dev/sda on 
another one.
readlink /sys/bus/scsi/devices/0:0:0:0/block | cut -d / -f 8

Alternatively, cat /sys/bus/scsi/devices/0:0:0:0/block/dev will give you the major/minor numbers of the relevant device. You can probably deduct the rest yourself.

         Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting ltd.
http://www.lingnu.com/


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to