LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   KDE changing hard disk parameters on start up - ala hdparm (http://www.linuxquestions.org/questions/slackware-14/kde-changing-hard-disk-parameters-on-start-up-ala-hdparm-4175436091/)

slackuser998 11-07-2012 09:56 AM

KDE changing hard disk parameters on start up - ala hdparm
 
I have Slackware 14 on my Asus laptop. The default disk spin down is way too aggressive. I've been trying to change this. I used hdparm on boot, in rc.local as follows:

hdparm -B 255 -S 251 /dev/sda

This appear to work fine, I verify it with "# hdparm -I /dev/sda". The output indicates "Advanced power management level: disabled". Great.

Then I start KDE. All the sudden the hard disk parameters are changed, as I see when I run hdparm (as root) in a console. WTF?

If I manually run (as root) /etc/rc.d/rc.local (with the hdparm stuff) again, in a console, then the hard disk is reset as I intended. So far KDE doesn't seem to reset the hard disk parameters while it is running. So the changes appear to be made only on KDE startup.

Does anyone know about this, where it happens or how to disable it conveniently. Manually running hdparm in a console after KDE is started is a pain. I could put the hdparm stuff in a KDE startup script (for a single user laptop), however this is hackish. Is there a better way? Thanks.

guanx 11-07-2012 10:33 AM

Are you on AC power? Did you try to tune the pm-utils parameters?

slackuser998 11-08-2012 09:38 AM

guanx,

First, I'm definitely on battery, and not AC. Also, no, I'm not using the pm-utils to tune the parameters. I've not manually set up the pm-utils to run, and they don't appear to be setup by default in Slackware 14.

All,

In addition, a bit more testing has disclosed some more information. If I start Fluxbox (and X11), rather than KDE (and X11), then the hard disk parameters are not changed. Thus it appears that this is a KDE thing and not an X11 thing.

guanx 11-08-2012 02:59 PM

I think pm-utils is taking care of your hard disk. This is my config for pm-utils:
Code:

$ cat /etc/pm/config.d/harddrive
#!/bin/sh

# Default values on AC
DRIVE_SPINDOWN_VALUE_AC="${DRIVE_SPINDOWN_VALUE_AC:-0}"
DRIVE_WRITE_CACHE_AC="${DRIVE_WRITE_CACHE_AC:-1}"
DRIVE_POWER_MGMT_AC="${DRIVE_POWER_MGMT_AC:-254}"
DRIVE_ACOUSTIC_MGMT_AC="${DRIVE_ACOUSTIC_MGMT_AC:-0}"

# Default values on battery
DRIVE_SPINDOWN_VALUE_BAT="${DRIVE_SPINDOWN_VALUE_BAT:-60}"
DRIVE_WRITE_CACHE_BAT="${DRIVE_WRITE_CACHE_BAT:-1}"
DRIVE_POWER_MGMT_BAT="${DRIVE_POWER_MGMT_BAT:-252}"
DRIVE_ACOUSTIC_MGMT_BAT="${DRIVE_ACOUSTIC_MGMT_BAT:-254}"

Now my hard disk spins down much less frequently than by default (when on battery). If in question, see comments in pm-utils scripts, and man hdparm.

.


All times are GMT -5. The time now is 01:02 AM.