Skip to content
Ritesh Raj Sarraf edited this page Jul 28, 2017 · 13 revisions

1. Things You Might Want To Know

Mailing list

There is a laptop-mode mailing list here, on which you are free to discuss anything related to laptop mode, laptop mode tools, and power saving in general. Mailing list archives are also available. There is also a pretty good wiki page maintained by Arch Wiki.

Laptop Mode Tools and Systemd

Laptop Mode Tools is well integrated into systemd init service. Laptop Mode Tools provides a main service file: laptop-mode.service This is the main service file to start/stop the Laptop Mode Tools service.

Laptop Mode Tools also provides 2 additional service/time units for special use cases. laptop-mode.timer and lmt-poll.service can be used for periodic wakeup and polling.

My USB Mouse / Keyboard stops working after seconds of inactivity

Many devices advertise power savings but misbehave when power savings is triggered. Laptop Mode Tools, by default, enables power savings for all devices.

In newer version of Laptop Mode Tools (1.69 and above), we have revised the default list of blacklisted devices. USB Mice, USB Keyboards and USB Storage are obvious device types.

If you have devices, that mis-behave when running on battery, you can blacklist them.

For details on blacklisting the device, please refer to the configuration details in /etc/laptop-mode/conf.d/runtime-pm.conf

PowerTop reports some power savings

There are some features, for which, powertop misreports them as possible power savings. One such example is in this Bug Report But there may be some power saving features that are not yet covered by Laptop Mode Tools. If you find a generic power saving feature you would like to see in Laptop Mode Tools, please file a bug report or raise a pull request.

Spinning down too many times may kill hard drives

Desktop hard drives (Magnetic Rotational Drives) are usually rated for only 40,000-50,000 spinups, and one spinup every 10 minutes will kill your 40,000-spinup HD in 277 days. So this is NOT recommended for server use, unless you increase the spinup interval dramatically, to say once every hour or two. Laptop hard drives are usually rated for around 300,000 spinups, so those will last about 2083 days or 6 years if you have them powered on 24-7.

Note: With newer SSD Drives (Flash Storage/MTD), the above mentioned problem does not apply.

I have a solid-state disk (SSD) in my machine. Should I enable any of the disk-related parts of laptop-mode-tools, or are they irrelevant?

They may be relevant, because (a) laptop mode will reduce the number of writes, which improves the lifetime of an SSD, and (b) laptop mode makes writes bursty, which enables power saving mechanisms like ALPM to kick in. However, your mileage may vary depending on the specific hardware involved. For some hardware you will get no gain at all, for some the gain may be substantial.

If my machine crashes or runs out of power, will I lose all my work?

If you have laptop mode enabled and your machine crashes, then you will lose up to MAX_LOST_WORK_SECONDS seconds of work. If you really need to have something written to disk, issue the "sync" command. If you have laptop mode enabled and your machine runs out of power, you will not lose as much work (provided you have an ACPI laptop, as most current PC laptops are) because laptop mode is automatically disabled when the battery almost runs out.

Does Laptop Mode Tools work after resume from suspend

Yes. Laptop Mode Tools has independently supported working even in scenarios of resume from suspend since around version 1.60 and above. On older version, it relied on other tools to help invoke after a resume. Today, Laptop Mode Tools works, both, on systems with systemd and SystemV Init.

A resume from suspend workflow is where user suspends while on Battery and resumes when back on AC, or vice versa.

Linux Journal article

There's an article in the Linux Journal September 2004 issue. It can be found online at http://www.linuxjournal.com/article/7539. It's not really up-to-date anymore BTW. The most important conclusion from the article is that it doesn't really pay to increase the spun-down time over a minute. I often get mails in which people tell me that they want to go up to one hour or more without disk activity. This is nice for noise reduction purposes, but not for saving power.

FOSDEM 2006 presentation

I did a talk on power saving, Laptop Mode and the Laptop Mode Tools at FOSDEM 2006. A pdf version of the presentation can be downloaded here.

2. Relationship with Other Packages

What does all this have to do with Smart Spindown?

Nothing really. You use Smart Spindown if your hard drive can't spin down by itself, or if you're irritated by repeated spindown attempts while you're actually actively using the computer and don't want spindowns at all. It's not well-integrated with Laptop Mode Tools and it isn't maintained at the moment, so I'd advise against using it. :)

What is the relationship between Laptop Mode Tools and the script in the kernel documentation?

Laptop Mode Tools is a fork of the script in the kernel documentation. The script in the kernel documentation is currently pretty much unmaintained AFAIK, so I don't recommend using it.

What is the relationship between the Ubuntu package "laptop-mode" and the Debian package "laptop-mode-tools"?

There is a big thread about this on ubuntuforums, http://ubuntuforums.org/showthread.php?t=36976. Ubuntu used to have a rather outdated package for controlling laptop mode, based on the aforementioned kernel documentation script. Laptop mode tools basically is a much more recent version of the same code. Ubuntu has switched to laptop-mode-tools somewhere in 2006.

How does Laptop Mode Tools relate to noflushd?

It doesn't. Don't install both together. Noflushd does the same thing for your disks as laptop mode tools if you don't run a journaling filesystem such as ext3, ReiserFS or XFS. If you do, Laptop Mode Tools is currently your only option.

3. Is Laptop Mode Enabled?

How do I check if laptop mode is enabled?

Execute cat /proc/sys/vm/laptop_mode. If it contains a nonzero value, then laptop mode is enabled, if it says 0, then it isn't.

What's /var/run/laptop-mode-enabled got to do with things?

Well, this file is created and destroyed by the laptop-mode init script to enable/disable laptop mode activity. If this file is not present, then laptop mode tools will not do a thing except disable itself, even when you unplug your computer from the mains.

And what about /etc/default/laptop-mode?

That's only supported for backward compatibility with the old Ubuntu laptop-mode package. It contains a setting using which you can enable or disable laptop mode entirely.

4. Configuration Questions / Issues

Can I run Laptop Mode Tools on a Desktop machine?

Yes. Laptop Mode Tools is a generic power savings tool for Linux. It picked the name Laptop Mode Tools because power savings is more obvious on laptops. But there are many users that run Laptop Mode Tools on Desktops, Headless Jukeboxes, and even Servers.

Can I force laptop mode on/off?

To completely disabled laptop-mode-tools, you can set it to 0 in /etc/laptop-mode/laptop-mode.conf

###############################################################################
# Enable/Disable laptop-mode-tools execution
# ------------------------------------------
# Set it to 0 to completely disable laptop-mode-tools from running
###############################################################################
#
ENABLE_LAPTOP_MODE_TOOLS=1