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.