You can find the corresponding /dev/sdY device via traversing the /sys tree:
$ find /sys/devices | grep '/ata[0-9]\+/.*/block/s[^/]\+$' \
| sed 's@^.\+/\(ata[0-9]\+\)/.\+/block/\(.\+\)$@\1 => /dev/\2@'
With a more efficient /sys traversal (cf. lsata.sh):
$ echo /sys/class/ata_port/ata*/../../host*/target*/*/block/s* | tr ' ' '\n' \
| awk -F/ '{printf("%s => /dev/%s\n", $5, $NF)}'
Example output from a 2 disk system:
ata1 => /dev/sda
ata2 => /dev/sdb
Then, for reliably identifying the actual hardware you need to map /dev/sdY to the serial number, e.g.:
$ ls /dev/disk/by-id -l | grep 'ata.*sd[a-zA-Z]$'
lssci
The lssci utility can also be used to derive the mapping:
$ lsscsi | sed 's@^\[\([^:]\+\).\+\(/dev/.\+\)$@\1,\2@' \
| awk -F, '{ printf("ata%d => %s\n", $1+1, $2) }'
Note that the relevant lsscsi enumeration starts from 0 while the ata enumeration starts from 0.
Syslog
If nothing else works one can look at the syslog/journal to derive the mapping.
The /dev/sdY devices are created in the same order as the ataX identifiers are enumerated in the kern.log while ignoring non-disk devices (ATAPI) and not-connected links.
Thus, following command displays the mapping:
$ grep '^May 28 2' /var/log/kern.log.0 | \
grep 'ata[0-9]\+.[0-9][0-9]: ATA-' | \
sed 's/^.*\] ata//' | \
sort -n | sed 's/:.*//' | \
awk ' { a="ata" $1; printf("%10s is /dev/sd%c\n", a, 96+NR); }'
ata1.00 is /dev/sda
ata3.00 is /dev/sdb
ata5.00 is /dev/sdc
ata7.00 is /dev/sdd
ata8.00 is /dev/sde
ata10.00 is /dev/sdf
(Note that ata4 is not displayed because the above log messages are from another system.)
I am using /var/log/kern.log.0 and not /var/log/kern.log because the boot messages are already rotated. I grep for May 28 2 because this was the last boot time and I want to ignore previous messages.
To verify the mapping you can do some checks via looking at the output of:
$ grep '^May 28 2' /var/log/kern.log.0 | \
grep 'ata[0-9]\+.[0-9][0-9]: ATA-'
May 28 20:43:26 hn kernel: [ 1.260488] ata1.00: ATA-7: SAMSUNG SV0802N, max UDMA/100
May 28 20:43:26 hn kernel: [ 1.676400] ata5.00: ATA-5: ST380021A, 3.19, max UDMA/10
[..]
And you can compare this output with hdparm output, e.g.:
$ hdparm -i /dev/sda
/dev/sda:
Model=SAMSUNG SV0802N [..]
(using Kernel 2.6.32-31)