On Tue, 19 Jul 2005, Leonid Podolny wrote:

> 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.

there's a package called 'sg3-utils'. it contains a tool named 'sg_map'.
install it. run 'sg_map -x' for the mapping. 'sg_map -x -i' will also
inquire each device for vendor+model info.

you can read sg_map's source to see how they do this. sg3-utils also has a
library that it uses - you might be able to write a C program that links
to this library and does the rest.

> 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.

some things you should note:

1. if linux does not see the raid during boot, it will not see the LUNs
   until it is rebooted, or the HBA driver is removed and re-inserted, or
   one of several hacks is employed in order to force a SCSI rescan.

2. if a machine has local SCSI disk(s), make sure it loads the driver for
   the local SCSI HBA before it loads the driver for the fiber-channel HBA.
   if you don't observe that, funny things will happen with regards to
   renumbering of SCSI devices..

-- 
guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy

=================================================================
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