Developer(s) | Mark Lord |
---|---|
Stable release |
9.52 / May 1, 2017
|
Operating system | Linux |
Size | 133 kB |
Type | Utility software |
License | BSD license |
Website | sourceforge |
hdparm is a command line program for Linux to set and view ATA hard disk drive hardware parameters. It can set parameters such as drive caches, sleep mode, power management, acoustic management, and DMA settings. GParted and Parted Magic both include hdparm.
Changing hardware parameters from suboptimal conservative defaults to their optimal settings can improve performance greatly. For example, turning on DMA can, in some instances, double or triple data throughput. Unfortunately at present there is no reliable method for determining the optimal settings for a given controller/drive combination, except careful trial and error; nor is there yet any central database that collects and shares the combined experience of hdparm users.
hdparm has a more serious drawback: it can crash a computer and make data on its disk inaccessible if certain parameters are misused. Out of approximately sixty-seven parameters, several are dangerous and could result in "massive filesystem corruption" when used indiscriminately.
hdparm has to be run with root privileges, otherwise it will either not be found or the requested actions will not be executed properly.
Display information of the hard drive:
Turn on DMA for the first hard drive:
Test device read performance speed (-t for timing buffered disk reads) of the first hard drive:
Enable energy saving spindown after inactivity (24*5=120 seconds):
To retain hdparm settings after a software reset, run:
Enable read-ahead:
If the disk is constantly too noisy, you can change its acoustic management at the cost of read/write performance (Some drives, such as newer WD drives and all SSDs, ignore this setting.):
If the disk synchronisation intervals are too short, then even small amounts of data will be written to disk which can have severe consequences for its lifespan. The better way would be to collect small data into bigger chunks and wait until the chunk is big enough to be written to disk.
Current web browsers like Chrome write regularly small chunks when browsing in order not to lose any important data when the application crashes. However, this lets the disk spin very often as the drive repeatedly needs to unleash and then park its heads. The generated noises can be thus regarded as distracting by the user. To circumvent this issue, you can switch the drive to the lowest degree of power management (next value, 255, turns power management off):