Wednesday, September 2, 2009

Gain more battery life from your Linux-based laptop with powertop


If your laptop is running Linux you might not be happy with the battery life you are getting. There are numerous reasons for the possible extra drain on your battery. Some of the biggest issues are: Hard drive spin-downs, interrupts, and power management. Figuring out how to make these adjustments to your kernel (or subsystems) to gain a bit of extra battery life would take more time googling than you would probably prefer. Fortunately there is a single application available to take care of this for you. Powertop is one of those tools every user of Linux on a laptop should have installed – especially if your laptop depends primarily on its battery for life.
Powertop was created by Lesswatts.org with the sole purpose of helping users find those programs and/or systems that are using too much power. The end result? More battery life for you to enjoy. Power top is easy to install and use. Powertop is a curses-based application so it is run inside of a terminal very much like the Top application. Don’t expect a fancy GUI here, it’s text-based but still user-friendly. In this article you will find out how to install Powertop and use it to get the most out of your battery.
Installing Powertop
So long as you are using a modern release, you should find Powertop in your distributions’ repositories. And since Powertop is a terminal-based application, I will illustrate how to install via command line.
The steps are simple:
  1. Open up a terminal window.
  2. Issue the command sudo install powertop.
  3. Click ‘y’ to okay the installation.
That’s it. Powertop is now ready for you to use.
Using Powertop
Figure 1
Figure 1
With your terminal still open issue the command sudo powertop to start the application. You can not run Powertop as the standard user because Powertop has to collect and modify information that the standard user has no access to. Fortunately sudo will do the trick.
What you see will differ, depending upon your distribution, installation, configuration, etc.
As you can see ,in Figure 1, Powertop has a few suggestions to aid my laptop. The biggest issue is wakeups and Powertop is giving me the top causes for wakeups.
As you can also see, Powertop offers suggestions to solve the various problems. Not only does Powertop make suggestions, it will offer to take care of the suggestion for you. In the instance above you can see Powertop is suggesting I disable the hal system from polling my CD drive. You can do this with the command:
hal-disable-polling –device /dev/cdrom
or you can just hit the ‘K’ key and Powertop will take care of this for you.
Once you take care of this suggestion (whether you let Powertop take care of it or you do it manually) Powertop will then suggest another way for you get more power from your laptop and will offer to take care of the issue for you. You can continue on like this until Powertop has resolved every issue it can find.
Final thoughts
Powertop is an effective means of helping your laptop gain more battery life without having to recompile a kernel, manually edit a configuration file, or issue any commands (outside of starting the application). After following the suggestions of Powertop you should experience a noticeable difference in your battery life.

No comments:

Post a Comment