Laptop Mode / Laptop Mode Tools FAQ

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.

Spinning down too many times may kill hard drives

Desktop hard 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.

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.

Linux Journal article

There's an article in the Linux Journal September 2004 issue. It can be found online at 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, 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?

Yes, kind of. If you want to manually control laptop mode, you need to set all ENABLE_LAPTOP_MODE_* to 1, and then control laptop mode by manually calling the /etc/init.d/laptop-mode script with the "start" and "stop" arguments.

Note that the /usr/sbin/laptop_mode command does not support the "start" and "stop" commands anymore. These commands interfere with the low-battery detection code, and they default to "auto" for that reason. This design flaw will be corrected by the 2.x major release, which will feature a profile-based configuration system that will allow manual profile switching without interfering with the low-battery detection code.

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.

I have two hard drives, can I configure Laptop Mode to affect only one of them?

Set HD="/dev/hdX /dev/hdY" in /etc/laptop-mode/laptop-mode.conf, where /dev/hdX and /dev/hdY are the device names that you want laptop mode to affect. This doesn't quite work though: the kernel switch (which delays all writes) doesn't discriminate between drives. You can also limit which partitions are affected by the remounting, using the PARTITIONS configuration setting, but again, this doesn't fully disable laptop mode for the other partitions.

I set PARTITIONS and now it doesn't work anymore at all.

You have to include the default partitions (the partitions of the drives listed in the HD configuration setting) as well. In version 1.06 and higher you can use the "auto" keyword to indicate "and remount all of the default ones as well". "Default" here means "partitions that contain the device name of a hard drive in HD", i.e. if your partition is /dev/hda3 and you have HD=/dev/hda, then /dev/hda3 is part of the default partitions, but if it is aptly named
/dev/hdx7 then it isn't. :)

I set REMOUNT_PARTITIONS to "/ /mnt /usr" and it doesn't work.

You have to include the partitions' devices, not their mount points. So you should list things like "/dev/hda2 /dev/hdb1". If you're using version 1.06 or higher then you don't have this problem, as this version supports mount points as well as device names in REMOUNT_PARTITIONS (or PARTITIONS, as it's called in the new config file format introduced in version 1.07).

Why does syslogd sync all the time? Can I turn this off?

Yes, you can. In syslog.conf, you have to place a dash (-) before the log file name, e.g. the line kern.* /var/log/kern.log becomes kern.* -/var/log/kern.log. In addition, you can use lm-syslog-setup (included in laptop mode tools) to use different syslog.conf files based on whether you're running on battery or on AC power. This creates three different syslog.conf files in /etc: syslog-on-battery.conf for battery mode, syslog-on-ac-with-lm.conf for AC mode with Laptop Mode enabled, and syslog-on-ac-without-lm.conf
for AC mode with Laptop Mode disabled. Laptop mode tools will then take care of syslog.conf, by making it a link to the appropriate config file based on the power and laptop mode state. After running lm-syslog-setup, you can perhaps modify the "battery" version of the syslog.conf so that it never syncs, while leaving the syncs intact when you're on AC.

I set LM_READAHEAD to 3072, but hdparm reports that the readahead is 6144. Why?

The configuration setting is in kilobytes, hdparm reports readahead in 512-byte sectors.

5. Spinup Debugging

My disk spins up all the time and I have no clue what causes this. Can I debug this?

Yes, you can. But first, check that you have modified your syslog.conf to not sync, as described in the last question of the previous section. To debug disk activity, you can do:

echo 1 > /proc/sys/vm/block_dump

(Warning: you must disable syslogd before you do this, or you must make sure that kernel output is not logged. If you forget this, your system may get into a feedback loop, where syslogd causes disk activity, this causes kernel output, and this causes syslogd to do more disk activity, etcetera!)

This enables file/disk activity debugging in the kernel. You can read the output using dmesg. When you're done, disable block dump using

echo 0 > /proc/sys/vm/block_dump

NOTE: Recently a tool called lm-profiler was added to laptop-mode-tools, which does all this for you. It also detects network services that you might not want running, and it can install the services' init scripts into laptop mode's new "start/stop"  directory structure, so that they are automatically stopped when you are working on battery.

I ran lm-profiler, fixed everything, but my disk still spins up every once in a while!

In some cases this is caused by smartmontools. The smartd daemon installed by smartmontools regularly (once every half hour) checks the SMART monitoring information on your hard drives, and for some hard drives this causes the drive to spin up. The solution is to use the -n standby,q option of smartd. This option instructs smartd to refrain from checking the disk when it is spun down.

Another thing that doesn't show up in the lm-profiler output is if the disk is configured to do automatic offline tests. Disks to these at regular intervals (every four hours, according to the smartctl manpage).

6. Common Problems

When I start laptop mode, it complains about an unknown mount option.

  • Least likely option: You could have a 2.4 kernel version that doesn't support the commit= option for ReiserFS. To be honest, I have no clue whether that support was ever backported, so if anyone reading this has a 2.4 kernel running, try remounting your reiserfs partition with -o remount,commit=5 and tell me if it complains about an unknown mount option.
  • Most likely option: Your root filesystem is mounted as ext2 instead of ext3, because you did all of the following:
    • You compiled ext3 as a kernel module.
    • You don't use an initrd, or if you do, it does not load the ext3 module.
    • You did not explicitly specify the rootfstype as "ext3" in the kernel boot parameters. This means it is autodetected as ext2 at boot time, because it lacks an ext3 module.

    This problem is very nasty, because it is very hard to detect it -- /proc/mounts will list the rootfstype as rootfs, which tells you nothing, and mount as well as /etc/mtab will tell you the fstype is in fact ext3 -- which is an incorrect guess, taken from /etc/fstab. It puts your data at risk because you do not have journalling enabled, while you think you do. I've added a BIG FAT WARNING text when this happens in version 1.06 of laptop mode tools.

    I got a tip from Ian Allen on how to check for this: you can use dumpe2fs -h on the partition to get the file system properties. If the file system is listed as "not clean" and "needs_recovery" while it is mounted, then it is mounted as ext2. According to Ian, ext3 file systems list as "clean" even when they are mounted.

My log / laptop_mode output says hdc: drive_cmd: status=0x51 { DriveReady SeekComplete Error }

Then hdc is probably a CD-ROM drive, not a hard drive, and you should remove it from the HD parameter in /etc/laptop-mode/laptop-mode.conf. Fortunately, this doesn't actually break anything, so you can simply ignore the error messages as well. Recent versions of laptop-mode-tools correctly autodetect CD-ROM drives, so the error messages should be gone if you upgrade to the most recent version.

I have an SATA disk and it doesn't work.

Spindown timeouts don't currently work on SATA drives, because the Linux kernel does not support that properly. There are patches available that add this support. Check out for all SATA-on-Linux problems. For laptop mode to work, you want the libata_passthru patch. It will be included in the Linux kernel starting from version 2.6.15. Note: You also need a recent version of hdparm in order to make this work!

I have a SCSI disk and it doesn't work.

Starting from version 1.20 laptop-mode-tools supports SCSI drives. You have to make sure you have sdparm installed though! And I haven't actually tested it because I don't have any SCSI drives, so if you have any luck with this, please let me know.

I run Slackware and Laptop Mode isn't initialized correctly on boot.

This is caused by the fact that Slackware doesn't follow the Filesystem Hierarchy Standard and it doesn't completely clear /var/run on boot. It will work when you include a call to

/etc/rc.d/init.d/laptop-mode restart

in your rc.local.

I have an Apple notebook, and when I unplug the AC adapter Laptop Mode isn't enabled automatically.

If you are running pmud, then you need to have the line "/usr/sbin/laptop_mode auto" in the file /etc/power/pwrctl-local. Version 1.05 and higher add this automatically, I just haven't had any reports that this actually works so be warned. Versions 1.05 and up also install pbbuttonsd support, so that should work fine as well. Report back to me if it doesn't!

My system gets horribly slow!

If you don't have that much RAM, you probably want to consider lowering the READAHEAD value in /etc/laptop-mode/laptop-mode.conf. The default used to be 8MB, it was lowered to 3MB in version 1.05 for exactly this reason.

I upgraded to version 1.06 or higher and hibernation no longer works / is horribly slow! What causes this?

This is caused by the introduction of write caching control. Apparently disabling the write cache makes some drives horribly slow. Set DO_WRITECACHE=0 (version 1.06) or CONTROL_HD_WRITECACHE=0 (version 1.07 upward) to fix this. In a future version, this may be fixed by only disabling the write caches when the battery level is low. Note that writecache control is disabled by default in more recent versions.

I've set LM_BATT_HD_IDLE_TIMEOUT_SECONDS to 20 seconds, but the drive spins down after 5 seconds, what's going on?

Some drives override the idle timeout setting (hdparm -S) when you also set an aggressive power management level (hdparm -B). Set
CONTROL_HD_POWERMGMT=0 (supported from version 1.07) to stop laptop mode tools from fiddling with the HD power management setting.

I've set LM_BATT_HD_IDLE_TIMEOUT_SECONDS to 5 seconds, but the drive doesn't spin down at all.

Well, some drives have a specific minimum to the idle timeout values they support. Try increasing the value to 120 seconds and see if that works, then work your way back to the lowest value that still works.

I experience system freezes every once in a while, is this normal?

This is a bug in hardware or the Linux kernel, triggered by something laptop mode tools does. Try setting CONTROL_HD_POWERMGMT=0. This fixes the freezes for some people. The default for CONTROL_HD_POWERMGMT was changed to 0 in version 1.11 for exactly this reason. Otherwise, for now, downgrade to a kernel 2.6.10 or earlier.

Laptop mode causes filesystem corruption.

There has been a lengthy thread on the Linux Kernel mailing list about this, and the cause was determined to be the ipw2200 wireless network driver, version 1.0.8 ( This driver causes random memory corruption after some amount of network activity, and it will write a message "Firmware error detected. Restarting." to the kernel output. The memory corruption only happens the first time the message is shown (unless you have compiled the driver with some debugging options set), and can corrupt pretty much anything, including filesystem (meta)data that resides in memory. The chance that the overwritten data is, in fact, filesystem data is larger when you're running laptop mode, because laptop mode keeps filesystem data in memory for a longer period of time, thereby
increasing the proportion of memory that contains filesystem data.

I have an LVM partition and it doesn't get remounted.

This could be because laptop mode tools does not notice that the LVM partitions are on one of the hard drives that are listed in the HD configuration setting. You should list the devices by hand in the PARTITIONS configuration setting. (But: also check out the items on this configuration setting in the Configuration section of the FAQ!)

I started using SELinux / upgraded to Fedora Core 4 and now Laptop Mode doesn't start when I unplug the power cord.

This is caused by SELinux controlling acpid / apmd. How to change this in FC4 (contributed by Vesko T. Tomov):

  1. Click on Desktop in the panel --> System settings --> Security level
  2. Enter root password.
  3. Click on SELinux tab.
  4. Click on "SELinux Service Protection".
  5. Check box next to: Disable SELinux protection for apmd daemon, and click OK.
  6. Restart acpid.

I run a 2.6.12 Linux kernel. Why does Laptop Mode no longer start when I close the lid?

Some guy decided to delete the whole /proc/acpi/buttons directory, without creating a replacement. It was reintroduced in 2.6.13, so I suggest that you upgrade.

Why doesn't MUTT notice incoming mail anymore?

That's because Laptop Mode Tools remounts your filesystems with the "noatime" option, which prevents the updating of access times, while mutt is one of the few programs that actually use the access times. Set DO_REMOUNT_NOATIME=0 (CONTROL_NOATIME in recent versions) in laptop-mode.conf to fix this. Note that the default for this option has been changed to 0 recently.

Laptop mode stops working after I resume from hibernate.

Well, you'll have to restart the laptop-mode service after resuming from hibernation. The hibernate configuration file has support for starting/stopping services, you can use that.

After the X screensaver has kicked in once, my X screen blanking settings are reset.

Yes, xscreensaver resets the X screen blanking settings. I'm trying to figure out how to fix this. Any ideas? Send me an e-mail!

I monitor my drives using SMART, and my drive won't spin down.

Disable automatic offline testing with "smartctl -o 0". It prevents some drives from spinning down properly.

One of my ext3/reiserfs partitions doesn't get remounted with the commit= option.

Check if it is listed as type "auto" in fstab. Laptop mode tools cannot currently detect the filesystem type if it is mounted as type "auto". If you desperately need this, drop me a line.

I run powertop and laptop_mode shows up as a top cause for wakeups!

For kernel timer events, powertop lists the process that originally caused the events to be created. If a kernel setting tweaked by /usr/sbin/laptop_mode causes a timer to be created, then this will show up in powertop as a laptop_mode timer. However, it's not. It's usually the timer of the "ondemand" or "conservative" CPU frequency scaling governor, which is invoked every so often to adjust the CPU frequency. As laptop mode tools is the program that adjusts your CPU frequency scaling governor, it will show up as the one that is to blame.

I have set ENABLE_LAPTOP_MODE_ON_AC or ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED on Ubuntu, but it isn't working!

The laptop-mode-tools package in Ubuntu is a crippled version of the Debian package, which leaves the on/off decisions largely to the acpi-support package. Of course, they failed to mention this in the laptop-mode.conf file and in the manual pages, so that nobody actually knows this. They also failed to mention that the file /etc/default/acpi-support can even turn laptop mode off completely.

The Ubuntu solution has various downsides. First of all, the options mentioned above don't work. Furthermore, the safety options which disable laptop mode when your battery goes critical are not functioning on Ubuntu either. You can safely install the Debian packages instead, they work fine on Ubuntu and have none of the drawbacks of Ubuntu's crippled package.

7. Laptop Mode Tools Development / Contribution

What are the currently outstanding wishlist items that I shouldn't (or perhaps should) bug the maintainer about?

  1. Not installing pbbuttonsd support on PC hardware, and not installing ACPI+APM support on Mac hardware.
  2. It seems that LVM partitions' default settings for noatime are not always correctly read from /etc/fstab. May be an fstab layout issue or something, I haven't been able to reproduce this. If anyone reading this has an LVM volume, please try and mark it as "noatime" in fstab, start laptop mode, stop laptop mode and check whether the noatime is still there -- and mail me if it isn't. Thanks!

Is there a Laptop Mode mailing list?

No. I'll create one if there is a lot of demand though.

I have written this great library called libnosync, will you include it?

You wouldn't be the first. This library can be found in various incarnations on the web, and I think there are at least half a dozen people who have contacted me saying they either wrote this library, or they were thinking about doing it. No, I will not include it in laptop mode tools, as laptop mode tools is an architecture independent package. I might add support for enabling/disabling it together with laptop mode though. I have some plans to build a clean, configurable version of this library (which would allow control at the user and process level, i.e. "disallow sync only for emacs and vi, but not when they're run by root" and which would be able to report all syncs to a log file). This would become a separate package though!

I have a great idea for saving more power. Will you include it in Laptop Mode Tools?

If you can write it as a plugin, to be placed in /etc/laptop-mode/batt-start or the like, then you can put it on the web yourself, and I'll gladly link to your site. I'll even put it on my site, if you don't have a website to put it on. If it's more complicated than that, or if it will benefit a lot of people, then I'll consider including it.

8. Other Questions

What if my question isn't in here?

Read the manual pages (the one you want to read is the one called laptop-mode.conf). If that doesn't give you the answer, contact Ritesh Raj Sarraf.