Gentoo Archives: gentoo-user

From: Nils Holland <nhg@×××××.org>
To: gentoo-user@l.g.o
Subject: [gentoo-user] HDD with too aggressive power management
Date: Mon, 31 Jan 2011 22:05:58
Message-Id: 20110131210940.GA16529@x7bj.fritz.box
1 Hi folks,
2
3 I've got an Asus X7BJ-something laptop here that by default (i.e. when
4 installing plain Gentoo on it) seems to do too aggressive power
5 management for its hard drive. That is, already after only about five
6 seconds(!!) of inactivity, the HDD spins down. This is kind of insane
7 - you edit some small file, only half a minute later when you save it,
8 you have to wait for what feels like ages for your HDD to spin back up
9 and actually do something. ;-)
10
11 The first thing I tried was having a look at the BIOS to see if HDD
12 power management can be disable there. But no sir, no such option. Ok,
13 no problem I thought, and emerged "hdparm", which I have added to my
14 default runlevel, so that it gets executed with the arguments "-B 254
15 -S 0" upon each boot. That seems to fix it, HDD power management is
16 off and no more unwanted spindowns occur.
17
18 However, now comes the problem: It seems that whenever I change from
19 wall power to battery power (probably also vice versa, but I haven't
20 tested this often enough), the machine's HDD forgets about the
21 settings I've made using "hdparm" and starts spinning down right again
22 after only a few seconds of inactivity. That sucks.
23
24 Of course, manually executing "hdparm -B 254 -S 0 /dev/sda" after
25 unplugging the machine fixes the issue again. However, something more
26 "automated" would be prefered.
27
28 First thing, I'm wondering if the change in power management
29 parameters is actually caused by something at the OS level. I haven't
30 set up any such thing explicitly, so I believe that it's something the
31 machine just "does" outside of the OS's control. As it can be
32 overridden by executing "hdparm" manually, what I would need is probably
33 a place where I can hook in with a little shell script that gets
34 executed every time the system's power source changes, and does
35 nothing else than just execute "hdparm" with the appripriate
36 parameters. So much about the theory, but then I don't really have an
37 idea what I'd have to do to get a script to run every time the power
38 source changes. And that's why I'm writing this message, as any
39 suggestions that could point me into the right direction are very
40 welcome. ;-)
41
42 Greetings and thanks in advance,
43 Nils
44
45 --
46 Nils Holland * Ti Systems, Wunsorf-Luthe (Germany)
47 Powered by GNU/Linux since 1998

Replies

Subject Author
Re: [gentoo-user] HDD with too aggressive power management Paul Hartman <paul.hartman+gentoo@×××××.com>
Re: [gentoo-user] HDD with too aggressive power management Alan McKinnon <alan.mckinnon@×××××.com>
Re: [gentoo-user] HDD with too aggressive power management Iain Buchanan <iaindb@××××××××××××.au>