hdparm is a command-line utility to set and view ATA and SATA hard disk drive hardware parameters.
USE flags for sys-apps/hdparm Utility to change hard drive performance parameters
|!!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically
emerge --ask sys-apps/hdparm
To set parameters on boot, edit the /etc/conf.d/hdparm configuration file:
- sdX_args: Set parameters for the given drive (replace sdX with the right device file name).
- discX_args: Set parameters for the given disc drive.
- cdromX_args: Set parameters for the given optical drive.
- all_args: Set parameters for all drives.
For example, to disable power management for all drivers and enable the DMA feature for /dev/sda:
When finished modifying the configuration file be sure to add the hdparm service to the default runlevel so that it can start at system boot:
rc-update add hdparm default
Show identification and feature info:
hdparm -I /dev/sdX
Be sure that no other programs are stressing the drive at the time of testing:
hdparm -tT /dev/sdX
Get current settings
This is not consistent: for some features the current values can be found in the common info, for other features hdparm must be called with the right parameters, but without any value, like
hdparm -d /dev/sdX
Set features by put the value directly behind the parameter (without space), e.g. to enable the DMA mode:
hdparm -d1 /dev/sdX
Changing the default values can harm the drive or freeze the system.
The following tables introduces the most common parameters. For a complete list see the hdparm man page.
|Set the Advanced Power Management feature. The value 1 saves the most energy, the value 255 disables the feature. The values in-between are corresponding steps. Values of 127 and below allow the spin-down of the drive.
Aggressive power management can wear the drive because of often spin-downs.
|Set the DMA feature for IDE and PATA drives. The value 1 enables the feature, 0 disables the feature.
|Set CD / DVD drive speed. Lower speeds can reduces the running noise.
|Set the Automatic Acoustic Management feature. The values 0 disables the feature, 128 sets the most quiet mode, 254 is the fastest mode.
|Set the standby (spin-down after idling) timeout. The value 0 disables the feature, the values from 1 to 240 specifies time steps of 5 seconds, 241 to 251 time steps of 30 minutes.
- HDD — describes the setup of an internal SATA or PATA (IDE) rotational hard disk drive.