I'm trying to compare the differences between how power management is handled on battery and when plugged in. As a result I want to look at the config files for the two instances. Thanks in advance.
2 Answers
hdparm is the command to get and set hard disk parameters.
hdparmis a command line utility for the Linux and Windows operating systems 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.
hdparmhas to be run with root privileges, otherwise it will either not be found or the requested actions will not be executed properly.
Some examples:
Display information of the hard drive:
hdparm -I /dev/sda
Turn on DMA for the first hard drive:
hdparm -d1 /dev/sda
Test cache 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
External links with more examples: