About Laptop Mode

Introduction

Laptop mode is a kernel "mode" that allows you to extend the battery life of your laptop. It does this by making disk write activity "bursty", so that only reads of uncached data result in a disk spinup. It causes a significant improvement in battery life (for usage patterns that allow it).

The initial version, written by Jens Axboe, appeared in Linux 2.4.23. A port by Bart Samwel has been included in kernels starting from 2.6.6. This page was originally written by Bart Samwel to host his 2.6 port; as the port has been merged a long time ago, the current page only serves as a placeholder.

Usage

Install the laptop mode tools, they contain all you need to use laptop mode. Read the included manual page laptop-mode.conf and the FAQ.

Bug reports

Please mail/CC bug reports and feature requests to Ritesh Raj Sarraf or send them to the laptop mode tools mailing list. If you post them on the linux kernel mailing list I will probably not see them.

Linux Journal Article

The September 2004 issue of Linux Journal contains an article on Laptop Mode (written by me). I'll take this opportunity to point out a number of changes that have taken place since the article was written.

  1. Setting it up: the whole setup process has been simplified by the introduction of laptop mode tools. Installing them is all you need to do to get laptop mode up and running. If you're running acpid or pbbuttonsd, laptop mode tools will automatically start when your laptop goes into battery mode. In addition, the laptop mode tools package will automatically manage your hard drive's idle timeout and power management settings (if you've configured it properly, of course), so you don't have to worry about manually invoking hdparm anymore.
  2. Configuration: the article mentions configuration settings in /sbin/laptop_mode. First of all, laptop mode tools installs the script in /usr/sbin/laptop_mode. Second, the configuration has been moved to a separate file, /etc/laptop-mode/laptop-mode.conf. The laptop mode tools package contains a full description of all the available configuration settings in the manual page laptop-mode.conf(8).

If you're interested, the article can be read online here.