The simple & effective power management guide in Ubuntu (how to save battery power)
Source: http://ubuntuforums.org/showthread.php?t=1326333
v 0.2 - This guide is written for Ubuntu 9.10 Karmic Koala
This guide is focused on how to implement most common power management tips, taken from the community and powertop suggestions, in the simplest way. Its aim is to be rock stable and quite effective without putting notebooks at risks. It has been tested by me on a Lenovo Thinkpad X60s with almost exclusively Intel hardware.
Hard disks
In Karmic hard drives are managed by a script and gnome-power-manager (g-p-m). The settings are very safe and probably there could still be some power to save but I prefer to play on the safe side with my hard disk.
I decided not to enable laptop-mode and not to play with the values in /usr/lib/pm-utils/power.d/95hdparm-apm or the seconds2sleep in gnome-power-manager.
Probably buying a good solid state drive could get much better results, but they are still very expensive.
Screen brightness
In karmic it is handled again by g-p-m, the standard values can be played with though.
Press alt+F2 and type
gconf-editor
scroll the "apps" section and open gnome-power-manager. The related part is "backlight". The "brightness_dim_battery" key is defaulted at 50, that means 50% reduction.
Personally I'm fine with the lowest brightness on my screen. Double click on the key name and instead of 50 write 99. Try different values to see which one is better for you, of course higher value, lower brightness, lower power consumption.
link power management policy
This is a tip among the ones suggested by running the powertop program (software center > powertop).
Run gedit (applications>accessories) and paste the following text in the empty document
#!/bin/sh
path_host0="/sys/class/scsi_host/host0/link_power_management_policy"
path_host1="/sys/class/scsi_host/host1/link_power_management_policy"
path_host2="/sys/class/scsi_host/host2/link_power_management_policy"
path_host3="/sys/class/scsi_host/host3/link_power_management_policy"
val=max_performance
case "$1" in
true)
echo "**lpm policy powersave ON"
val=min_power
;;
false)
echo "**lpm policy powersave OFF"
val=max_performance
;;
esac
# max_performance on AC min_power on battery
if [ -w "$path_host0" ] ; then
echo $val > $path_host0
fi
if [ -w "$path_host1" ] ; then
echo $val > $path_host1
fi
if [ -w "$path_host2" ] ; then
echo $val > $path_host2
fi
if [ -w "$path_host3" ] ; then
echo $val > $path_host3
fi
exit 0
close and save (in your home directory) calling it
link_pm_policy
Run a terminal (applications>accessories) and paste the following lines one at a time pressing return after each one
chmod 755 link_pm_policy
sudo su
install link_pm_policy /usr/lib/pm-utils/power.d/
exit
you WILL be asked for your password, just type it in and press return.
virtual machine dirty writeback
Again as suggested by powertop.
Run gedit (applications>accessories) and paste the following text in the empty document
#!/bin/sh
path_dwc="/proc/sys/vm/dirty_writeback_centisecs"
val=500
case "$1" in
true)
echo "**VM dirty writeback 15 seconds"
val=1500
;;
false)
echo "**VM dirty writeback 5 seconds"
val=500
;;
esac
# 5 seconds on AC, 15 seconds on battery
if [ -w "$path_dwc" ] ; then
echo $val > $path_dwc
fi
exit 0
close and save (in your home directory) calling it
vm_dirty_writeback
Run a terminal (applications>accessories) and paste the following lines one at a time pressing return after each one
chmod 755 vm_dirty_writeback
sudo su
install vm_dirty_writeback /usr/lib/pm-utils/power.d/
exit
you WILL be asked for your password, just type it in and press return.
Scheduling policy powersave
This is managed by a default script that comes with Karmic.
Usb auto suspend
This is a key issue for failure of power saving in Linux.
Run gedit (applications>accessories) and paste the following text in the empty document
#!/bin/bash
if [ "$1" = "true" ]; then
for i in /sys/bus/usb/devices/*/power/level; do
[ "$(cat $i)" = "auto" ] && continue
echo "auto" > $i
done
for i in /sys/bus/usb/devices/*/power/autosuspend; do
[ "$(cat $i)" -ge 0 2>/dev/null ] && continue
echo "2" > $i
done
fi
close and save (in your home directory) calling it
usb_autosuspend
Run a terminal (applications>accessories) and paste the following lines one at a time pressing return after each one
chmod 755 usb_autosuspend
sudo su
install usb_autosuspend /usr/lib/pm-utils/power.d/
exit
you WILL be asked for your password, just type it in and press return.
When starting the notebook with AC on this script doesn't do anything, it is automatically run when going from AC to Battery and it sets usb to autosuspend after 2 secs. NOTE that this could turn off some old usb devices plugged to the computer. To avoid any problem (and save the most battery) DON'T leave usb devices plugged when going from AC to Battery, even better, don't use usb devices when running on battery at all. When using AC there is absolutely no problems at all.
Intel HD audio
Karmic has finally added a line to alsa configuration files that turn off the card after few second of inactivity. HDA cards can be named Intel, Nvidia, Ati and others but all should have this power saving active.
Intel wireless cards
Since kernel 2.6.30 the behavior of such cards has changed, there is no possibility of tuning the power consumption.
Results
Running the powertop program
sudo powertop -d -t 60
these are my results after unplugging the cable
| Cn permanenza media C0 (cpu occupata) ( 0,7%) C0 0,0 ms ( 0,0%) C1 halt 0,0 ms ( 0,0%) C2 0,2 ms ( 0,0%) C3 28,4 ms (99,3%) P-state (frequenze) Wakeup-da-idle al secondo: 35,5 intervallo: 60,0s Cause principali di wakeup: Suggestion: Enable laptop-mode by executing the following command: |
The program is still suggesting me to run laptop-mode which is another way to handle the hard drive (and other variables) but I still prefer to avoid it as it's not recommended by Ubuntu.
Known issues & things to do
The guide could be simplified, creating a package for the scripts but I don't know how to do it.


iwl3945
disabling iwl3945 will help a little bit more but you won't have wireless network afterwards.
rmmod iwl3945 (to disable)
modprobe iwl3945 (to enable)