查看SATA速度和具体设备
SATA 速度确认
方法一
dmesg |grep SATA
输出
[ 2.977661] ahci 0000:00:17.0: AHCI 0001.0301 32 slots 4 ports 6 Gbps 0xf impl SATA mode
[ 3.030344] ata1: SATA max UDMA/133 abar m2048@0xf714b000 port 0xf714b100 irq 124
[ 3.030345] ata2: SATA max UDMA/133 abar m2048@0xf714b000 port 0xf714b180 irq 124
[ 3.030346] ata3: SATA max UDMA/133 abar m2048@0xf714b000 port 0xf714b200 irq 124
[ 3.030347] ata4: SATA max UDMA/133 abar m2048@0xf714b000 port 0xf714b280 irq 124
[ 3.348036] ata2: SATA link down (SStatus 4 SControl 300)
[ 3.348052] ata4: SATA link down (SStatus 4 SControl 300)
[ 3.351961] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 3.351972] ata3: SATA link down (SStatus 4 SControl 300)
[ 3.354885] ata1.00: ATA-10: INTEL SSDSC2BF256A5 SATA 256GB, LB1i, max UDMA/133
方法二
sudo smartctl -a /dev/sda | grep SATA
输出
SATA Version is: SATA 2.6, 3.0 Gb/s
方法三
sudo hdparm -I /dev/sda | egrep "Model|speed|Transport"
输出
Model Number: Ubuntu14.04-0
Transport: Serial
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
备考
SATA I (版本 1.x) 接口, 正式名稱爲SATA 1.5Gb/s, 是第一代SATA接口,運行速度爲1.5Gb/s。這個接口支持高達150MB/s帶寬吞吐量。
SATA II (版本2.x) 接口, 正式名稱爲SATA 3Gb/s,是第二代SATA接口,運行速度爲3.0 Gb/s。這個接口支持高達300MB/s帶寬吞吐量。
SATA III (版本3.x) 接口,正式名稱爲SATA 6Gb/s, 是第三代SATA接口,運行速度爲6.0Gb/s。這個接口支持高達600MB/s帶寬吞吐量。向後兼容SATA 3 Gb/s接口。
SATA II規格向後提供向後兼容SATA I接口的功能。SATA III規格提供向後兼容SATA I和SATA II接口的功能。但是,由于接口的較低的速度限制,驅動器的最大速度將會降低。
查看block 设备
cat /proc/scsi/scsi
输出:
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: ATA Model: ST1000NM0033-9ZM Rev: SN04
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: ATA Model: ST31000524AS Rev: JC49
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: TSSTcorp Model: DVD-ROM TS-H353C Rev: D100
Type: CD-ROM ANSI SCSI revision: 05
script 方式
for i in `grep -l Gbps /sys/class/ata_link/*/sata_spd`; do
echo Link "${i%/*}" Speed `cat $i`
cat "${i%/*}"/device/dev*/ata_device/dev*/id | perl -nE 's/([0-9a-f]{2})/print chr hex $1/gie' | echo " " Device `strings` | cut -f 1-3
done
输出:
Link /sys/class/ata_link/link1 Speed 6.0 Gbps
Device Z1W2QXTF SN04 ST1000NM0033-9ZM173 ac4i tp
Link /sys/class/ata_link/link2 Speed 6.0 Gbps
Device 9VPEBJT5 JC49 ST31000524AS Ac4i tp
Link /sys/class/ata_link/link3 Speed 1.5 Gbps
Device R60668ABA01852 D100 TSSTcorpDVD-ROM TS-H353C
参考资料