How to make the Acer Aspire One faster 10

Posted by bikethetam Sun, 17 May 2009 01:33:00 GMT

Using an SD card to run Ubuntu

The Acer Aspire One 110 is notorious for its small and sluggish SSD disk (SSDPAMM0008G1EA). Firefox is so slow it seems web pages will never finish loading and you'd better not be in a hurry when starting the package manager or setiing up Ubuntu updates. I wanted to find a solution that wouldn't involve tearing the motherboard apart and I found one. It cost me about $40 and a couple of hours of work.

The idea is to use a fast SD card as the primary drive of the laptop by installing Ubuntu on it, the SSD becomes an extra storage device. As you will see below, the SD card shows more balanced performances than the SSD and significantly faster write speeds.

I chose to buy the Transcend 16 GB SDHC Class 6 memory card. Note that it is sold with an USB adapter that comes very handy when installing the OS on the AAO.

Setup

There is just one problem with the setup: the bios on the Acer Aspire One is unable to boot from the SD card. That means that you can't just setup Ubuntu on it and restart. The workaround is to let the laptop boot from the SSD: the bios reads the MBR and starts grub on the SSD. The initrd kernel image is also on the SSD and that kernel is capable of mounting the SD card. Only after this is done can the regular boot process resume and the actual kernel get loaded from the SD card.

I followed the very good installation instructions I found on osnews.com. They are very detailed, I followed them point by point and I didn't run into any issue. Here is a slightly modified list of steps that goes straight to the point:

  • Install Ubuntu on the SSD if it's not already there. In my case it was there so I could skip that step. I found the version of linux present on the SSD doesn't really matter, it will just be used for its /boot directory and grub.
  • Boot from a USB drive where you can Install Ubuntu from. I used the 9.04 alternate CD. I had plugged it in the USB slot on the right of the AAO and I had the SD card in the USB adapter  on the left of the AAO. It might be possible to just stick the SD card directly on the left SD slot on the left, I think the 9.04 install USB key would be able to find it but I haven't tried and you will need the adapter on step 4 anyway.
  • Proceed with the actual installation to the SD card from the USB drive.
  • Reboot from the newly installed SD card (inside the USB adapter: there's no way around this for this step). Mount the old SSD on /ssd
mount -t ext2 /dev/sda1 /ssd
  • Now you must reconfigure how initrd.img files are generated. The goal here is to include support for the SD card reader in the initrd. Without it, you won't be able to access the card from grub. Edit /etc/initramfs-tools/modules on the SSD card and add those 4 lines:
mmc_core
mmc_block
sdhci
sdhci-pci 
  • Regenerate the latest initrd kernel image and copy it inside of the SSD /boot directory.
update-initramfs -u 
cp /boot/initrd.img-2.6.28-12-generic /ssd/boot
  • Edit /ssd/boot/grub/menu.lst on the SSD drive. There you will create a grub menu entry that points at a kernel on the SD card. Replace the UUID below with yours.
title           Ubuntu 9.04, kernel 2.6.28-12-generic-SDCard
uuid            5ce02d2f-1fee-4cc5-8c7d-bde5f19b26b8
kernel          /boot/vmlinuz-2.6.28-12-generic root=UUID=5ce02d2f-1fee-4cc5-8c7d-bde5f19b26b8 ro elevator=noop quiet splash
initrd          /boot/initrd.img-2.6.28-12-generic
quiet

Note that the UUID on the "kernel" line is the UUID of the SD card. So in the /boot directory of the SD card, there must be a vmlinuz file that matches the initrd file from the SSD card.

That's it, you can reboot one last time, select  "Ubuntu 9.04, kernel 2.6.28-12-generic-SDCard" from the grub menu and if the gods are with you, you will load the OS from the SD card. At this point you will enjoy an Ubuntu setup that will feel twice as fast as the old one with 3 times more storage space.

Beware: anytime you get a new kernel, by default it's only installed on the SD card but you need it on the SSD drive. So don't forget to copy the new initrd.img to /ssd/boot and to update /ssd/boot/grub/menu.lst whenever needed or you won't be able to use the new kernel.

Disk performance measures

Now that is just a feeling at this point. Here is how to back it with concrete numbers. I found the dd test page very helpful for this experiment. One can easily measure the disk  read speed with hdparm but that ells you nothing about the write speed.

$ hdparm -tT /dev/mmcblk0p1

/dev/mmcblk0p1:
 Timing cached reads:   1144 MB in  2.00 seconds = 572.07 MB/sec
 Timing buffered disk reads:   40 MB in  3.16 seconds =  12.67 MB/sec

So the best way to get both read and write speed is the following:

To measure the sequential write speed, write a large file to disk while measuring the time it takes. Note that the sync command is essential to guarantee all the data gets written instead of staying in some cache. Do not trust the throughput reported by dd, instead divide the size of the file by the duration reported by "time". For example, here is the test on the SD card (it generates a 160 MB file):

$ time sh -c "dd if=/dev/zero of=ddfile count=20000 bs=8k && sync"

20000+0 records in
20000+0 records out
163840000 bytes (164 MB) copied, 13.4757 s, 12.2 MB/s

real    0m18.885s
user    0m0.020s
sys     0m0.640s

To measure the read speed, read the same large file from disk:

$ time dd if=ddfile of=/dev/null bs=8k                
20000+0 records in
20000+0 records out
163840000 bytes (164 MB) copied, 9.96247 s, 16.4 MB/s

real    0m9.974s
user    0m0.016s
sys     0m0.588s

I ran that test on the SD card, on the SSD and on another Acer Aspire One  (AOA 150) with a regular hard disk.

  SD Card
SSD AOA150
Read speed (MB/s) 16.4 26.5 62.2
Write speed (MB/s) 8.42 2.31 51.6

 

As you can see although the SD read speed is just 60% of the SSD read speed, the write speed is almost 4 times higher on the SD card and for normal usage of a laptop that write speed increase changes everything. It worked so well, I decided to use Gnome on this machine and it appears to go twice as fast as Xfce was going on the SSD. Not that the Acer Apire One got magically turned into a Ferrari but with that SD card, it became a pretty decent Toyota!


Xfce hardly usable in Jaunty?

Posted by bikethetam Sun, 03 May 2009 18:38:00 GMT

I ran into a major issue after upgrading an old Acer Aspire One netbook running Xubuntu to Jaunty. It makes Xfce unusable especially if you have to login/logout or reboot frequently. Fortunately, there is a workaround.

Symptoms

  • The xfce desktiop takes minutes to initialize after the login windows. As I login and logout a few more times, the delay increases and goes over an hour.
  • Similar symptom when running the update-manager. Starting it up takes minutes/hours, the download and installation of new packages is equally slow and finishing up updates (when update-manager reloads it database) feels like it will never end.
  • While I'm waiting the HD light stays solid green. Running pidstat while update-manager is working shows a high number of xfdesktop processes, very high IO activity, crazy context switching and reduced available memory.

Causes

  • The Aspire One disk is extyremely slow, any swapping will make the machine slow to a crawl. That's an aggravating factor.
  • But what seem to cause the issue is that I have configures Xfce to "Save sessions" on exit. Apparently that causes the same processes (including xfdesktop) to be opened 2x, 4x and more every time an xfce session is started. After a bunch of restarts, the number of started applications is just too high and the AAO can't keep up.

Workaround

In  Xcfe "System Settings"/"Session and Startup", uncheck  "Automatically save sessions on logout". And in the logout confirmation window, be sure to uncheck the "Save sessions" checkbox.

A bug has been filed in launchpad precisely on that problem and it suggests a workaround: Multiple instances of xfdesktop started simultaneously

rm -rf ~/.cache/sessions
rm -rf ~/.config/xfce4/desktop

Then logout and login again. The problem should go away.