Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Portables Software Hardware Linux

Getting Better Battery Life w/ Linux? 69

Nuclear Elephant asks: "After a little hacking, Linux has been running great on my Thinkpad T30 for about a year now. I can talk to my cellphone and bluetooth devices, do all kinds of neat hacking on wireless, and just about everything you'd expect to be able to do from a Windows machine, except make the battery last. Even after the standard optimizations (like cpufreq, laptop_mode, brightness, turning off useless processes, etc.) my battery still only lasts about an hour running under Linux as opposed to 2 1/2 hours in Windows. Has anybody come up with some innovative battery conservation ideas for Linux? It seems to be the only thing lacking in this fine operating system." What kernel options might one look into, for saving laptop battery power? Also, what desktop settings (both for Gnome and KDE) would work best, for this situation?
This discussion has been archived. No new comments can be posted.

Getting Better Battery Life w/ Linux?

Comments Filter:
  • by yotaku ( 26455 ) on Tuesday March 09, 2004 @05:58PM (#8514250) Homepage
    "and just about everything you'd expect to be able to do from a Windows machine, except make the battery last."

    Sounds like you basically answered your own question. Use the best tool for the job. If windows allows you to do all that AND make the battery last - then maybe you should just use windows.
    • by Anonymous Coward
      Was this seriously just modded troll? I'd say insightful. Off-topic, maybe (that's pushing it), but troll? Sounds like it's the mod who is a troll...
    • Sounds like you basically answered your own question. Use the best tool for the job. If windows allows you to do all that AND make the battery last - then maybe you should just use windows.

      He didn't say that Windows lets you do everything Linux can, he said Linux on his laptop can do just about everything Windows can. Linux can also do things Windows can't. :) And really you're missing the point. Many of us have no desire to run Windows or any proprietary operating system. So we want to get the most o

  • Use less power (Score:3, Informative)

    by redog ( 574983 ) on Tuesday March 09, 2004 @06:03PM (#8514306) Homepage Journal
    If you use and unload kernel modules, wireless NIC, sound card, hotplug, usb etc etc... your laptop should consume a bit less power, also look to see if your laptop supports processor frequency [mondoloni.free.fr] scaleing
    • Just a thought - spend more time at the command line and less time in the GUI. I think Hiro Protaganist pointed that one out about half way through Snow Crash as a way to get the most out of your laptop when you are not connected to the juice.

      My favorite line from that book : "I'm sure they'll listen to Reason..."
  • the usual... (Score:4, Informative)

    by ajagci ( 737734 ) on Tuesday March 09, 2004 @06:04PM (#8514313)
    Have the harddisk spin down (e.g., hdparm, noflushd), dim the screen, lower the processor speed (e.g., longrun). In general, it shouldn't take a lot of effort to get similar battery life using Windows and Linux.

    If you buy your machine from a vendor that supports and pre-installs Linux (e.g., emperorlinux.com), they probably will take care of the necessary configuration for you.

    • Re:the usual... (Score:3, Informative)

      by kevin lyda ( 4803 ) *
      noatime for your fs options would be good too.
    • Re:the usual... (Score:3, Interesting)

      by jovlinger ( 55075 )
      perhaps build a root ramdisk with the most commonly used apps? Then you could spin down and unmount your hd partitions. 'course you would lose your data if you unexpectedly kill the laptop.

      It may be the winmodem, or some other win-peripheral (sp?). IIRC, these load the batter a bit, and if they default to on, that would be a problem.
    • you should consider investing some money into
      more ram, cause avoiding the swapping all the time
      will surely help the disk to stay longer in spindowns.
      nowaday the kernel can cache most of the files you use
      so the bigger ram the bigger cache you will have the less
      power it needs to spin

      in our office we also noticed that the laptops coolers
      are spinning way to much e.g. trying to keep the machine
      as cold as possible, you can bring the temperature limits
      a bit up (ofcourse don't let the machine burn in hour hands :S

    • You need the "Laptop mode" kernel patch. Google for it. It batches writes to the HD, so if you combine that with some agressive hdparm stuff you can get the hd to spin down.

      My laptop can easily spin the HD down for long periods of time if I'm just web browsing (as someone else says, set the on-disk cache to 0KB)
  • Smller WM (Score:3, Interesting)

    by camelrider ( 46141 ) on Tuesday March 09, 2004 @06:05PM (#8514334)
    A WindowManager that uses less cup and graphics horsepower may help with your battery life. IceWM is available in many distros and you can run Gnome or KDE from within IceWM when you need to.
    • Yeah. When my battery was new (Toshiba Satellite laptop), I got about 2.5 hours in Windows XP but 3.1 hours in Linux with fluxbox. Even better when you're on a plane without a net connection and you can do all your work on a terminal instead of X.
  • Throttling Down? (Score:2, Interesting)

    by ABaumann ( 748617 )
    Well, your windows machine is probably throttling down the processor when you're unplugged. It's possible that your linux machine doesn't do that.
  • tpctl for thinkpads (Score:5, Informative)

    by doja ( 36500 ) on Tuesday March 09, 2004 @06:11PM (#8514408)
    Since you have a Thinkpad, you should download and install tpctl [sourceforge.net]. It comes with a daemon called apmiser that controls power use according to CPU usage.
    • by aparrish ( 36864 )
      Apmiser works really well on my X24. I usually get between three and four hours on a charge, as long as I don't "emerge" and compile any huge Gentoo source packages while it's unplugged.
  • Graphics card (Score:3, Interesting)

    by ballwall ( 629887 ) on Tuesday March 09, 2004 @06:13PM (#8514430)
    I've got a T40, probably the same graphics card as the poster (Mobility Radeon 7500) and I can't figure out how to enable the power saving features under Linux. I know when I'm in windows power saving the vid card gives me a huge longetivity boost life.

    Anyone know how to do that with Linux?
    • Re:Graphics card (Score:3, Informative)

      by PD ( 9577 )
      Those features are probably not supported. There are people working on them, but at best you'll have to compile your own copy of XFree86. I only know this because I spent a couple hours yesterday getting DRI to work on my T30. I read a lot of docs.
  • Turn Off Eye Candy (Score:3, Informative)

    by jmt9581 ( 554192 ) on Tuesday March 09, 2004 @06:15PM (#8514458) Homepage
    Definitely try turning off as much eye candy as possible with your WM, whether it's GNOME, KDE, or ratpoison [sourceforge.net].

    :)

    Visual and audio effects mean processing time, and CPU time uses battery power. Also look into unloading modules that you aren't using, especially wireless network-related modules.

    Alternatively, you could go the way of many /dotters and get a Mac. I'm a Unix geek who just got a used IBook and I love it.

    • Visual and audio effects mean processing time, and CPU time uses battery power.

      This is not always correct, it depends on what eye candy operations are implemented efficiently on your hardware. For example, suppose you turn on the nvidia cursor shadow extension. Does it take extra power? No, because the nvidia gpu trivially can compute it in hardware for 1/zillionth of a watt. Now suppose someone does write a non-nvidia X extension that emulates this inelegantly by doing lots of screen blits and softwa
      • Of course, that is all assuming that Linux will cool down the CPU when it's idle. Giving the amounts this guy is talking about (2 1/2 hours vs 1hour), that may very well be the problem.
    • Until the iBook hdd craps out on you and you go to replace it. 35 screws (or so) to get at the hard drive! There was one screw (with a wide enough slot to use a coin to remove the screw) for my ThinkPad 600X.

      I must admit, nothing beats OS X though. Too bad there is no x86 port of it...........
  • by Will2k_is_here ( 675262 ) on Tuesday March 09, 2004 @06:21PM (#8514537)
    Don't forget to decrease the brightness and contrast of your display. I found this can add an extra half an hour or so to your battery life.

    And, as was hinted at by others, take off anything that will cause your processor to do more work than you need. This means removing big GUI's, and use basic software (like anything but Gnome and KDE, Firefox instead of Mozilla Suite, Mutt instead of Evolution, etc.)
  • thinkpad utils (Score:5, Informative)

    by tellurian ( 90659 ) on Tuesday March 09, 2004 @06:28PM (#8514615)
    Go get these from Dag's site [wieers.com]:
    • kernel-module-thinkpad
    • tpctl
    • configure-thinkpad
  • HD sleep (Score:3, Informative)

    by trouser ( 149900 ) on Tuesday March 09, 2004 @06:32PM (#8514656) Journal
    Windows and Mac OS X will stop the HD after a period of inactivity. I've never got this working in Linux. The drive sleeps briefly before spinning up again. Maybe writing log messages or accessing the swap partition. Don't know. Anyway, that's probably a small part of the problem.
    • Re:HD sleep (Score:4, Informative)

      by jthj ( 556846 ) on Tuesday March 09, 2004 @06:52PM (#8514869)
      You could use a loger like metalog which caches writes to reduce the amount of hard drive use. Also setting the noatime option in fstab will reduce writes to do the disk when you are browsing directories. This will not help the fact that the drives always spinning though. To avoid that you would pretty much need to turn of logging which may not be a good idea. Anyway that's just my .02
  • by Snerdley ( 98439 ) on Tuesday March 09, 2004 @06:35PM (#8514685)

    There is the "Battery Powered Mini-HOWTO" up on the Linux Documentation Project site: http://www.tldp.org/HOWTO/Battery-Powered/index.ht ml [tldp.org]

    Of course, you probably looked there first before you asked Slashdot :)

    Seriously, read the section on syslogd(8). In addition to their suggestions, we have also setup a central log server which allows logging to only go over the network, and not to the local disk at all.

    If you are in a LAN (or wireless) environment, you might want to consider that although the wireless might cost you more powering the NIC than it would hitting the disk (after you disabled syncing).

    • Why not kill syslogd entirely? If you don't need it running, kill it. It's not a server, and unless you're experiencing failure of some sort; or some other loss of functionality why run syslogd on a notebook/portable. If nothing else, set your console to be /dev/ttyS0 and set your syslogd/klogd to output to the serial port. At least this way you could debug your machine if it started acting funny.

      I recommend reading up on some of the tricks that embedded people (like me) use. There are a ton of ways t
  • LiIon specs: Cell voltage: 3,6 V Energy / mass: 100 Wh/kg Energy / volume: 230 Wh/l max. Energy: 60 Wh Charge temp.: 0 to 45 C (30 to 115 F) Discharge temp.: -20 to 60 C (-5 to 140 F) Storage temp.: -20 to 60 C (-5 to 140 F) I suggest you give this a read [linuxdocs.org]. I agree with the other posters. When someone asks for help with something such as this, they aren't looking for something to replace what they already have. You may love Apple, he/she may not. Stick to the problem, and help solve it.
  • pcmcia (Score:3, Interesting)

    by nri ( 149893 ) on Tuesday March 09, 2004 @06:46PM (#8514809)
    service pcmcia stop
    service lpd stop
    hdparm -E 4 /dev/dvd
    hdparm -S 12 /dev/hdaX

  • Remember that most applications have no awareness of your desire to conserve battery life. In particular, disabling your web browser's disk cache will prevent your disk from spinning up and staying that way when you web surf. Think about what applications you're using, and how you can modify their behavior.
  • ACPI (Score:5, Informative)

    by Fluffy the Cat ( 29157 ) on Tuesday March 09, 2004 @07:04PM (#8514983) Homepage
    One of the single best things you can do is enable ACPI support, which enables higher levels of CPU power saving when idle. This gives me about half an hour of extra battery power, but suspend support is still somewhat flaky.
  • Lindows for Laptops (Score:2, Informative)

    by Anonymous Coward
    For no-brain hassle of running Linux on a notebook computer, why not try a distro that's designed specifically for mobile computers?

    Such as Lindows for Laptops [lindows.com].

    It has built-in power management features and can even be bought pre-installed on a number of machines.

    Disclaimer: I don't work for Lindows, I run Windows and I don't even have a notebook computer. But this is the one commercial mobile Linux solution that I've heard of.
  • Inverse results (Score:3, Interesting)

    I currently run Linux on my Dell Inspiron 8200 and get about 1 hour more battery runtime than in Windows XP or 2000. Stock, with OEM Windows XP I would peak at about 2.5 hours of battery time, as opposed to peak of 3 hours running Linux. I have since used the i8k-tools (obviously not for Thinkpad) to control things like temperature thresholds to trigger the fans. Not sure about your laptop, but mine has 2 fans, so spinning those down if possible saves a lot of battery time. With the fans running at about 5k RPM as opposed to 9K RPM (full speed) I easily save 45 minutes, making my top peak with Linux damn near 4 hours. Your best bet to save battery life would have to be to find some thinkpad-specific software to slow the fans down and speed up at given temperatures. (not sure if that tpctl can do that or not)
    • by Andy Dodd ( 701 ) <atd7NO@SPAMcornell.edu> on Wednesday March 10, 2004 @12:20AM (#8517838) Homepage
      Given that the default fan thresholds of the 8200 are VERY aggressive w.r.t. power management (i.e. they run the CPU *damn hot* and you should NOT be slowing down the fans compared to the BIOS defaults), I don't think this is the reason for your long battery life with the 8200.

      But I can confirm that my battery life with my I8200 is comparable to, if not better than, under Windows.

      Power management features I use:

      cpufreq (Both speedstep-ich and p4-clockmod as modules - Load speedstep-ich, set the "powersave" governor to step down the voltage/speed, then load p4-clockmod to drop the clock speed even more. I've been running my P4-M 1.7 at 600 MHz lately, it's more than responsive enough for AIM and web browsing.)

      nvclock (Does not support mobile chipsets out of the box, but I disabled the code that causes nvclock to not touch mobile chipsets and it works fine on my GeForce 4 Go 440. I'm assuming the devs of nvclock disabled this because it's an overclocking tool and overclocking mobile GPUs is a bad idea, they forgot that mobile users might actually want to UNDERCLOCK their GPUs...)

      Get LOTS of memory. Enough to allow you to disable swap. If you have swap enabled, it seems that even with an idle machine, it'll page stuff in/out just enough to FUBAR any attempts to make the HD sleep.
  • buy more ram (Score:2, Interesting)

    by Anonymous Coward
    Hard drive usage eats battery faster than your CPU by far. Max out your RAM and use something like noflushd to minimize the number of times your hard drive has to spin up. Those are the easiest ways to increase battery life.
  • APCI or APM? (Score:2, Informative)

    by ErisCalmsme ( 212887 )
    You might want to be sure that you have the right power mangament features enabled in your kernel. I had to enable all of the the APCI features myself. You can use dmesg|less to see if your kernel is actually finding the power management feautures that you enabled. But maybe you knew that;) In any event you would see stuff like this:
    ACPI: Battery Slot [BAT0] (battery present)
    ACPI: Battery Slot [BAT1] (battery absent)
    ACPI: Lid Switch [LID]
    ACPI: Power Button (CM) [PBTN]
    ACPI: Sleep Button (CM) [SBTN]
    ACPI: Proc
  • Taking a wild guess here, but could the reason you don't get the same battery life out of Linux be due to you using more applications concurrently in Linux that in Windoze? It sounds like you have quite a setup on the Linux partition - do you have the same number of programs on the Windows partition that you regularly run?

    Let's compare apples to apples. Mine's bigger. MUWAHAHAHA!

"Ninety percent of baseball is half mental." -- Yogi Berra

Working...