''[http://samwel.tk/laptop_mode/ Laptop Mode Tools] is a laptop power saving package for Linux systems. It is the primary way to enable the Laptop Mode feature of the Linux kernel, which lets your hard drive spin down. In addition, it allows you to tweak a number of other power-related settings using a simple configuration file.''

The Linux kernel, starting from version 2.6.6, contains a feature called ''laptop mode''. This feature is also present in the Linux 2.4 series starting from version 2.4.23. When enabled, the kernel allows the hard drive to spin down more often, resulting in significant power savings. Laptop Mode Tools (LMT) evolved from a simple program that controlled the hard drives to a centralized power saving solution providing a wide selection of options and can perform a number of varying power saving functions across separate subsystems simultaneously. Combined with [[acpid]], [[CPU Frequency Scaling|CPU frequency scaling]], and [[pm-utils]], LMT provides most users with a complete notebook power management suite.

−

<!--

−

=== Relationship to ACPID ===

−

=== Relationship to cpufrequtils ===

−

=== Relationship to pm-utils ===

−

-->

−

==Installation==

{{Pkg|laptop-mode-tools}} can be [[pacman|installed]] from the [[Official Repositories|official repositories]].

{{Pkg|laptop-mode-tools}} can be [[pacman|installed]] from the [[Official Repositories|official repositories]].

−

==Configuration==

+

== Configuration ==

−

Add {{Ic|laptop-mode}} to the {{Ic|DAEMONS}} array in {{Filename|/etc/rc.conf}}:

Each module can be explicitly enabled/disabled by changing the {{ic|CONTROL_*}} value in the individual settings file found in {{ic|conf.d/*}}.

+

+

If {{ic|ENABLE_AUTO_MODULES}} is set in {{ic|/etc/laptop-mode/laptop-mode.conf}}, LMT will automatically enable any modules where {{ic|CONTROL_*}} is set to {{ic|auto}}.

+

+

If you want to check which modules are enabled, disabled or auto, run:

+

+

$ grep -r '^\(CONTROL\&#124;ENABLE\)_' /etc/laptop-mode/conf.d

+

+

{{Note|{{ic|auto-hibernate.conf}} and {{ic|battery-level-polling.conf}} are an exception and use an {{ic|ENABLE_*}} variable instead of {{ic|CONTROL_*}}.}}

−

Configuration is handled through the primary configuration file {{Filename|/etc/laptop-mode/laptop-mode.conf}} and through the configuration of dozens of feature-specific files in {{Filename|/etc/laptop-mode/conf.d/*}}. Recent versions of LMT are able to automatically enable commonly used {{Filename|conf.d/*}} settings by way of the {{Ic|ENABLE_AUTO_MODULES}} variable in {{Filename|/etc/laptop-mode/laptop-mode.conf}}.

+

=== Hard disks ===

−

===Disks===

−

====Hard disks====

For this you need to have hdparm and/or sdparm installed. See [[Hdparm]].

For this you need to have hdparm and/or sdparm installed. See [[Hdparm]].

−

Spinning down the hard drive through {{Ic|hdparm -S}} values saves power and makes everything a lot more quiet. By using the readahead function you can allow the drives to spin down more often even though you are using the computer. LMT can also establish {{Ic|hdparm -B}} values. The maximum hard drive power saving is 1 and the minimum is 254. Set this value to 254 when on AC and 1 when on battery. If you find that normal activity hangs often while waiting for the disk to spin up, it might be a good idea to set it to a higher value (eg. 128) which will make it spin down less often. {{Ic|hdparm -S}} and {{Ic|hdparm -B}} values are configured in {{Filename|/etc/laptop-mode/laptop-mode.conf}}.

+

Spinning down the hard drive through {{Ic|hdparm -S}} values saves power and makes everything a lot more quiet. By using the readahead function you can allow the drives to spin down more often even though you are using the computer. LMT can also establish {{Ic|hdparm -B}} values. The maximum hard drive power saving is 1 and the minimum is 254. Set this value to 254 when on AC and 1 when on battery. If you find that normal activity hangs often while waiting for the disk to spin up, it might be a good idea to set it to a higher value (eg. 128) which will make it spin down less often. {{Ic|hdparm -S}} and {{Ic|hdparm -B}} values are configured in {{ic|/etc/laptop-mode/laptop-mode.conf}}.

+

+

{{expansion|reason=Please can someone add info on how to treat SSD disks with laptommode-tools? As, to my knowledge, readahead is useless for them (zero read time, just does wear out), and spin down most likely as well. }}

With the CONTROL_MOUNT_OPTIONS variable (default on), laptop-mode-tools automatically remounts your partitions, appending 'commit=600,noatime' in the mount options. This keeps the journaling program jbd2 from accessing your disc every few seconds, instead the disc journal gets updated every 10 minutes (BEWARE: with this setting you could lose up to 10 minutes of work). Also be sure not to use the {{Ic|atime}} mount option, use {{Ic|noatime}} or {{Ic|relatime}} instead.

With the CONTROL_MOUNT_OPTIONS variable (default on), laptop-mode-tools automatically remounts your partitions, appending 'commit=600,noatime' in the mount options. This keeps the journaling program jbd2 from accessing your disc every few seconds, instead the disc journal gets updated every 10 minutes (BEWARE: with this setting you could lose up to 10 minutes of work). Also be sure not to use the {{Ic|atime}} mount option, use {{Ic|noatime}} or {{Ic|relatime}} instead.

Line 46:

Line 61:

{{Note|1=CONTROL_MOUNT_OPTIONS should not be turned on with nilfs2 partitions (see this thread on the forum https://bbs.archlinux.org/viewtopic.php?id=134656)}}

{{Note|1=CONTROL_MOUNT_OPTIONS should not be turned on with nilfs2 partitions (see this thread on the forum https://bbs.archlinux.org/viewtopic.php?id=134656)}}

−

===Processor===

+

=== CPU frequency ===

−

====CPU frequency====

+

For this you need to have a CPU frequency driver installed. See [[CPU Frequency Scaling]].

For this you need to have a CPU frequency driver installed. See [[CPU Frequency Scaling]].

Line 68:

Line 83:

CONTROL_CPU_THROTTLING=0

CONTROL_CPU_THROTTLING=0

−

* See [[CPU Frequency Scaling]] for details on how to setup the needed kernel modules.

+

=== Device and bus ===

+

+

==== Intel SATA ====

−

===Device and bus===

−

====Intel SATA====

* Enable the Intel SATA AHCI controller Aggressive Link Power Management feature to set the disk link into a very low power mode in the absence of disk IO.

* Enable the Intel SATA AHCI controller Aggressive Link Power Management feature to set the disk link into a very low power mode in the absence of disk IO.

{{Note|Review the well-documented {{ic|/etc/laptop-mode/conf.d/usb-autosuspend.conf}} file for additional configuration details. If you have an USB tool you always use (like an USB mouse), blacklisting them would stop them from suspending.}}

+

+

=== Display and graphics ===

+

+

==== LCD brightness ====

+

+

* Available brightness values for certain laptops can be obtained by running following command:

−

===Display and graphics===

−

====LCD brightness====

−

* Available brightness values for certain laptops can can be obtained by running following two commands:

$ cat /proc/acpi/video/VID/LCD/brightness

$ cat /proc/acpi/video/VID/LCD/brightness

−

For [http://en.wikipedia.org/wiki/ThinkPad ThinkPad] notebooks, minimum brightness values can be obtained by running one of the following two commands:

+

===== ThinkPad T40/T42 =====

−

$ cat /sys/class/backlight/acpi_video0/brightness

−

$ cat /sys/class/backlight/thinkpad_screen/brightness

+

For [http://en.wikipedia.org/wiki/ThinkPad ThinkPad] T40/T42 notebooks, minimum and maximum brightness values can be obtained by running:

−

* For [http://en.wikipedia.org/wiki/ThinkPad ThinkPad] notebooks, maximum brightness values can be obtained by running one of the following two commands:

+

$ cat /sys/class/backlight/acpi_video0/brightness

$ cat /sys/class/backlight/acpi_video0/max_brightness

$ cat /sys/class/backlight/acpi_video0/max_brightness

−

−

$ cat /sys/class/backlight/thinkpad_screen/max_brightness

# lcd-brightness.conf

# lcd-brightness.conf

Line 121:

Line 138:

NOLM_AC_BRIGHTNESS_COMMAND="echo 7"

NOLM_AC_BRIGHTNESS_COMMAND="echo 7"

BRIGHTNESS_OUTPUT="/sys/class/backlight/thinkpad_screen/brightness"

BRIGHTNESS_OUTPUT="/sys/class/backlight/thinkpad_screen/brightness"

+

+

===== ThinkPad T60 =====

+

+

* For [http://en.wikipedia.org/wiki/ThinkPad ThinkPad] T60 notebooks, minimum and maximum brightness values can be obtained by running:

Wireless interface power management settings are hardware-dependent, and thus a bit trickier to configure. Depending on the wireless chipset, the settings are managed in one of the following three files:

Wireless interface power management settings are hardware-dependent, and thus a bit trickier to configure. Depending on the wireless chipset, the settings are managed in one of the following three files:

−

#{{Filename|/etc/laptop-mode/conf.d/wireless-power.conf}} for a generic method of saving power (using "iwconfig wlan0 power on/off"). This applies to most chipsets (that is, anything but Intel chipsets listed below).

+

#{{ic|/etc/laptop-mode/conf.d/wireless-power.conf}} for a generic method of saving power (using "iwconfig wlan0 power on/off"). This applies to most chipsets (that is, anything but Intel chipsets listed below).

−

#{{Filename|/etc/laptop-mode/conf.d/wireless-ipw-power.conf}} for Intel chipsets driven by the old ipw driver. This apply to IPW3945, IPW2200 and IPW2100. It currently (as of LMT 1.55-1) uses iwpriv for IPW3945, and a combination of iwconfig and iwpriv settings for IPW2100 and IPW220. See {{Filename|/usr/share/laptop-mode-tools/modules/wireless-ipw-power}} for details. (note that the ipw3945 is not used anymore, see below)

+

#{{ic|/etc/laptop-mode/conf.d/wireless-ipw-power.conf}} for Intel chipsets driven by the old ipw driver. This apply to IPW3945, IPW2200 and IPW2100. It currently (as of LMT 1.55-1) uses iwpriv for IPW3945, and a combination of iwconfig and iwpriv settings for IPW2100 and IPW220. See {{ic|/usr/share/laptop-mode-tools/modules/wireless-ipw-power}} for details. (note that the ipw3945 is not used anymore, see below)

Note that activating the three of them should not be much of a problem, since LMT detects the module used by the interface and acts accordingly.

Note that activating the three of them should not be much of a problem, since LMT detects the module used by the interface and acts accordingly.

The supported modules for each configuration file, indicated above, are taken directly from LMT. However, this seems to be a bit out-of-date, since the current 2.6.34 kernel does not provide the ipw3945 and iwl4965 modules anymore (3945 chipset uses iwl3945 instead, and 4965 uses the generic module iwlagn). This is only brought here for information, as this does not (or should not) affect the way LMT works.

The supported modules for each configuration file, indicated above, are taken directly from LMT. However, this seems to be a bit out-of-date, since the current 2.6.34 kernel does not provide the ipw3945 and iwl4965 modules anymore (3945 chipset uses iwl3945 instead, and 4965 uses the generic module iwlagn). This is only brought here for information, as this does not (or should not) affect the way LMT works.

−

There is a known issue with some chipsets running with the iwlagn module (namely, the 5300 chipset, and maybe others). On those chipsets, the following settings of {{Filename|/etc/laptop-mode/conf.d/wireless-iwl-power.conf}} :

+

There is a known issue with some chipsets running with the iwlagn module (namely, the 5300 chipset, and maybe others). On those chipsets, the following settings of {{ic|/etc/laptop-mode/conf.d/wireless-iwl-power.conf}}:

+

IWL_AC_POWER

IWL_AC_POWER

IWL_BATT_POWER

IWL_BATT_POWER

−

are ignored, because the {{Filename|/sys/class/net/wlan*/device/power_level}} file does not exist. Instead, the standard method (with "iwconfig wlan0 power on/off") is automatically used.

−

===Audio===

+

are ignored, because the {{ic|/sys/class/net/wlan*/device/power_level}} file does not exist. Instead, the standard method (with "iwconfig wlan0 power on/off") is automatically used.

−

====AC97====

+

+

=== Audio ===

+

+

==== AC97 ====

# ac97-powersave.conf

# ac97-powersave.conf

Line 187:

Line 217:

CONTROL_AC97_POWER=1

CONTROL_AC97_POWER=1

−

====Intel HDA====

+

==== Intel HDA ====

# intel-hda-powersave.conf

# intel-hda-powersave.conf

Line 200:

Line 230:

INTEL_HDA_DEVICE_CONTROLLER=0

INTEL_HDA_DEVICE_CONTROLLER=0

−

==Tips and tricks==

+

== Tips and tricks ==

−

===Aliases===

+

−

===lm-profiler===

+

=== Aliases ===

−

===Disabling===

+

+

=== lm-profiler ===

+

+

=== Disabling ===

+

+

== Troubleshooting ==

−

==Troubleshooting==

+

=== Laptop-mode-tools is not picking up events ===

−

===Laptop-mode-tools is not picking up events===

+

−

You need to install and enable [[acpid]]. Add {{Ic|acpid}} to your DAEMONS list in {{filename|/etc/rc.conf}}:

+

You need to install and enable [[acpid]]. Enable the {{Ic|acpid}} systemd service with:

−

DAEMONS=(... acpid ...)

+

+

# systemctl enable acpid.service

If that does not help, go through the laptop-mode configuration files and make sure that the service you want to enable is set to 1. Many services (including cpufreq control) are by default set to "auto", which may not enable them.

If that does not help, go through the laptop-mode configuration files and make sure that the service you want to enable is set to 1. Many services (including cpufreq control) are by default set to "auto", which may not enable them.

Line 214:

Line 250:

I have experienced issues with bluetooth not working if i boot up with battery, and i fixed it with disabling runtime-pm.

I have experienced issues with bluetooth not working if i boot up with battery, and i fixed it with disabling runtime-pm.

−

===Laptop-mode-tools does not disable on AC===

+

=== Laptop-mode-tools does not disable on AC ===

−

It is possible if you have both laptop-mode-tools and pm-utils installed, they can conflict with each other, causing laptop-mode to not properly set its state.

+

+

It is possible if you have both laptop-mode-tools and pm-utils installed, they can conflict with each other, causing laptop-mode-tools to not properly set its state.

+

+

This can be fixed by disabling scripts with duplicate functionality in pm-utils. The main cause of this particular issue is the laptop-mode script located in {{ic|/usr/lib/pm-utils/power.d}}. You can stop any unwanted hooks from running by creating a dummy file in {{ic|/etc/pm/power.d}} with the same name as the corresponding {{ic|/usr/lib/pm-utils/power.d}} hook. For example if you want to disable the laptop-mode hook:

−

This can be fixed by disabling scripts with duplicate functionality in pm-utils. The main cause of this is the laptop-mode script located in /usr/lib/pm-utils/power.d. The script can be blacklisted by creating a file in /etc/pm/config.d as follows:

+

# touch /etc/pm/power.d/laptop-mode

−

HOOK_BLACKLIST="laptop-mode"

+

{{Note|Do not set the executable bit on that dummy-hook.}}

−

You can also add any other scripts found in /usr/lib/pm-utils/power.d to this list to disable them. I recommend going through and disabling any hook that has equivalent functionality in LMT.

+

Its recommended to disable any hook that has equivalent functionality in LMT.

Laptop Mode Tools is a laptop power saving package for Linux systems. It is the primary way to enable the Laptop Mode feature of the Linux kernel, which lets your hard drive spin down. In addition, it allows you to tweak a number of other power-related settings using a simple configuration file.

Hard disks

Spinning down the hard drive through hdparm -S values saves power and makes everything a lot more quiet. By using the readahead function you can allow the drives to spin down more often even though you are using the computer. LMT can also establish hdparm -B values. The maximum hard drive power saving is 1 and the minimum is 254. Set this value to 254 when on AC and 1 when on battery. If you find that normal activity hangs often while waiting for the disk to spin up, it might be a good idea to set it to a higher value (eg. 128) which will make it spin down less often. hdparm -S and hdparm -B values are configured in /etc/laptop-mode/laptop-mode.conf.

This article or section needs expansion.

Reason: Please can someone add info on how to treat SSD disks with laptommode-tools? As, to my knowledge, readahead is useless for them (zero read time, just does wear out), and spin down most likely as well. (Discuss in Talk:Laptop Mode Tools#)

With the CONTROL_MOUNT_OPTIONS variable (default on), laptop-mode-tools automatically remounts your partitions, appending 'commit=600,noatime' in the mount options. This keeps the journaling program jbd2 from accessing your disc every few seconds, instead the disc journal gets updated every 10 minutes (BEWARE: with this setting you could lose up to 10 minutes of work). Also be sure not to use the atime mount option, use noatime or relatime instead.

USB autosuspend

Note: Review the well-documented /etc/laptop-mode/conf.d/usb-autosuspend.conf file for additional configuration details. If you have an USB tool you always use (like an USB mouse), blacklisting them would stop them from suspending.

Display and graphics

LCD brightness

Available brightness values for certain laptops can be obtained by running following command:

$ cat /proc/acpi/video/VID/LCD/brightness

ThinkPad T40/T42

For ThinkPad T40/T42 notebooks, minimum and maximum brightness values can be obtained by running:

Wireless LAN

Wireless interface power management settings are hardware-dependent, and thus a bit trickier to configure. Depending on the wireless chipset, the settings are managed in one of the following three files:

/etc/laptop-mode/conf.d/wireless-power.conf for a generic method of saving power (using "iwconfig wlan0 power on/off"). This applies to most chipsets (that is, anything but Intel chipsets listed below).

/etc/laptop-mode/conf.d/wireless-ipw-power.conf for Intel chipsets driven by the old ipw driver. This apply to IPW3945, IPW2200 and IPW2100. It currently (as of LMT 1.55-1) uses iwpriv for IPW3945, and a combination of iwconfig and iwpriv settings for IPW2100 and IPW220. See /usr/share/laptop-mode-tools/modules/wireless-ipw-power for details. (note that the ipw3945 is not used anymore, see below)

Note that activating the three of them should not be much of a problem, since LMT detects the module used by the interface and acts accordingly.

The supported modules for each configuration file, indicated above, are taken directly from LMT. However, this seems to be a bit out-of-date, since the current 2.6.34 kernel does not provide the ipw3945 and iwl4965 modules anymore (3945 chipset uses iwl3945 instead, and 4965 uses the generic module iwlagn). This is only brought here for information, as this does not (or should not) affect the way LMT works.

There is a known issue with some chipsets running with the iwlagn module (namely, the 5300 chipset, and maybe others). On those chipsets, the following settings of /etc/laptop-mode/conf.d/wireless-iwl-power.conf:

IWL_AC_POWER
IWL_BATT_POWER

are ignored, because the /sys/class/net/wlan*/device/power_level file does not exist. Instead, the standard method (with "iwconfig wlan0 power on/off") is automatically used.

Tips and tricks

Aliases

lm-profiler

Disabling

Troubleshooting

Laptop-mode-tools is not picking up events

You need to install and enable acpid. Enable the acpid systemd service with:

# systemctl enable acpid.service

If that does not help, go through the laptop-mode configuration files and make sure that the service you want to enable is set to 1. Many services (including cpufreq control) are by default set to "auto", which may not enable them.

I have experienced issues with bluetooth not working if i boot up with battery, and i fixed it with disabling runtime-pm.

Laptop-mode-tools does not disable on AC

It is possible if you have both laptop-mode-tools and pm-utils installed, they can conflict with each other, causing laptop-mode-tools to not properly set its state.

This can be fixed by disabling scripts with duplicate functionality in pm-utils. The main cause of this particular issue is the laptop-mode script located in /usr/lib/pm-utils/power.d. You can stop any unwanted hooks from running by creating a dummy file in /etc/pm/power.d with the same name as the corresponding /usr/lib/pm-utils/power.d hook. For example if you want to disable the laptop-mode hook:

# touch /etc/pm/power.d/laptop-mode

Note: Do not set the executable bit on that dummy-hook.

Its recommended to disable any hook that has equivalent functionality in LMT.