Index menü
hdparm -B 255 /dev/sda
Display information of the hard drive:hdparm -I /dev/sda Turn on DMA for the first hard drive:hdparm -d1 /dev/sda Test device read performance of the first hard drive:hdparm -t /dev/sda Enable energy saving spindown after inactivity (24*5=120 seconds):hdparm -S 24 /dev/sda To retain hdparm settings after a software reset, run:hdparm -K 1 /dev/sda Enable read-ahead:hdparm -A 1 /dev/sda If the disk is constantly too noisy, you can change its acoustic management at the cost of read/write performance: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, you can switch the drive to the lowest degree of power management (next value, 255, turns power management off):hdparm -B 254 /dev/sdaAdditionally, 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.Note that all these commands are only effective in the long-run, if you make the changes persistent. However, the settings you can set viahdparm
are reverted each time you reboot. 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.