Difference between revisions of "Laptop-mode"

From ThinkWiki
Jump to: navigation, search
Line 10: Line 10:
  
  
=== Keeping the disk in the stand-by state ===
+
>=== Keeping the disk in the stand-by state ===
  
 
Laptop-mode is only effective if one avoids spinning up the disk for frivoulous reasons.  What will spin a disk up is dependent on the HD firmware, but unfortunately most will spin up on just about every command.  To add insult to injury, ATA/SATA pass-through commands are not logged through the {{path|/proc/sys/vm/block_dump}} facility, and thus invisible to tools like '''lm-profiler'''.
 
Laptop-mode is only effective if one avoids spinning up the disk for frivoulous reasons.  What will spin a disk up is dependent on the HD firmware, but unfortunately most will spin up on just about every command.  To add insult to injury, ATA/SATA pass-through commands are not logged through the {{path|/proc/sys/vm/block_dump}} facility, and thus invisible to tools like '''lm-profiler'''.
Line 16: Line 16:
 
{{HINT|The '''lm-profiler''' tool from laptop-mode-tools can be used to list all processes doing normal disk access.}}
 
{{HINT|The '''lm-profiler''' tool from laptop-mode-tools can be used to list all processes doing normal disk access.}}
  
In systems where the HD spins up too easily, the "'''hddtemp'''" daemon will wake up the disk every minute, and must thus be disabled for power management to be effective.  The "'''smartd'''" daemon is also an offender, but fortunately its default configuration issues commands to the HDs only every 30 minutes.
+
In systems where the HD spins up too easily, the "'''hddtemp'''" daemon will wake up the disk every minute, and must thus be disabled for power management to be effective.  The "'''smartd'''" daemon is also an offender, but fortunately its default configuration issues commands to the HDs only every 30 minutes.
  
{{HINT|smartd can be configured to never issue commands to the disk if it is in the sleep or standby states, through the use of option "'''-n standby,q'''".  The "''',q'''" is needed to supress syslog messages.}}
+
{{HINT|smartd can be configured to never issue commands to the disk if it is in the sleep or standby states, through the use of option "'''-n standby,q'''".  The "''',q'''" is needed to supress syslog messages.}}
 +
 
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://evezyke.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 +
----
 +
=[http://evezyke.co.cc CLICK HERE]=
 +
----
 +
</div>
  
 
=== Hard drive noise using laptop-mode ===
 
=== Hard drive noise using laptop-mode ===

Revision as of 01:16, 15 November 2010

An often overlooked feature in 2.4.23+ and 2.6.6+ Linux kernels is the laptop-mode. It may be activated by writing a "5" into /proc/sys/vm/laptop_mode. Laptop-mode, when configured correctly, can make the kernel buffer disk activities for quite a long time and keep the harddisk spun down for most of the time to save power.

There is also a set of userland tools made to automatically manage all aspects of laptop-mode configuration according to the actual mode of operation (ac/battery-status). It is called laptop-mode-tools and you can install it in debian via apt-get or download it from here.

Almost anything you need to know about laptop-mode can be read in your Linux kernel documentation at /usr/src/linux/Documentation/laptop-mode.txt
If you can not find this file on your laptop, then go and get yourself the latest kernel sources.

NOTE!
The use of Laptop-mode and laptop-mode-tools is not recommended in SuSE Linux. The supplied powersaved already takes care of everything regarding power saving
NOTE!
Laptop-mode is disabled by default on Ubuntu 6.10 and later. See here for more details

.


>=== Keeping the disk in the stand-by state ===

Laptop-mode is only effective if one avoids spinning up the disk for frivoulous reasons. What will spin a disk up is dependent on the HD firmware, but unfortunately most will spin up on just about every command. To add insult to injury, ATA/SATA pass-through commands are not logged through the /proc/sys/vm/block_dump facility, and thus invisible to tools like lm-profiler.

Hint:
The lm-profiler tool from laptop-mode-tools can be used to list all processes doing normal disk access.

In systems where the HD spins up too easily, the "hddtemp" daemon will wake up the disk every minute, and must thus be disabled for power management to be effective. The "smartd" daemon is also an offender, but fortunately its default configuration issues commands to the HDs only every 30 minutes.

Hint:
smartd can be configured to never issue commands to the disk if it is in the sleep or standby states, through the use of option "-n standby,q". The ",q" is needed to supress syslog messages.


This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page


CLICK HERE


Hard drive noise using laptop-mode

The use of laptop-mode can cause a recurrence of the bug https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/59695 known to affect Ubuntu distributions, which causes the spindle of the hard drive to be parked too frequently. This is caused by laptop-mode setting the Advanced Power Management feature of the hard drive in /etc/laptop-mode/laptop-mode.conf.

Ubuntu is not completely at fault, as the hard drive manufacturer should set an appropriate graduation between hard drive longevity and power saving using a value between 1 and 255. (more information can be found in the hdparm manual page under the -B flag).

Values up to 127 can cause unacceptable noise and wear of a hard drive (for more information on Load_Cycle_Counts and hard drive wear, see above bug report). An acceptable balance can be found using hdparm:

 sudo hdparm -B 254 /dev/sdX

This value can then be entered into /etc/laptop-mode/laptop-mode.conf, first ensuring laptop-mode is set to control hdparm...

CONTROL_HD_POWERMGMT=1

...then by changing the default values:

BATT_HD_POWERMGMT=254
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254