s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
Next
Previous
Contents
4. Changing some general system settings
After I got Linux up and running on my laptop, I found it accessing the harddisk every few seconds, even when there was no user logged in to the system. The harddisk could never enter its power saving mode. Reducing harddisk activity can greatly increase the battery runtime, so this is why I collected the following recipes.
I tested all this with RedHat 4.1, the locations of some configuration settings may be different for your distribution. (If so, please let me know.)
4.1 The crond daemon and atrun
Check your
With the
This is not really necessairy on most systems, since
Then you can safely change this to:
Read
4.2 The update / bdflush daemon
Linux deals with a lot of open file buffers at any given moment, so the system must make sure that file changes are saved to the harddisk as soon possible. Otherwise, those changes will be lost after a system crash.
The
With my Fujitsu disk this caused non-stop access. (It seems that this harddisk flushes its ram cache even when nothing has changed. But this depends on your harddisk's firmware: Other people told me that their harddisk does enter its power saving mode even without the following modification.)
Since Linux does not crash very often anymore, I have changed both values to 3600 seconds (= one hour). This caused no problems at all and the constant disk access has stopped. (But if my system crashes now, there will be more broken files, of course.)
RedHat 4.1: In
Suse 4.4.1:
Slackware:
See
4.3 The syslogd daemon
The
You can turn that off by preceding the filename with a dash
in
This again means that if the system crashes, the message that reported the problem may not have been stored to disk. Dilemma...
4.4 The init command
During the bootup, the initial processes and daemons will be
started using the
You can change this by removing the
To avoid problems with lost file buffers, you should add a
call to
4.5 The swap partition
The Linux swap partition is used to increase the physical ram space
with virtual memory. This again is a possible reason for harddisk
access. If your laptop already has a lot of ram or if
the applications that you use are quite simple
(think of
This of course depends on what you plan to do. 4 to 8 megs are not enough, you must use a swap partition then. With 8 to 16 megs, text console applications will work fine and if you can avoid using a lot of multitasking features, you can safely disable swap. The X-Windows enviroment requires a lot of ram and you should not use it without a swap partition unless you really have a lot more than 16 megs.
(Sidenote: My laptop with 16 megs and disabled swap partition can run
an
If you already have installed a swap partition, you can disable
it by preceding the
Then you can use the swap partition while on ac power and drop it while on battery.
4.6 The apache httpd webserver daemon
I am using my laptop to develop and test cgi scipts for websites, that is why I am running a local webserver on it. The standard configuration is a bit too much if all you want to do is just test a script or check a page from time to time.
In
If you wish to turn off the webserver's logging, you must
recompile the
Grant Taylor recompiled apache's logging and found
that this ``didn't make it stop churning the disk. So I used
another, IMHO better, solution: I configured apache to run
from inetd instead of standalone.'' Read
4.7 The XFree86 package
Configuring XFree86 for laptops is a story of its own. And yet again, I have to refer you to the Linux Laptop page where you will find a lot of help on this.
X's console blanking only turns the screen black, but does
not turn it off. As mentioned in the
sidenote about console blanking,
you can use
Grant Taylor uses the following setup to send his laptop to
sleep with the help of
Where ``
4.8 The emacs editor
Ok,
I have put in the file
This disables auto-saving based on time, and makes the auto-saving be done every 2500 keyboard actions. Of course if you are typing a text this last parameter should be reduced, but for programming it is sufficient. Since every action (up, down, left, backspace, paste, etc...) is counted, 2500 actions are reached very rapidly.''
4.9 How to find more ways to optimize
If your Linux system still seems to access the harddisk too
often, you can find out what is going on inside by using
the
Now read the
Please send me an email if you found something new.
Next Previous Contents |