2

In my kernel log, I can see entries like:

[ 0.765510] sd 3:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)

and when something fails, it's usually something like:

[ 6007.433977] ata8.00: revalidation failed (errno=-5)

How can I translate the sd:X:X:X:X to ataX:00 so I could figure out which drive is failing?

marked as duplicate by don_crissti, Anthon, Scott, Jakuje, vonbrand Mar 20 '16 at 23:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Have you tried browsing /sys/class/block? – user86969 Mar 20 '16 at 18:57
  • @Nasha: I tried, but I hadn't seen this mapping there. – d33tah Mar 20 '16 at 19:08
0

To map from kernel device name to ata device name (many to one):

readlink /sys/class/block/sda | tr / \\012 | grep '^ata'

To map from ata device name to kernel device name (one to many):

ls -l /sys/class/ata_port/ata1/device/host*/target*/*/block
  • readlink /sys/class/block/sda | tr / \\012 | grep '^ata' I get no results for disks that are on LSI SAS controllers and not on the chipset ports. – drescherjm Mar 21 '16 at 18:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.