more battery, please

After I found out that the enhanced Gnome power manager applet has some trouble dealing with two batteries (it currently assumes you have only one and therefore it’s ability to guess the correct lifetime based on recent discharging times shows you definitely wrong spans when swapping the battery). But to be honest, this bug isn’t that grave to drop more words about this – I am quite sure it will be fixed soon.

More interesting instead is the possibility to save power. At least with gutsy you have the possibility to install Intel’s „powertop“ utility – a command line tool for measuring power consumption and detecting possible power leaks. I heard a lot of bad words about powertop, I for myself am quite satisfied about it and it’s documentation and hints on the website.

After dealing with it for some time, I wrote the following quite stupid but effective script, that extends my battery life time for some percent:

#!/bin/dash
# stop not essentially needed daemons
/etc/init.d/cupsys stop
/etc/init.d/tor stop
/etc/init.d/privoxy stop
/etc/init.d/bluetooth stop
/etc/init.d/racoon stop
/etc/init.d/postfix stop
/etc/init.d/cron stop
/etc/init.d/sysklogd stop
/etc/init.d/klogd stop
# decrease wlan power consumption (if wlan is not needed: switch it off!)
iwpriv eth1 set_power 5
# increase writeback time
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
# enable ac97 sound power save mode
echo 1 > /sys/module/snd_ac97_codec/parameters/power_save
# enable usb power save (actually not needed as it gets killed afterwards)
echo 1 > /sys/module/usbcore/parameters/autosuspend
# switch off usb
modprobe -r ehci_hcd
modprobe -r uhci_hcd
# switch off bluetooth
modprobe -r rfcomm
modprobe -r l2cap
modprobe -r bluetooth
# put harddisk to power save mode (spin down)
hdparm -B 1 -S 12 /dev/sda
# activate quiet hard disk mode - probably not needed when using the power save mode
hdparm -M 128 /dev/sda
# remount active partitions with noatime
mount -o remount,noatime /
mount -o remount,noatime /mnt/cryptdevice
# active laptop mode
echo 5 > /proc/sys/vm/laptop_mode

So you might guess I am not the hardware guru and you are right about it. But maybe this snippet is a good starting point for you to save some power. And yes, you can also save power on your desktop pc. It will not extend a battery lifetime but maybe the one of your purse.

Feel free to drop some of your hints or rants in the comment field.

5 Gedanken zu “more battery, please

  1. Those are good esttings, except watch out with the use of hdparm -B 1, it could cause very excessive disk idle parking, which both lowers battery life and disk life.

    You can also use relatime instead of noatime on Gutsy for decreased atime disk IO while still keeping atime records (some apps like mutt freak out if your don’t use atime)

    Also, several newer laptops have their keyboard/trackpad hooked up internally via USB, so warn that disabling USB might lead to no input devices functioning, needing a hard reset to get back in!

  2. Hi jdong,

    thanks for your advice. The hdisk-stuff is the only thing I’s not really sure about. It’s great to hear your hard disk spin down and actually my hard disk seems to be optimised for this setting: it comes up within less than a second. But when you think about it, it doesn’t look that healthy. I’ll play around with it, maybe it’s better to only use the „quiet“ setting.

    For the usb stuff: keyboard and touchpad are working with one exception: The hotkey for screen brightness is disabled which is not a great pity as I need it quite dark when saving power (and can, of course, reactive usb when needed).

    Thanks for your comment and greetings,

    ccm.

  3. Have a look at laptop-mode-tools. At least under Debian they handle a lot of these settings already.

Schreib einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *