Differences between revisions 109 and 110
Revision 109 as of 2009-10-20 11:07:18
Size: 24211
Editor: ?SomeEEEUser
Comment:
Revision 110 as of 2009-10-20 11:37:24
Size: 24179
Editor: GeoffB
Comment: s/package.d.o/DebPkg/
Deletions are marked like this. Additions are marked like this.
Line 75: Line 75:
[[http://packages.debian.org/openbox|OpenBox]]: DebPkg:OpenBox:

Translations: French, German, Spanish, Portuguese

Extending flash memory life

It is a commonly accepted view that SSD devices can only be written a limited number of times before they die, and while that may have been a concern for earlier generations of devices where that limit was relatively low, modern SSDs, such as the one in the Eee increase that number sufficiently so that they will last many years before they die, outlasting any HDD. Before you spend herculean efforts to extend your Eee's flash lifespan, consider this article: http://wiki.eeeuser.com/ssd_write_limit. Nevertheless, many tips are easy to do and at the very least are harmless, or have other benefits (such as less time spent doing IO making your system more responsive,) so here are a few.

  • Open /etc/sysctl.conf and set vm.dirty_writeback_centisecs = 1500. This will prolong the life of your SSD by writing to the disk every 15 seconds instead of 5.
  • Probably many of the tips useful for Linksys on NSLU2 can be applied to the EeePC.

  • Use tmpfs for directories whose content doesn't need to be preserved over shutdown/reboot:
    • /tmp: echo "tmpfs /tmp tmpfs defaults 0 0" >>/etc/fstab;

    • /var/run & /var/lock: set RAMRUN=yes and RAMLOCK=yes in /etc/default/rcS.

  • Mount your disk-backed filesystems with the 'relatime' option.

  • Re-partition and reinstall (or, better, partition in this way at install time!), aligning the partitions with the SSD's erase block size. For example, assuming that this is 128K:
    • fdisk -H 128 -S 32 /dev/sda
      This sets up a logical cylinder size of 2MB (128×32×512 bytes).

    • mke2fs -t ext4 -E stripe-width=32 /dev/sda1
      This initialises sda1 for ext4, and helps to avoid read-modify-write in 128K chunks, each chunk being 32 pages of 4K each. (See the mke2fs man page for more options.)

    • Switch off journalling (if using ext3 or ext4), or mount ext4 filesystems with the journal_async_commit option.

    • If you have two SSDs, you can leave /dev/sdb unpartitioned and use the whole device for /home.
    • For more information, see here, here and here.

Text Mode

I’ve included some notes below (based on the instructions listed at this site.).

  • Upgrade grub-pc to 1.96+20090709-1 or later.

  • Run 915resolution -l

eee01:~# 915resolution -l | grep 800x480
Mode 3c : 800x480, 8 bits/pixel
Mode 4d : 800x480, 16 bits/pixel
Mode 5c : 800x480, 32 bits/pixel
  • Add the following lines to /boot/grub/grub.cfg. I put it at the end of the 00_header section:

915resolution 3c 800 480
#915resolution 4d 800 480
#915resolution 5c 800 480
  • To figure out your vga number, add 0x200 to the mode. i.e. for 8 bit mode: 0x200 + 0x3c = 0x23c = 57210

  • Add vga=572 to the kernel line in the /boot/grub/grub.cfg file.

### BEGIN /etc/grub.d/10_linux ###
menuentry "Debian GNU/Linux, linux 2.6.24-1-686" {
        linux   (hd0,1)/vmlinuz-2.6.24-1-686 root=/dev/sda3 ro vga=572
        initrd  (hd0,1)/initrd.img-2.6.24-1-686
}
menuentry "Debian GNU/Linux, linux 2.6.24-1-686 (single-user mode)" {
        linux   (hd0,1)/vmlinuz-2.6.24-1-686 root=/dev/sda3 ro vga=572 single
        initrd  (hd0,1)/initrd.img-2.6.24-1-686
}
### END /etc/grub.d/10_linux ###

Desktop environment

If you use a Gnome desktop on your Eee, here are some ways to make better use of the limited screen height:

  • Enable the autohide property on the Gnome panels at the top and bottom of the desktop, so they get out of the way unless you mouse over them. To do this, right click on a blank part of the panel, then choose Properties, and go to the General tab. Unfortunately, Gnome's idea of "hidden" may not match yours (or the dictionary's); it still leaves a bar several pixels wide. In lenny, the remainder can be removed by using gconf-editor to set /apps/panal/toplevels/{bottom,top}_panel_screen0/auto_hide_size to 0. [For an older version of Debian, the following seems to apply: You can reduce that to 1 pixel (but not to zero) by using gconf-editor to change /apps/panel/toplevels/panel0/auto_hide_size (you have to do this for panel0, panel1,...).]

  • In many applications, like gnome-terminal and firefox (iceweasel), you can use the F11 key to toggle a fullscreen mode that provides even more area than simply maximizing the window.
  • In metacity you can set up the F11 key to toggle fullscreen mode for all applications by selecting System > Preferences > Keyboard Shortcuts. Find the "Window Management" section, select the "Toggle fullscreen mode" item (which is disabled by default), and type F11 to set it.

  • You can change workspaces without exiting fullscreen mode by using Control-Alt-Left_arrow and Control-Alt-Right_arrow.
  • You can move your application under Xfce, KDE and Gnome with alt+left_mouse ( press alt before left_mouse ) and move your mouse. Very useful for applications bigger than the screen, like Gnome Evolution (Mail).
  • With Alt+F7 you switch to "move screen" after pressing those two keys you can use the keyboard arrows to move the window around.

Firefox:

  • Use the F11 key to toggle a fullscreen mode that provides even more area than simply maximizing the window.
  • Install the CompactMenu2 extension to gain few pixels taken by the menu, and some minimalistic theme (like Littlefox) to gain even more.

  • Using vimperator extension improves a lot the space to display pages provided that you are familar with Vim editor.

  • You can also stop using tabs and use Alt+Tab to switch from a window to an other. Use the KeyConfig extension to bind Ctrl+T to "New window".

  • Activate the “Use Small Icons” checkbox in the “Customize Toolbar” panel

Opera:

  • Use F11 to get into full-screen (this is the presentation mode, you'll not have any bars unlike as in FF).
  • Use the "Fit to width" feature on huge pages.

KDE/Kwin:

  • Each window can be made fullscreen with a right click on the window decoration. You can also use keyboard shortcuts to make a window fullscreen in the control center > “Regional & Accessibility” > “Keyboard Shortcuts” > “Make Window Fullscreen” or “Hide Window Border”.

  • Put the panel on the left or right side instead of bottom/top, as you have more room in width than in height. Also choose “Tiny” for the panel size, and take a look at the auto/manual Hiding functionalities.

OpenBox:

Accessing the Asus Restore Image

Here is a way to access the files that were on the original Xandros system before you installed Debian on your Eee PC. You need the Asus Support DVD that came with the machine, and a Linux machine with a DVD reader and about 2.5G of free disk space (so you probably don't want to do this on your Eee).

Insert the Support DVD and extract the disk image of the Xandros system:

sudo mount /dev/dvd /media/dvd
zcat /media/dvd/P701L.gz > ~/restore.img
sudo eject /media/dvd

Now you can mount the Xandros image on your desktop whenever you want by doing:

sudo mount -t ext2 ~/restore.img /mnt/img -o ro,loop,offset=32256

(The offset of 63*512 = 32256 skips over the partition table in the disk image.) The original filesystem is now mounted, read-only, under /mnt/img/. When you're finished accessing it, don't forget to do

sudo umount /mnt/img

Make a complete disk image

The Debian Installer provided in the ../Howto/Install can be used to make a disk image and to send it over the network. This trick can sometimes provide a way to restore the (nearly) original Asus EeePC system before playing with new Debian installation as in some countries, you do not have the Asus Restore Image shipped with the laptop.

Backup

This method uses dd and nc provided by the Debian Installer and another computer located on your local network:

  • First, boot the debian installer on your USB disk
  • Then be sure to activate network and configure it, same thing for the disk (Do not partition it)
  • Open a console shell (Alt+F2 or from the Debian Installer menu)
  • On the backup computer:
    • get its IP adress (ifconfig)
    • start a listening nc session on port 9000:

 nc -l -p 9000 | gzip -1 -c > ./eeepc.img.gz
  • With netcat-openbsd installed this line should read

 nc -l 9000 | gzip -1 -c > ./eeepc.img.gz
  • On the EeePC shell:

dd if=/dev/sda | nc -w 5 computer_ip_adress 9000
  • Wait some minutes (about 35)... and you get a eeepc.img.gz with about 900Mb

Extract some files from the image

The compressed image contains the entire disk image including the boot sector and partition table. However, these cannot be mounted directly. First, we need to decompress the image. Next, we need to use fdisk to determine the offset of the partition so we can mount it as a loopback device using that offset.

FixMe: The following assumes the user did not repartition the system when they installed Debian. This is not the recommended way to install Debian, as it wastes space by leaving the Xandros restore partition intact. Redo the backup using an all-in-one-partition Debian system and show the resulting fdisk output (plus now we can drop the Note at the end about extracting from the second partition).

  • extract the compressed disk image:
    gunzip eeepc.img.gz => got & 4Gb eeepc.img
  • As root (or sudo), setup a loopback device:
    losetup -f eeepc.img 
  • view of the partitions:
     fdisk -ul /dev/loop0 
  • Disque /dev/loop0: 4001 Mo, 4001292288 octets
    255 heads, 63 sectors/track, 486 cylinders, total 7815024 secteurs
    Units = secteurs of 1 * 512 = 512 bytes
    Disk identifier: 0x3c173c16
    Périphérique Amorce    Début         Fin      Blocs    Id  Système
    /dev/loop0p1              63     4819499     2409718+  83  Linux
    /dev/loop0p2         4819500     7775459     1477980   83  Linux
    /dev/loop0p3         7775460     7791524        8032+   c  W95 FAT32 (LBA)
    /dev/loop0p4         7791525     7807589        8032+  ef  EFI (FAT-12/16/32)
  • 1 sector = 512 bytes, you want to mount partition 1 which starts at sector 63 => 63 sectors * 512 bytes = 32,256 bytes

  • Partition 1 starts at 32256 bytes.
  • Use the same command from the last tips:
    sudo mount eeepc.img /mnt/img -o ro,loop,offset=32256
  • if you want partition 2 use 4819500*512 = 2467584000 bytes offset:
    sudo mount eeepc.img /mnt/img -o ro,loop,offset=2467584000

Note: The first partition is the restoration partition and is ext2 filesystem, the second partition is your "active" partition and is ext3 filesystem. So if you want to find some of your files, try to search them under the second partition...

Restoration

Here is a restoration procedure with the debian installer:

  • On the Asus EeePC, launch the debian installer, config network (get the IP adress) and detect disks then get a shell.
  • launch the restoration command:
    nc -l -p 9000 | dd of=/dev/sda
  • Then on the computer with the image file:
    zcat ./eeepc.img.gz | nc <eeepc_ip_adress> 9000
  • Wait some minutes...
  • If you restore the original Asus image from the DVD, don't forget to make /dev/sda2 with fdisk and after rebooting factory reset by pressing F9 at boot.
  • Reboot your computer!

Freeing Disk Space

Remove Unused Locales

This would save several tenths of megabytes. Install the package localepurge and select the locales you use (?LocalePurge). Then run localepurge as root. localepurge will also run automatically after each APT run, cleaning unused localization data.

Clean up Obsolete Downloaded Package File

When installing packages the package files are first stored locally and then installed. After that the package files are not needed any more. You can delete them using the tools of the package manager in question. Use the menu item in Aptitude or Synaptic or enter one of the following on the command line.

sudo aptitude clean

sudo apt-get clean

Remove Unnecessary Big Packages

Courtesy of keverets from #debian-eeepc, this sorts installed packages by size:

dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -n

You may have some big -doc packages you don't really need. Can free up a couple hundred megs this way or more.

Another way is to use synaptic, go to installed packages and click on the size column.

Turn Off Reserved Blocks on ext3

By default, ext3 allocates 5% or so of your partitions for reserved blocks. To turn this off:

tune2fs -r 0 /dev/sda2

This can be done on a mounted filesystem. On an 8gig SSD I freed up half a gig this way.

Software Control of the fan speed

EeePC’s hardware fan control is highly energy inefficient. Fan is turned on on need and usually never turned off (even if temperature reaches a normal value).

From 2.6.26 linux kernel includes eeepc_laptop module which provides a fan control interface in /sys/class/hwmon/.... It is not yet supported by eeepc-fancontrol (see below), but future versions of eeepc_laptop might be supported by lm-sensors if http://bugzilla.kernel.org/show_bug.cgi?id=11520 is fixed.

Manual fan control can be enabled using echo 1 > pwm1_enable and fan speed can be changed via echo n > fan1_pwm (n being a number between 0 and 255).

Kernel 2.6.26: You cannot switch back to automatic fan control without rebooting. After suspending your EeePC fan1_pwm will be reset to zero and your fan will not run until you manually activate it.

Kernel 2.6.28: You can switch to automatic fan control by echo 0 > pwm1_enable from manual mode. To check if automatic fan control is working just type in a terminal yes. This will put load full load on the CPU and start the fan. Press Ctrl-C to stop the program yes.

Kernel 2.6.30: fan1_pwm is 2.6.28 is just pwm1 in 2.6.30.

I added the following to my /etc/acpi/powerbtn.sh to switch the fan to manual control (which will turn the fan off) and after a second change to automatic control (so that it will come back if necessary).

cd /sys/class/hwmon/....
echo 1 > pwm1_enable
sleep 2
echo 0 > pwm1_enable

Now basically I press the power button to reset the fan. There is basically no harm in this, as the fan would automatically start, when there is heavy load in the system. This assumes that you have KDE or GNOME to catch the press of power power button to launch the logout/Switch user/shutdown/restart dialog. If you are running an unsupported window manager then comment the shutdown command in the last line as shown below.

#/sbin/shutdown -h now "Power button pressed"

eeepc-fancontrol There is a highly experimental tool available that monitors temperature and adjusts fan speed according to it. It is written in Perl by ?RaimoRadczewski and called eeepc-fancontrol. You can get it at http://code.google.com/p/eeepc-fancontrol/ Additionally you must install the eee.ko module (http://code.google.com/p/eeepc-linux/). You can adjust values by editing the daemon with your favorite text editor. Attention. There is no warranty for this. It works quite good, but remember on REAL heavy load the daemon might not be executed.

Fan control without extra modules The lm-sensors package has a fan control script /usr/sbin/fancontrol that is started at boot by /etc/init.d/fancontrol and reads its settings from /etc/fancontrol. aptitude install lm-sensors to get this installed. The script pwmconfig should make /etc/fancontrol for you, but failed on my Eee PC 1000HE with 2.6.30. So I wrote this one:

/etc/fancontrol:
INTERVAL=5

FCTEMPS=hwmon1/pwm1=hwmon0/temp1_input
FCFANS=hwmon1/pwm1=hwmon1/fan1_input
MINTEMP=hwmon1/pwm1=55
MAXTEMP=hwmon1/pwm1=70
MINSTART=hwmon1/pwm1=50
MINSTOP=hwmon1/pwm1=50

Names should be different for 2.6.28 I think. I made these numbers up and the fan seems to be sensible. If anyone knows what they should be, do post the answer here. Anyway, try it out by running fancontrol as root. When you are ready, run invoke-rc.d fancontrol start to start fancontrol off in the background. It will automatically get started at boot.

Speed up boot process

  • Install dash and make /bin/sh point to dash by dpkg-reconfigure dash

  • Remove nfs-common, because it starts portmap daemon. (as root: aptitude remove nfs-common)

  • Workaround hwclock timing out by setting HWCLOCKPARS="--directisa" in /etc/default/rcS

  • Disabling eth0 and ath0 in /etc/network/interfaces can save about 4secs.
  • ../Boot is a more thorough approach for speeding up the boot process, provided you’re willing to do without certain standard Debian packages such as cron, sysklogd, etc.

  • For more ideas see http://www.debian-administration.org/article/Booting_Debian_in_14_seconds.

Turn off the internal display when using VGA out

  • Open "/etc/acpi/actions/vga-toggle.sh" in your favorite editor

In the case statement on line 26:

  • Insert "xrandr --output LVDS --auto" after the first "xrandr --output VGA --off", line 29
  • Insert "xrandr --output LVDS --off" after the second "xrandr --output VGA --off", line 33

Speed up X11

On the EeePC 2D-acceleration seems to be better with XAA instead of the new EXA. You can manually choose the old acceleration method by adding Option "AccelMethod" "XAA" to the Device section of your graphics card in xorg.conf. Some 2D operations measured with 'x11perf -all' will be several times faster than with EXA. But notice that those improvements are only theoretical ones and haven't been confirmed in real usage. While most operations have small speedups between factor 1.0 and 1.5, there are some others that are even 20 times faster with XAA. Though some operations are slower, the difference is there only a few percent.

Results of x11perf: EXA, XAA, x11perfcomp result

Fixing iPod file reading

Access to iPod files by any of the music managers (Rhythmbox, Amarok…) that make use of the iPod’s music data base will fail reading the file. You will receive some sort of message that indicates the file does not exist. If you look on your iPod you will convince yourself that it does exist, however, the case is different. The 7/31/08 version of the kernel uses a default for the vfat file system type (the file system on your iPod) which forces short file names to always be lower case. The iPod files and the iPod DB have short file names in upper case, thus the error.

To fix this you must override the default setting shortname=lower to shortname=mixed. If you are using the GNOME desktop you can do this by using gconf-editor to change /system/storage/default_options/vfat. You will see the shortname mount option.

Once you change this to mixed your iPod will work with your music manager.

Custom Compiled Linux

The attached file contains a configuration option basis for compiling Linux. Use it with make allnoconfig as described in the Linux documentation. all.config

Outstanding Issues and Questions

  • Sound did not function in 1 test.
  • The MMC/SD drive on Eee PC works by USB, therefore MMC/SD card support is deselected.
  • If you do not use ext3 as your root filesystem, you may need to compile in another filesystem.
  • All things almost certainly to be needed in a user session (between when you switch the computer on and off) are compiled in, not modules.
  • Although Atheros5k WLAN module and PCI Hotplug are compiled in, it does not function.

Visual state and switching of Cam, Wlan and Card reader on the tray

This is a simple way to have a visual feedback of the state of the webcam, wireless card and card reader on the eeepc. It uses zenity to show three state icons that change colour and tooltip message every time we click on them. By using gksu, the script can remember the password for the root privileges needed to perform the various:

echo "1" > /sys/devices/platform/eeepc/wlan

You can put the contents of the following archive in any directory you want, but please update the paths...

eeetray.tar.gz

Please note that if you change the state of the peripherals by pressing some hotkeys, the state will not be automatically updated...

This script was tested on Debian Lenny with kernel 2.6.26 and on Fluxbox, but given its extreme simplicity it can be adapted to any system.

Thanks to <SynrG> for the tip about using zenity!

Speed up sluggish Iceweasel/Firefox 3

On the EEE models with two SSDs you probably end up having /home on the secondary bigger but much slower disk. This setup in combination with Iceweasel/Firefox 3 will most likely give you a sluggish web browsing experience.

Firefox 3 saves a lot of internal state information during surfing, which results in frequent disk writes and thus delays from the slow disk. An efficient workaround is to move your .mozilla directory to the smaller but faster disk as suggested on:

or

This was tested to improve the browsing experience a lot on the EEE 901.

Alternately, a small quantity of ram can be used as a ramdisk using the tmpfs system. This results in significant improvements in performance, as firefox utilises disk access very heavily

Adding a cron job to synchronise the ramdisk with the cache may prevent bad shutdown errors from erasing firefox history or addons. Furthermore, it may be advisable to reduce the firefox "offline storage" (advanced->network) cache in the preference dialog from the default (50M) to something smaller.

Slow intel rendering

Running the newer intel drivers (2:2.3.2-2+lenny6) on a 901, I (eeeuser) experience reduced performance and X stability compared to earlier versions. By modifying my /etc/X11/xorg.conf file, video perfomance seems to improve and so far, no ring buffer crashes. This improved behaviour has not been confirmed.

Section "Device"
        ...
        Option          "tiling"        "false"
        Option          "AccelMethod"   "UXA"
        ...
EndSection

This might improve perfomance, most notably during compositing. Some discussion is available at