Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Usage examples  





2 See also  





3 References  





4 External links  














hdparm






Deutsch
Español
Français

Polski
Русский
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


hdparm
Developer(s)Mark Lord
Stable release

9.65[1] Edit this on Wikidata / 7 September 2022; 22 months ago (7 September 2022)

Operating systemLinux
Size134 kB
TypeUtility software
LicenseBSD license
Websitesourceforge.net/projects/hdparm/

hdparm is a command line program for Linux to set and view ATA hard disk drive hardware parameters and test performance.[2][3] It can set parameters such as drive caches, sleep mode, power management, acoustic management, and DMA settings. GParted[citation needed] and Parted Magic both include hdparm.[4]

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[edit]

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:[5]

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):[6]

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.[7]

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.[citation needed]

See also[edit]

References[edit]

  1. ^ "hdparm-9.65 is released".
  • ^ Nemeth, Evi; Snyder, Garth; Hein, Trent R. (2006-10-30). Linux Administration Handbook. Addison-Wesley Professional. pp. 129–131. ISBN 978-0-13-700275-7.
  • ^ Flickenger, Rob (2003-01-20). Linux Server Hacks: 100 Industrial-Strength Tips and Tools. "O'Reilly Media, Inc.". pp. 43–46. ISBN 978-1-4493-7892-9.
  • ^ "Parted Magic 2020-12-25". Retrieved 21 January 2021.
  • ^ "Tuning hard drive".
  • ^ "ThinkWiki.org".
  • ^ "Documentation for /proc/sys/vm/*".
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Hdparm&oldid=1128524317"

    Categories: 
    Free system software
    Data erasure software
    Software using the BSD license
    Hidden categories: 
    Articles with short description
    Short description is different from Wikidata
    Articles needing additional references from October 2014
    All articles needing additional references
    All articles with unsourced statements
    Articles with unsourced statements from March 2014
    Articles with unsourced statements from January 2022
     



    This page was last edited on 20 December 2022, at 16:03 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki