I've also discovered that the scsi address is not consistent. Sometimes it will be zero indexed, other times 1 indexed. This changes each reboot (about 15% zero index, 85% 1 indexed).<div><br></div><div>I can handle scraping dmesg, but does anyone know how I can find out what the mapping after boot (in a generic way)? ata is always 1 indexed, so sometimes ata1 refers to scsi 1:0:0:0 and sometimes it refers to scsi 0:0:0:0.</div>
<div><br></div><div>Any help would be appreciated.</div><div><br></div><div>- Peter<br><br><div class="gmail_quote">On Thu, Jul 14, 2011 at 10:23 AM, Peter Hamilton <span dir="ltr"><<a href="mailto:peterghamilton@gmail.com">peterghamilton@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I'm trying to find out what the negotiated speed is on a SATA port. dmesg reports the negotiated speed, but I'm hoping to find it somewhere in /sys or /proc (or some other tool). Scraping dmesg is a messy process as I'm starting with a block device. I would have to trace the block device to the scsi address and translate that to an ata address.<div>
<br></div><div>Here's the scsi and block device info from dmesg:<br><div><div><br></div><div><div>scsi 7:0:0:0: Direct-Access ATA WDC WD1600AAJS-2 01.0 PQ: 0 ANSI: 5</div><div>sd 7:0:0:0: [sdd] 312581808 512-byte logical blocks: (160 GB/149 GiB)</div>
<div>sd 7:0:0:0: [sdd] Write Protect is off</div><div>sd 7:0:0:0: [sdd] Mode Sense: 00 3a 00 00</div><div>sd 7:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA</div><div>sd 7:0:0:0: [sdd] Attached SCSI disk</div>
<div>sd 7:0:0:0: Attached scsi generic sg3 type 0</div></div></div><div><br></div><div>Here's the corresponding ata info from dmesg:</div></div><div><br></div><div><div>ata7: SATA link up 3.0 Gbps (SStatus 123 SControl 370)</div>
<div>ata7.00: ATA-8: WDC WD1600AAJS-22L7A0, 01.03E01, max UDMA/133</div><div>ata7.00: 312581808 sectors, multi 0: LBA48 NCQ (depth 31/32), AA</div><div>ata7.00: configured for UDMA/133</div></div><div><br></div><div><br>
</div>
<div><br></div><div><br></div><div>Finding the SATA link speed in dmesg would be much cleaner than scraping dmesg. Does anyone know where I might find that?</div><div><br></div><div>Also, for a SAS HBA, the link speed is not reported to dmesg. Does anyone know how to find the link speed for a SAS drive?</div>
<div><br></div><div>Thanks,</div><div><br></div><font color="#888888"><div>Peter</div>
</font></blockquote></div><br></div>