Running Linux on laptops not battery efficient? Check again!

Bookmark and Share

On most distros installations, there is a package “laptop-mode” tools included.

The package is meant to ensure power saving features on laptops.

However, at SGLNX, we discovered that this feature may be sub-controlled by another package that dictates if the “laptop-mode” settings is enabled or disabled.

It started out when we had a problem with hard-drive clicking noises on a recently purchased 320gb hdd to replace a lower capacity hdd within a working laptop. In our fact-finding mission to find out the root causes, we discovered that it was a hdd setting that could be controlled via the command  “hdparm“.

The hard-drive clicking noises was made by the parking of the heads of the hdd when it detected an idle period of a certain amount of time. To prevent the parking of the heads, the command “sudo hdparm -B 255 /dev/sda” was issued and it got rid of the parking/click noises from the hdd. Further research into the topic gave light to having the settings to be pre-set on boot by means of the “laptop-mode” package.

To automatically configure the hdparm settings upon boot, the configuration file of the laptop-mode package ( /etc/laptop-mode/laptop-mode.conf ) has to be edited manually.
#
# Power management for HD (hdparm -B values)
#
BATT_HD_POWERMGMT=1
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254

The values above had to be changed to “255″ for all 3 lines to turn off Advance Power Management on the hdd and thus eliminating the hdd clicking noises.

However, upon changing it and executing the start/stop script via “sudo /etc/init.d/laptop-mode restart

The values did not stick when we displayed the current hdparm setting “sudo hdparm -I /dev/sda“. Only then it was realized that laptop-mode was not running at all with the command “cat /proc/sys/vm/laptop-mode“. It was then discovered that another package was dictating whether laptop-mode should be started upon boot.

The package “acpi-support” was actually preventing “laptop-mode” to be started at all during the boot process.

To ensure that laptop-mode starts during the boot process, a little tweaking is needed on the configuration files of “acpi-support”.

sudo gedit /etc/default/acpi-support

Find the line that says

ENABLE_LAPTOP_MODE = False

Change the “false” to “true”.
Save and quit the editor.

Enter terminal and do a

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

With the above instructions, we were able to make the hdparm settings stick and you will be able to make use of laptop-mode and make the laptop last longer on battery……. And we certainly hope so!

The above illustrates our experience encountered with laptop-mode tools in Ubuntu Karmic Koala 9.10. The commands and configuration file locations may vary for your linux distros.

Share on your Social Networks:
  • Facebook
  • Twitter
  • Digg
  • del.icio.us
  • StumbleUpon
  • Google Bookmarks
  • blogmarks
  • FriendFeed
  • Identi.ca
  • Reddit
  • PDF
  • Technorati
  • Mixx
  • LinkedIn
  • RSS

Tags: , , , , , , , , , , , , , , , , , , , ,

Leave a Reply

You must be logged in to post a comment.