Getting Better Battery Life w/ Linux?
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?
"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.
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 scaleing
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.
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.
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.
Since you have a Thinkpad, you should download and install tpctl. It comes with a daemon called apmiser that controls power use according to CPU usage.
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?
:)
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.
My blog
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.)
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.
Now wash your hands.
There is the "Battery Powered Mini-HOWTO" up on the Linux Documentation Project site: http://www.tldp.org/HOWTO/Battery-Powered/index.ht ml
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).
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. 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.
service pcmcia stop /dev/dvd /dev/hdaX
service lpd stop
hdparm -E 4
hdparm -S 12
if
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.
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.
The topic of this post is "how do I get better battery life in Linux."
Grandparent post -- Run Windows. Got modded down to 0 and rightfully so.
Parent post -- Run OS X. Modded up to +4 interesting?
I know you love Steve Jobs, but come on.. The parent is offtopic.
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.
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.
I run Debian on an iBook, and I find that I get about an hour more with Linux than with OS X. Nothing special, just pmud, noflushd, and I put the hard drive to sleep after 5 or 10 seconds depending on usage.
:-)
but then again, that's just me
OS X is not UNIX. It may be UNIX-like, but it is not UNIX. The OP claimed equality that OS X is UNIX, which is not true. Your assertion that Unix is a marketing brand (UNIX) and not a design philosophy (Unix) is, for all practical purposes, crap.
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)
while true ; do echo this is my sig; done
I run Linux on an iBook and get 30min longer battery life than in MacOSX. 4.5 hours battery life in Linux while using wireless and compiling XFree form source.... 6 hours w/o wireless and dimmed screen.
If you dont need 3D acceleration for your video then dont use 3D drivers and your battery life will greatly increase.
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.
The people who own the trademark did (and do, unfortunately), and OS X has failed to be approved by the Open Group, so it is not technically UNIX. FreeBSD, OpenBSD, NetBSD, and any distribution of Linux are not approved either, so they are not technically UNIX. Of course, you're just trolling, so what the fuck does it matter to you?
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: Processor [CPU0] (supports C1 C2 C3, 8 throttling states)
Alas, my laptop is plugged in 90% of the time and I havent used windows on it for more than the time it took to make a debian cd (which I used to build LFS) so I never had time to notice the difference
Good luck!
Chaos is Divine *
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.
retrorocket.o not found, launch anyway?
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!
noatime is almost always the right answer.
It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
or... he could get a Mac.
He's got a point. The PowerBook G3 (Pismo/Lombard) that came out in 1999, could go 5 hours on a single battery. A friend of mine had one, and I thought my 2.5 hour battery life of my Dell laptop was good at the time.
Dual batteries, 10 hours of use out in the wild.
Until someone writes better power management features into Linux, short battery life is a fact. I don't understand OS software coding well enough to comment intelligently on how to make Linux more efficient, but I do know that there are various hardware fixes you can make. You can get 3rd party batteries that have longer life than the original, or you could get heavier batteries that last longer. Until Linux is more efficient, increasing power (and weight) of your laptop is the only solution I can think of.
I have linux and ACPI seems to work pretty well. The largest things are:
1. The screen. Blank it if possible (edit XF86Config-4) and use the darkest setting you can see with. Redundant, I know. But pay attention and actually do it.
2. The wireless. The radio sucks up a lot of power. If you are not using the web, turn off the card. (You can use the tx setting for your card to put it into a sleep state.)
3. The hard drive. Use hdparm to shut it down if no one is using it.
4. Suspend. Doesn't work on the Latitude D800 yet in KDE. But quit KDE (set session manager to save your settings) and then suspend/hibernate.
5. Enable Throttle. You have to enable this in the BIOS as well as the kernel. Don't forget to enable the modules you need for your particular laptop and chip/chipset.
6. Enable auto-throttle. Throttling by itself is useless because you won't do it manually. You have to automate it. Download and compile auto-throttle and start it up on boot. The Pentium-M has eight modes, I believe, and autothrottle moves it up and down really nicely. No lag at all. It must have something to do with the pre-emptible kernel in 2.6.3.
7. Don't blast music. This takes up a surprising amount of power.
8. In windows, don't set stuff like anti-viruses and disk defragmenters to automatically start. This isn't really good for your battery life if it starts up.
9. Don't compile programs while on battery. (Duh, right? Stupid me.)
I get 3:15 hours of battery life on a D800 with the screen on the brightest setting and the internet. Under Linux! Battery life isn't just for windows, you know? Just word processing and web browsing. Cool, huh?
A NYC lawyer blogs. http://www.chuangblog.com/