How do I make Powertop's suggestions permanent?
Powertop is not a permanent tool, as you know, so you will have to setup your system to run the commands through sysctl, udev, systemd units, scripts, whatever...
In order to see what commands are used by powertop you will have to run powertop --html
BEFORE MAKING ANY CHANGES, that is, BEFORE toggling the settings from Bad to Good. If you already tuned for maximum battery life, undo your changes and run powertop --html
again.
This is what the output should look like:
Related videos on Youtube
mattdm
I've been using Linux and Unix professionally since 1995, mostly in Linux-related sysadmin/systems architect jobs supporting academia. I generally know my stuff, but am very happy to learn something new and to be corrected when I'm wrong. Currently, I am the Fedora Project Leader.
Updated on September 18, 2022Comments
-
mattdm over 1 year
When I run Powertop, and look at the Tunables screen, about twenty things are listed as Bad. I can toggle these to Good by pressing enter, and when I do so, projected battery lifetime doubles.
How can I make these changes persist? (I'm on Fedora 18, by the way, with Powertop 2.2)
-
mattdm about 11 yearsI have no
/etc/rc.conf
. Also, powertop doesn't seem to be suggesting any commands to run. (I think it did that in an older version.) -
schaiba about 11 yearsCreate it if it isn't there. Use powertop --html and open the resulting file, going to the section called 'Software Settings in need of Tuning'
-
mattdm about 11 yearsIf I create that file, I'm quite sure it will do nothing on my system. And the html output has no section by that name. There is Optimal Tuned Software Settings, but that just lists items like "Enable SATA link power Managmenet for host0", with no commands.
-
schaiba about 11 yearsMy bad, that was meant to be rc.local. Fedora has , IIRC, a systemd unit file that will run that.
-
mattdm about 11 yearsThanks, yeah, that would work. However, the key problem still stands:
powertop --html
(or anything else I can see) still doesn't tell me any actual commands. I assume they're mostly kernel tunables, so they really should go in/etc/sysctl.conf
or under/etc/sysctl.d/
, but I'm not sure what should be set (or to what values). -
schaiba about 11 yearsI'm not on Fedora, I'm on Arch, and not only I have that section, but I do have the suggested commands. Perhaps anyone using Fedora could help further.
-
mattdm about 11 yearsAH! The part in all caps is exactly what I was missing.
-
mattdm about 11 yearsExcitingly, some of the advice appears to be backwards. For example, it says
iw dev wlan0 set power_save off
, but turning it on is what changes the setting to "Good". -
yorkshiredev over 10 yearsAdding some information as I came accross this question : Arch initscripts are handled by
systemd
, see the wiki for more details : wiki.archlinux.org/index.php/Initscripts -
Peng over 5 yearsThere may be particular settings e.g. USB device sleep that you might want to disable from auto-tuning. It'd be nice to have a way to do that.