LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   How to find mapping between ATA and e.g. sg device? (https://www.linuxquestions.org/questions/linux-kernel-70/how-to-find-mapping-between-ata-and-e-g-sg-device-899765/)

pbdiwpwm 08-27-2011 03:26 AM

How to find mapping between ATA and e.g. sg device?
 
How can I find the correct /dev file node for my ata3 hard drive (1 of four connected drives)?

I hav'nt found any tool or information how the mapping has to been produced. dmesg is not helping here, because the info/mapping messages are mixed.

Is there a tool to show the map?

Thanks for suggestions.
Pierre

PS: I found allready the drive with the corrupt cable because on initialisation the manufactuer/model is shown. And I have only one drive with this model so I have to look in my hw to found the problem.

smallpond 08-27-2011 06:52 PM

I use lsscsi and sg_inq. Neither is installed by default in most distros.

If you have several identical drives and want to identify one, do:

Code:

while true ; do
  dd if=/dev/$1 of=/dev/null count=1000 2>&1 ;
  sleep 1 ;
done

to blink its drive select light

pbdiwpwm 08-28-2011 04:54 PM

Hi,

and how can I check which ata# that is? If I have a message in dmesg that ata3 responds reset link messages some time than there is no identification which sd# it is.
So I need

ata3 -> /dev/sda for example

Cheers...
Pierre

smallpond 08-30-2011 09:09 AM

Quote:

Originally Posted by pbdiwpwm (Post 4455636)
Hi,

and how can I check which ata# that is? If I have a message in dmesg that ata3 responds reset link messages some time than there is no identification which sd# it is.
So I need

ata3 -> /dev/sda for example


What's the output of lsscsi?


All times are GMT -5. The time now is 04:52 AM.