大家好,又见面了,我是你们的朋友全栈君。
“ hdparm ”(即硬盘参数)是Linux的命令行程序之一,用于处理磁盘设备和硬盘。借助此命令,您可以获得有关硬盘,更改写入间隔,声学管理和DMA设置的统计信息。它还可以设置与驱动器高速缓存,睡眠模式,电源管理,声学管理和DMA设置相关的参数。
[root@instance-z78bdmwa ~]# yum install hdparm -y L
句法:
hdparm [选项] [设备]
注意:如果未指定标志,则假定为acdgkmnru。
选项:
例子:
[root@instance-z78bdmwa ~]# hdparm -I /dev/vda
/dev/vda:
ATA device, with non-removable media
Standards:
Likely used: 1
Configuration:
Logical max current
cylinders 0 0
heads 0 0
sectors/track 0 0
—
Logical/Physical Sector size: 512 bytes
device size with M = 1024*1024: 0 MBytes
device size with M = 1000*1000: 0 MBytes
cache/buffer size = unknown
Capabilities:
IORDY not likely
Cannot perform double-word IO
R/W multiple sector transfer: not supported
DMA: not supported
PIO: pio0
用于显示所有选项的命令:
[root@instance-z78bdmwa ~]# hdparm -h
hdparm – get/set hard disk parameters – version v9.43, by Mark Lord.
Usage: hdparm [options] [device …]
Options:
-a Get/set fs readahead
-A Get/set the drive look-ahead flag (0/1)
-b Get/set bus state (0 == off, 1 == on, 2 == tristate)
-B Set Advanced Power Management setting (1-255)
-c Get/set IDE 32-bit IO setting
-C Check drive power mode status
-d Get/set using_dma flag
-D Enable/disable drive defect management
-E Set cd/dvd drive speed
-f Flush buffer cache for device on exit
-F Flush drive write cache
-g Display drive geometry
-h Display terse usage information
-H Read temperature from drive (Hitachi only)
-i Display drive identification
-I Detailed/current information directly from drive
-J Get/set Western DIgital “Idle3” timeout for a WDC “Green” drive (DANGEROUS)
-k Get/set keep_settings_over_reset flag (0/1)
-K Set drive keep_features_over_reset flag (0/1)
-L Set drive doorlock (0/1) (removable harddisks only)
-m Get/set multiple sector count
-M Get/set acoustic management (0-254, 128: quiet, 254: fast)
-n Get/set ignore-write-errors flag (0/1)
-N Get/set max visible number of sectors (HPA) (VERY DANGEROUS)
-p Set PIO mode on IDE interface chipset (0,1,2,3,4,…)
-P Set drive prefetch count
-q Change next setting quietly
-Q Get/set DMA queue_depth (if supported)
-r Get/set device readonly flag (DANGEROUS to set)
-R Get/set device write-read-verify flag
-s Set power-up in standby flag (0/1) (DANGEROUS)
-S Set standby (spindown) timeout
-t Perform device read timings
-T Perform cache read timings
-u Get/set unmaskirq flag (0/1)
-U Obsolete
-v Use defaults; same as -acdgkmur for IDE drives
-V Display program version and exit immediately
-w Perform device reset (DANGEROUS)
-W Get/set drive write-caching flag (0/1)
-x Obsolete
-X Set IDE xfer mode (DANGEROUS)
-y Put drive in standby mode
-Y Put drive to sleep
-z Re-read partition table
-Z Disable Seagate auto-powersaving mode
[root@instance-z78bdmwa ~]# hdparm -t /dev/vda
/dev/vda:
Timing buffered disk reads: 374 MB in 3.01 seconds = 124.35 MB/sec
[root@instance-z78bdmwa ~]# hdparm -T /dev/vda
/dev/vda:
Timing cached reads: 16566 MB in 2.00 seconds = 8292.96 MB/sec
[root@instance-z78bdmwa ~]# hdparm -A 1 /dev/vda
[root@instance-z78bdmwa ~]# hdparm -B 254 /dev/vda
[root@instance-z78bdmwa ~]# hdparm -d /dev/vda
[root@instance-z78bdmwa ~]# hdparm -d1 /dev/vda
[root@instance-z78bdmwa ~]# hdparm -M 128 /dev/vda
[root@instance-z78bdmwa ~]# hdparm -C /dev/vda
[root@instance-z78bdmwa ~]# hdparm -m /dev/vda
检查:smartctl -l selftest /dev/vda
卸载:umount /dev/vda*
修复:badblocks /dev/vda
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/124972.html原文链接:https://javaforall.cn