I'm getting kernel messages about 'ata3'. How do I figure out what device (/dev/sd_) that corresponds to?
|
|
From http://www.phuket-data-wizards.com/blog/2011/07/16/matching-linux-ata-numbers-to-the-device-names/: |
|||||
|
|
Can't comment on previous answer, but for that one liner, you want to change the grep to be a little more restrictive as 1 and 10 are both valid ata#'s:
So...
For my needs, I wanted to map a drive letter to an ata, so I wrote this, and on my system the ata string wasn't always the 5th component of the path:
Use it like this:
|
|||||||||||||||||||||
|
|
Just so we are clear the ATA number maps to the UNIQUE_ID, directly (they are the same number). So ATA #3 is UNIQUE_ID #3. Then you look up what HOST # is associated to the UNIQUE_ID /sys/class/scsi_host/host4/unique_id:3 So here ATA #3 is UNIQUE_ID #3 is HOST #4 Then to get the drive letter just run “ls -lisah /sys/block” and find the HOST #4. Here is a good stackexchange/superuser talking about this: Mapping ata device number to logical device name |
||||
|
|
|
I rather like this:
I'm not sure if this is good for other storage array manufacturers, but it works for Hitachi, |
|||||
|
|
A perhaps easier, but not foolproof, method: Inspect the output of /bin/dmesg. The devices are listed there.
It's not foolproof for a few reasons. /bin/dmesg lists the contents of the kernel's "ring buffer"; the boot messages can be overwritten by later kernel messages. It requires you to follow along and translate from ata1.00 to (here) Hitachi HDT72101, and then see that immediately that scsi 0:0:0:0: is that same disk. Then sd 0:0:0:0: is shown to be sda. If you have multiple drives with identical model numbers and firmware levels, you won't be able to tell for sure which is which using this method. You hopefully can infer it from the order of probes in the dmesg output. On my centos6 system, /var/log/dmesg contains the dmesg from the last boot. |
||||
|
|