Laptop

From ArchWiki
Revision as of 08:55, 18 March 2010 by Totalwormage (Talk | contribs) (use i18n template)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Setting Up For Laptops

This page should contain links to pages needed for configuring a laptop for the best experience. Setting up a laptop is in many ways the same as setting up a desktop. However, there are a few key differences. When setting up a laptop with Arch Linux, the following points should be taken into consideration:

  • Power consumption (how do I make the battery last the longest per charge?). Which leads to power management:
  • Hard drive spindown. After how many minutes of inactivity should the hard drive be spun down?
  • Screen shut off. After how many minutes of inactivity should the screen be shut off? (Not just blanked with a screensaver but completely shut off).
  • CPU frequency scaling. How should the CPU's frequency change depending on load to minimize power usage?
  • Suspend and hibernate. How do I get suspend and hibernate to work with my laptop?
  • Screen brightness. How do I manage screen brightness?
  • Network and wireless. How do I get my wireless working?
  • Media buttons. How do I configure the function of those buttons on my laptop?
  • Touchpad. How do I configure the sensativity, acceleration, button function and scroll borders for my Synaptics or Alps touchpad?

All of these points are important to take into consideration when getting a laptop set up the way you like. Fortunately, Arch Linux provides all the tools and programs necessary to take complete control of your laptop. These programs and utilities are highlighted below, with appropriate tips tutorials.


Note: the following links may be useful:

Power Management

Power management is very important for anyone who wishes to make good use of their battery capacity. The following tools and programs help to increase battery life and keep your laptop cool and quiet.

Battery State Monitoring Utilities

Battery state can of course be read with acpi from the terminal. Acpi can be installed with

$ pacman -S acpi

A simple battery monitor that sits in the system tray is batterymon which can be found in the AUR.

Cpufrequtils

Cpufrequtils provides CPU Frequency Scaling, a technology used primarily by notebooks which enables the OS to scale the CPU speed up or down, depending on the current system load and/or power scheme. For quick and easy installation and setup, please view the CPU Frequency Scaling article.

Pm-utils

Pm-utils provides a suspend and powerstate setting framework. Pm-utils should be used with cpufrequtils to provide a complete power management solution.

Lapsus

Lapsus is a set of programs providing easy access to many features of various laptops. It currently supports most features provided by asus-laptop kernel module from ACPI4Asus project, such as additional LEDs, hotkeys, backlight control etc. It also has support for some IBM laptops features provided by IBM ThinkPad ACPI Extras Driver and NVRAM device.

Install PowerTOP

PowerTOP is a handy utility from Intel that displays which hardware/processes are using the most power on your system, and provides instructions on how to stop or remove power-wasting services. Works great for mobile Intel CPUs; provides the current CPU state and suggestions for power saving. Also works on AMD systems, but does not provide as much information about the CPU state. Install with:

# pacman -S powertop

Laptop mode tools

Install Laptop Mode Tools with:

# pacman -S laptop-mode-tools
  • The configuration files can be found in /etc/laptop-mode/laptop-mode.conf and /etc/laptop-mode/conf.d/*
  • Be sure to add laptop-mode to the DAEMONS array in /etc/rc.conf
  • Be sure to go through the config files, as many powersaving features are not enabled by default.

See this thread for more information.

Powernowd

Powernowd is a program for powering down CPUs dynamicly, which can be run either on an AMD-based system or an Intel-based system.

Install it with:

# yaourt -S powernowd

To configure it, just edit your /etc/conf.d/powernowd:

OPTIONS="-q -u 15 -l 5"

Suggestions for saving power

Note: Not only are these not needed if using laptop-mode-tools, but using laptopmode also gives you the benefit of applying them only when desired (ie, while the AC cable is unplugged).

Disk-related tweaks

Disable file access time: every time you access (read) a file the filesystem writes an access time to the file metadata. You can disable this on individual files by using the chattr command, or you can enable it on an entire disk by setting the noatime option in your fstab, as follows:

/dev/sda1          /          ext3          defaults,noatime          1  2

Source

Note: disabling atime causes troubles with mutt and other applications that make use of file timestamps. Consider compromising between performance and compatibility by using mount option relatime instead, or look into mutt work-around for noatime.

To allow the CD/DVD rom to spin down after a while, run the following:

/usr/bin/hal-disable-polling --device /dev/scd0

Other tweaks

These are some generic suggestions that will work with most laptops.

Add the following to /etc/modprobe.d/modprobe.conf:

options usbcore autosuspend=1


Add the following to /etc/sysctl.conf

vm.dirty_writeback_centisecs=1500
vm.laptop_mode=5


Add the following to /etc/rc.local (and make sure it gets executed at boot time)

/usr/sbin/iwpriv your_wireless_interface set_power 5

Source: here

Hard drive spin down problem

Documented here

To prevent your laptop hard drive from spinning down too often (result of too aggressive APM defaults) do the following:

Add the following to /etc/rc.local

hdparm -B 254 /dev/sdX where X is your hard drive device

You can also set it to 255 to completely disable spinning down. You may wish to set a lower value if you move your laptop around as lower values park the heads more often and reduce the chance of damage to your hard disk while it is being moved. If you don't move your laptop at all when you are using it, then 255 or 254 is probably best. If you do, then you might want to try a lower value. A value like 128 might be a good middle-ground.

Add the following to /etc/pm/sleep.d/50-hdparm_pm

#!/bin/sh
 
if [ -n "$1" ] && ([ "$1" = "resume" ] || [ "$1" = "thaw" ]); then
	hdparm -B 254 /dev/your-hard-drive > /dev/null
fi

and run "chmod +x /etc/pm/sleep.d/50-hdparm_pm" to make sure it resets after suspend. Again, you can change the value 254 as you see fit.

Now the APM level should be set for your hard drive.

For some laptops, the option -S to hdparm can also be relevant (sets the spindown time for the drive). Note that all these options can also be configured using the laptop-mode tools. This will allow you to set a high value when on AC and a lower value when you are running on battery power.

Tweaking the scheduler

For multicore and hyperthreading-enabled processors you may use sched_mc_power_savings and sched_smt_power_savings options respectively to make the scheduler keep idle as many cores as possible. To enable these options you can do

echo 1 > /sys/devices/system/cpu/sched_mc_power_savings

or

echo 1 > /sys/devices/system/cpu/sched_smt_power_savings

Echoing 0 will disable them. Also laptop-mode can be used to control shed_mc_power_savings (see the appropriate config file in /etc/laptop-mode/conf.d). --Kasbah 16:14, 14 August 2009 (EDT)

Touchpad

To get your touchpad working properly, see the Touchpad Synaptics page. Note that your laptop may have an ALPS touchpad (such as the DELL Inspiron 6000), and not a Synaptics touchpad. In either case, see the link above.

Special Buttons

To configure any special keys or buttons on your laptop, please refer to the following article: Customize your laptop keyboard with X and KDE. Note that KDE is not required.

Hard disk shock protection

There are several laptops from different vendors featuring shock protection capabilities. As manufacturers have refused to support open source development of the required software components so far, Linux support for shock protection varies considerably between different hardware implementations.

Currently, only one project, named HDAPS, support this kind of protection, which is prepared for IBM/Lenovo Thinkpads.

Just Check Hard Disk Active Protection System.