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?

d33tah
  • 1,361
  • 14
  • 28

1 Answers1

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
Celada
  • 43,173
  • 5
  • 96
  • 105
  • ***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