Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Regular harddrive activity-power cable plugged in? [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
mabhobs
Tux's lil' helper
Tux's lil' helper


Joined: 10 Feb 2006
Posts: 83

PostPosted: Tue Feb 14, 2006 2:52 pm    Post subject: Regular harddrive activity-power cable plugged in? [solved] Reply with quote

I think I installed something, maybe pmud or pbbuttonsd, that regularly writes something to the harddrive. I created an init script that is suppost to put the harddrive to sleep after 1.5 minutes of inactivity, that however never happens, because a program regularly writes something to the harddrive. Interesting is that this changes when I unplug my power cable, then everything works as it is supposed to. How can I find out what program is writing constantly to my harddrive? Has anyone an idea what program that could be?

Thanks a lot for all the help.


Last edited by mabhobs on Sat Feb 25, 2006 3:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
The_P
Apprentice
Apprentice


Joined: 13 Mar 2004
Posts: 248

PostPosted: Tue Feb 14, 2006 5:12 pm    Post subject: Reply with quote

It could be some program which log something. I don't know are there messages in /var/log/messages?
Back to top
View user's profile Send private message
nokilli
Apprentice
Apprentice


Joined: 25 Feb 2004
Posts: 195

PostPosted: Tue Feb 14, 2006 7:34 pm    Post subject: Reply with quote

I'm sort of on the trail of this too. See this link.

To summarize, it appears to be a kernel thread called kjournald which is responsible for committing changes to the file system. It is preset to commit these changes every 5 seconds. Ick.

My root partition is ext3. My plan was going to be to reformat this as ext2, with the idea being that if there isn't a journal, there is no kjournald.

But you're right, when the laptop isn't connected to AC, this drive activity goes away. So I guess the strategy now is to find out what switch gets thrown when the laptop is unplugged and force it open while the laptop is plugged in.

Reference was made to a package called laptop-mode but it doesn't appear to be in portage. I suspect it's functionality is now part of the latest kernel versions, so the package itself is defunct?

From the other thread, here is a test you can perform to see if this is what is causing your unwanted disk drive activity. In one terminal, do a:
Code:
tail -f /var/log/messages

In another terminal, do:
Code:
echo 1 >/proc/sys/vm/block_dump

If the cause is indeed kjournald, you should see lines like the following in your messages file:
Code:
Feb 13 21:22:26 pismo kjournald(741): WRITE block 12623848 on hda11

Do the following to stop the test:
Code:
echo 0 > /proc/sys/vm/block_dump

Personally, I could deal with running the laptop off of battery power all of the time, if only I could get it to recognize the fact that I have TWO batteries in here; it seems to only see the one.

Sigh. Gentoo hurts so good.
Back to top
View user's profile Send private message
nokilli
Apprentice
Apprentice


Joined: 25 Feb 2004
Posts: 195

PostPosted: Tue Feb 14, 2006 8:35 pm    Post subject: Reply with quote

Lots of answers can be had at /usr/src/linux/Documentation/laptop_mode.txt

For now, I'm going to try taking the simplest possible approach, which appears to be using powerprefs to set the AC profile's power policy to "powersave", which for the last five minutes seems to be doing the trick.
Back to top
View user's profile Send private message
HighOnBonsai
Apprentice
Apprentice


Joined: 05 Jan 2004
Posts: 260

PostPosted: Wed Feb 15, 2006 12:41 pm    Post subject: Reply with quote

The package of interest is called

Code:
app-laptop/laptop-mode-tools


and is providing an init-script to activate the laptop-mode.


Christopher
_________________
Are YOU high - on bonsai?
Back to top
View user's profile Send private message
nokilli
Apprentice
Apprentice


Joined: 25 Feb 2004
Posts: 195

PostPosted: Wed Feb 15, 2006 11:10 pm    Post subject: Reply with quote

I'm guessing laptop-mode must be already automatically activated, because after close to a day of using my system as previously described - with the AC policy set to powersave - it seems to work well; no more hard drive spinning up every few seconds.
Back to top
View user's profile Send private message
mabhobs
Tux's lil' helper
Tux's lil' helper


Joined: 10 Feb 2006
Posts: 83

PostPosted: Thu Feb 16, 2006 2:35 pm    Post subject: Reply with quote

Thanks for all the posts. I checked what happens, but it does not say

Code:
pismo kjournald(741): WRITE block 12623848 on hda11


...instead I receive a
Code:
pdflush (74): WRITE block ...
message.

I will try the
Quote:
app-laptop/laptop-mode-tools
. Thanks.
Back to top
View user's profile Send private message
mabhobs
Tux's lil' helper
Tux's lil' helper


Joined: 10 Feb 2006
Posts: 83

PostPosted: Sat Feb 18, 2006 2:52 pm    Post subject: Reply with quote

I figured out that windowmaker, gdm and syslo-ng regularly write on the harddrive. But why does this stop when it is under powersave mode? Is there a way that I can stop these acceses?

nokilli, you said that you said the computer under powersave permanently. How did you do that?

Thanks for all the responses!!!
Back to top
View user's profile Send private message
nokilli
Apprentice
Apprentice


Joined: 25 Feb 2004
Posts: 195

PostPosted: Sun Feb 19, 2006 3:06 am    Post subject: Reply with quote

To set the AC policy to powersave, emerge/run powerprefs, select AC policy, then select powersave. To make it permanent, you'll need to edit your /etc/pbbuttonsd.conf file so that onAC_policy is set to powersave.

It doesn't eliminate _all_ disk accesses; the hd will still power up from time to time without my doing anything to cause it, but it isn't the annoying access-every-five-seconds which was really beginning to grate on me.

If the above doesn't suit you, do make sure to check out the laptop-mode-tools package mentioned earlier, I'm guessing it gives you finer control than merely setting the AC policy to powersave does.
Back to top
View user's profile Send private message
ruben
Guru
Guru


Joined: 04 Jul 2003
Posts: 462

PostPosted: Sun Feb 19, 2006 7:01 pm    Post subject: Reply with quote

mabhobs wrote:
I figured out that windowmaker, gdm and syslo-ng regularly write on the harddrive. But why does this stop when it is under powersave mode? Is there a way that I can stop these acceses?

Do you have laptop mode built in your kernel? Do you have "/proc/sys/vm/laptop_mode"? What is the value of this when you have the regular writes, and when you do not have the regular writes?
Did you look whether there is a "laptopmode" script in "/etc/power/script.d"? And whether your "/etc/power/pmcs-config" is configured to start laptop mode when you use only battery?

Laptop-mode (from the laptop-mode-tools package) can (with support in the kernel), delay disk-writes for a certain time. It tries to delay disk writes as much as possible, and when a file needs to be read, then it will schedule all delayed writes to be done after the read. I suspect that this is what you are seeing when using the powersave mode. Laptop-mode also re-mounts your partitions with a much higher commit-value, so as to prevent the disk from spinning up regularly because of the journalling daemon.

You need to install laptop-mode-tools and configure it. (these days it can do a lot more) Then, you also need to configure the power scripts of pbbuttonsd. Just like you, I wanted to avoid the regular writes, and on my laptop the disk can be spinned down for a long time. I also keep laptop-mode active when connected to a power outlet, since a spinned down disk also keeps the laptop cooler, and more silent.
Back to top
View user's profile Send private message
mabhobs
Tux's lil' helper
Tux's lil' helper


Joined: 10 Feb 2006
Posts: 83

PostPosted: Mon Feb 20, 2006 2:48 pm    Post subject: Reply with quote

Thanks for all the messages. I just started to figure out what is possible with laptop_mode tools.

I started laptop mode according to it's man page with "rc-update add laptop-mode default", so it will be started at every computer start. I also started to edit the laptop_mode.conf file in /etc/laptop_mode/ . This tool is really great and I also figured out how to use the cpu governors with it. For everybody who wants to have a silent computer, have a look at this, it is defibnitely worth it. :D

I changed the battery and AC values in the pbbuttonsd.conf file to nochange so that laptop_mode does the energy saving jobs and pbbuttonsd does not interfere.

I haven't looked at /etc/power/pcms-config, but I will. Thanks a lot for the suggestion.
Back to top
View user's profile Send private message
mabhobs
Tux's lil' helper
Tux's lil' helper


Joined: 10 Feb 2006
Posts: 83

PostPosted: Sat Feb 25, 2006 2:35 pm    Post subject: Reply with quote

I figured something out and wanted to share it , in case someone else is reading this post:

These are the configuration files to edit (starting with the most powerfull one, which means the first one overwrites the second and so on):

- pbbuttonsd.conf
- pcms-config
- laptop_mode.conf


I have one further question:

Is there a possibility to in laptop_mode.conf to have a variable like

Code:
NOLM_MAX_LOST_work_SECONDS=


Because I would like to set a varaibale like this. Thank you very much.
Back to top
View user's profile Send private message
mabhobs
Tux's lil' helper
Tux's lil' helper


Joined: 10 Feb 2006
Posts: 83

PostPosted: Mon Jun 05, 2006 11:23 am    Post subject: Reply with quote

As described above I am using laptop_mode. I however recognized that when I boot my ibook running on battery the laptop_mode will not start. I have to execute the following command by hand:

Quote:
laptop_mode start



Has anybody a suggestion why this is the case? Help woul greatly be appreciated.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum