关于linux下查看硬盘的转速也并没有一个统一的非常好用的工具 ,很多方法都是查看到disk 的型号再去网上查找转速或者利用OEM厂商提供的阵列查看工具去获取。我在网上查找了很久后,找到了一款对SCSI 硬盘比较通用的工具包 sg3_utils package

在centos 6的源直接带有,可以通过yum -y install sg3_utils 安装 。也可以直接去官网下载rpm包、deb包或源码包进行安装 。该工具包包含的工具文件比较多,如下:

[root@361way tmp]# rpm -ql sg3_utils
<br />


[root@361way tmp]# sginfo -g /dev/cciss/c0d0
Rigid Disk Geometry mode page (0x4)
Number of cylinders                65535
Number of heads                    255
Starting cyl. write precomp        65535
Starting cyl. reduced current      65535
Device step rate                   0
Landing Zone Cylinder              0
RPL                                0
Rotational Offset                  0
Rotational Rate                    15000
<br />

上面最后一行的结果就是转速,15000转 。使用sg_vpd的方法相对复杂:

# sg_vpd /dev/sg8 --page=0×89
ATA information VPD page:
 SAT Vendor identification: LSI
 SAT Product identification: LSI SATL
 SAT Product revision level: 0008
 ATA command IDENTIFY DEVICE response summary:
   model: ST31000340NS
   serial number:             9QJ4VPL1
   firmware revision: SN06
linux-suse11p1:~ # sg_vpd /dev/sg8 --page=0xb1
Block device characteristics VPD page (SBC):
 Nominal rotation rate: 7200 rpm
 Nominal form factor not reported
<br />

上面Nominal rotation rate后面的值就是转速,为7200转 。使用该命令时需要知道page后面使用的值,需要使用sg_vpd -e参数来获取。


[root@361way ~]# sginfo -g /dev/hda
A device name that understands SCSI commands is required
Couldn't find sg device corresponding to /dev/hda
<br />


The sg3_utils package contains utilities that send SCSI commands to devices. As well as devices on transports traditionally associated with SCSI (e.g. Fibre Channel (FCP), Serial Attached SCSI (SAS) and the SCSI Parallel Interface(SPI)) many other devices use SCSI command sets. ATAPI cd/dvd drives and SATA disks that connect via a translation layer or a bridge device are examples of devices that use SCSI command sets.

上面直接就说明只适用于scsi 设备。 


您的电子邮箱地址不会被公开。 必填项已用*标注