1. 了解hdparm命令
本文主要讲解如何在Linux系统上使用及查看硬盘信息和测试硬盘读写速度。
以CentOS7.5为例。默认情况下,并没有安装该工具。
[root@zcwyou ~]# yum -y install hdparm
2. 查看硬盘信息:
[root@zcwyou ~]# hdparm /dev/sda
/dev/sda:
SG_IO: bad/missing sense data, sb[]: 70 1c 05 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
multcount = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
geometry = 121534/255/63, sectors = 1952448512, start = 0
柱面数121534
磁头数255
扇区数63
总扇区数1952448512
起始扇区数start=0
3. 显示硬盘的摘要信息:
[root@zcwyou ~]# hdparm -g /dev/sda
/dev/sda:
geometry = 121534/255/63, sectors = 1952448512, start = 0
柱面数121534
磁头数255
扇区数63
总扇区数1952448512
起始扇区数start=0
4. 测试硬盘读取速度:
[root@zcwyou ~]# hdparm -T /dev/sda
/dev/sda:
Timing cached reads: 12900 MB in 1.99 seconds = 6469.02 MB/sec
5. 查看硬盘电源管理模式:
[root@zcwyou ~]# hdparm -C /dev/sda
/dev/sda:
SG_IO: bad/missing sense data, sb[]: 70 1c 05 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
drive state is: standby
6. 总结
hdparm工具是一个常用的工具,用于检测硬盘的状态,也是非常高效率的一个软件,建议Linux系统运维技术人员都要掌握。