You are not logged in.

#1 2013-04-04 17:08:52

Hannus
Member
Registered: 2013-04-04
Posts: 14

Laptop-mode-tools and hdparm -B settings

Since the change to systemd (I think so), I have a problem with laptop-mode-tools and hdparm. The hdparm -B settings (settings to park the hard drive) are most of the times not applied on startup of my laptop. But: sometimes the setting in the config file of laptop-mode-tools is applied.
These configs I have in /etc/laptop-mode/laptop-mode.conf:
#
# Power management for HD (hdparm -B values)
#
BATT_HD_POWERMGMT=254
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254

If I check the settings of hdparm after starting my laptop (sudo hdparm -B /dev/sda), most of the times the setting is 128. Because I am afraid that my hard drive will damage with this setting, every time I have to do 'sudo systemctl restart laptop-mode.service'. After that, the setting of hdparm -B is 254.

Does anybody know something to solve this annoying problem? Thanks in advance!

Offline

#2 2013-04-04 23:45:42

sano
Member
Registered: 2012-02-11
Posts: 113

Re: Laptop-mode-tools and hdparm -B settings

You could write an udev rule. That's what I did, although laptop-mode-tools was giving me the same result - I just wanted to reduce the list of services for the sake of boot speed.
Mine looks like this:

/etc/udev/rules.d/75-hdparm.rules
ACTION=="add", KERNEL=="sda", ATTR{queue/rotational}=="1", RUN+="/sbin/hdparm -B 254 /dev/$kernel"

You might have to change "sda" according to your system.

Disclaimer (and friendly hint): I didn't come up with this by myself, I had to borrow it from somewhere on this forum.

Edit: from here, but you can also find it there.

Last edited by sano (2013-04-04 23:53:09)

Offline

#3 2013-04-05 09:34:04

Hannus
Member
Registered: 2013-04-04
Posts: 14

Re: Laptop-mode-tools and hdparm -B settings

Thanks for the answer!
But that didn't solve the problem with laptop-mode-tools, because this solution doesn't have to do something with lmt.
So my question is why the hdparm -B settings from the lmt-settings are not applied? Is that maybe a bug in lmt?
Laptop-mode-tools should of course works, also on startup!

Offline

#4 2013-04-05 09:59:07

sano
Member
Registered: 2012-02-11
Posts: 113

Re: Laptop-mode-tools and hdparm -B settings

As it is a rather important tweak for some HDDs, I figured you might want to create this udev rule just to be sure.

Anyway: What about other settings managed by lmt? Do they get applied?

Offline

#5 2013-04-05 17:22:00

Hannus
Member
Registered: 2013-04-04
Posts: 14

Re: Laptop-mode-tools and hdparm -B settings

I looked at the lmt-settings for the cpu frequency scaling, and yes, these are applied by lmt. So lmt functions, but the hdparm -B settings are not as in the configuration file.

Is it possible that the there is a problem with systemd? See also https://bbs.archlinux.org/viewtopic.php?id=149683 (but there isn't a solution in my opinion).

Offline

Board footer

Powered by FluxBB