HOME

TheInfoList



OR:

hdparm is a
command line A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
program for
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
to set and view ATA
hard disk drive A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with magnet ...
hardware parameters and test
performance A performance is an act of staging or presenting a play, concert, or other form of entertainment. It is also defined as the action or process of carrying out or accomplishing an action, task, or function. Management science In the work place ...
. It can set parameters such as drive caches, sleep mode, power management, acoustic management, and DMA settings.
GParted GParted (acronym of GNOME Partition Editor) is a GTK front-end to GNU Parted and an official GNOME partition-editing application (alongside Disks). GParted is used for creating, deleting, resizing, moving, checking, and copying disk partitions ...
and
Parted Magic Parted Magic is a commercial Linux distribution based on Slackware that comes with disk partitioning and data recovery tools. It is sold as a Linux-based bootable disk. The distribution's nomenclature is derived from the names of the GNU Parted ...
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. There is, however, no reliable method for determining the optimal settings for a given controller-drive combination, except careful trial and error. Depending on the given parameters, ''hdparm'' can cause computer crashes or render the data on the disk inaccessible.


Usage examples

hdparm has to be run with special privileges, otherwise it will either not be found or the requested actions will not be executed properly. Display information of the hard drive: sudo hdparm -I /dev/sda Turn on DMA for the first hard drive: sudo hdparm -d1 /dev/sda Test device read performance speed (-t for timing buffered disk reads) of the first hard drive: sudo hdparm -t /dev/sda Enable energy saving spindown after inactivity (24*5=120 seconds): sudo hdparm -S 24 /dev/sda To retain hdparm settings after a software reset, run: sudo hdparm -K 1 /dev/sda Enable read-ahead: sudo hdparm -A 1 /dev/sda Change its acoustic management, at the cost of read/write performance (Some drives, such as newer WD drives and all SSDs, ignore this setting.): sudo hdparm -M 128 /dev/sda 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, the user can switch the drive to the lowest degree of power management (next value, 255, turns power management off): hdparm -B 254 /dev/sda Additionally, changing the value of /proc/sys/vm/dirty_expire_centisecs can have an effect on the performance. It sets the flush interval when dirty pages are written to disk. These commands are only effective in the long-run if the user makes the changes persistent. However, the settings the user can set via hdparm are reverted each time the system is rebooted. Therefore, it might be wise to restore the personal settings upon boot. An appropriate place that exists in most Linux distributions is the /etc/rc.local script.


See also

*
ATATool ATATool is freeware software that is used to display and modify ATA disk information from a Microsoft Windows environment. The software is typically used to manage host protected area (HPA) and device configuration overlay (DCO) features and is b ...
for Windows


References


External links

*{{SourceForge, hdparm, hdparm
man page
Free system software Data erasure software Software using the BSD license