Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I'm new to Ubuntu and I'm not a developer to know how to write codes. I downloaded it couple of days ago but it is killing my battery, it almost lasts an hour and couple of minutes while it holds for over than 3 hours with windows.

How to fix this in easy steps to follow?

share|improve this question

marked as duplicate by con-f-use, AgentCool, Eric Carvalho, Seth, Basharat Sialvi Apr 15 '13 at 14:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
model & specs please .. –  Qasim Apr 15 '13 at 11:11
    
add comment

1 Answer 1

Do the following things and your battery life will be better

 sudo apt-get install indicator-cpufreq

Place the following script /etc/pm/power.d/ and give execution rights

 sudo gedit /etc/pm/power.d/power

Copy & Paste

 #!/bin/sh

if on_ac_power; then

 ##### Start AC powered settings #####


 # Disable laptop mode
echo 0 > /proc/sys/vm/laptop_mode

 #NMI watchdog should be turned on
for foo in /proc/sys/kernel/nmi_watchdog;
do echo 1 > $foo;
done

 # Set SATA channel: max performance
for foo in /sys/class/scsi_host/host*/link_power_management_policy;
do echo max_performance > $foo;
done

 # CPU Governor: conservative NOT Performance
 # Laptop get start heating up on Performance
 # You can change the freq with indicator-cpufreq
for foo in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
do echo conservative > $foo;
done 

 # Disable USB autosuspend
for foo in /sys/bus/usb/devices/*/power/level;
do echo on > $foo;
done

 # Disable PCI autosuspend
for foo in /sys/bus/pci/devices/*/power/control;
do echo on > $foo;
done

 # Disable power saving for intel sound
echo 0 > /sys/module/snd_hda_intel/parameters/power_save

 # Disable power saving for Wireless card
iw dev wlan0 set power_save off

 # Disabling auto suspending USB
for i in /sys/bus/usb/devices/*/power/autosuspend;
do echo 2 > $i;
done

 ##### End AC powered settings #####

 else

 ##### Start battery powered settings #####

 # Enable Laptop-Mode disk writing
echo 5 > /proc/sys/vm/laptop_mode

 #NMI watchdog should be turned on
for foo in /proc/sys/kernel/nmi_watchdog;
do echo 0 > $foo;
done

 # Set SATA channel to power saving
for foo in /sys/class/scsi_host/host*/link_power_management_policy;
do echo min_power > $foo;
done

 # Select conservative CPU Governor
for foo in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor;
do echo conservative > $foo;
done

 # Activate USB autosuspend
 for foo in /sys/bus/usb/devices/*/power/level;
 do echo auto > $foo;
 done

 # Activate PCI autosuspend
for foo in /sys/bus/pci/devices/*/power/control;
do echo auto > $foo;
done

 # Power Saving for INTEL sound 
echo 1 > /sys/module/snd_hda_intel/parameters/power_save

 # Power saving ON for Wireless
iw dev wlan0 set power_save on

 # Auto Suspending USB devices
for i in /sys/bus/usb/devices/*/power/autosuspend;
do echo 1 > $i;
done

 ##### End battery powered settings #####

fi

Make it executable

 sudo chmod +x /etc/pm/power.d/power

Please have a look on the following links

Specific short battery life problem with Sony VAIO laptop

How do I make Powertop changes permanent?

https://wiki.ubuntu.com/Kernel/PowerManagement/PowerSavingTweaks

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.