So .. my problem is that I see some error into dmesg log about ata2 , however I don’t know what hard drive is mapped to that ata. So , how can we find this ?
[16380082.599294] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[16380082.599340] ata2.00: failed command: FLUSH CACHE EXT
[16380082.599369] ata2.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 0
[16380082.599370] res 40/00:00:80:2b:0a/00:00:70:00:00/40 Emask 0x4 (timeout)
[16380082.599435] ata2.00: status: { DRDY }
[16380082.599461] ata2: hard resetting link
[16380082.919117] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[16380082.921248] ata2.00: configured for UDMA/133
[16380082.921279] ata2: EH complete
Well to find out we have to look into /sys file-system :
ls -l /sys/block/sd{a,b}
lrwxrwxrwx 1 root root 0 Jan 17 08:01 /sys/block/sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 Jan 17 08:01 /sys/block/sdb -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sdb
To get that ID, Instead of looking into the target structure, we’re looking into the scsi_host structure. It has a directory for the host and in it a file unique_id. That’s the ID appended to ata.
for host in 0 1 ; do echo -n host${host}:; cat /sys/devices/pci0000:00/0000:00:1f.2/host${host}/scsi_host/host${host}/unique_id; done
host0:1
host1:2
So the answer is on ata2 I have sdb mounted.
Also I found this php code on internet