Faster Ubuntu upgrade on netbook Acer Aspire One 110
I wrote in a previous post (
in italian now translated in English here) that maybe the main flaw in Acer Aspire One 110 netbooks is the very poor speed (expecially in writing) of its 8GB solid state disk (SSD); another problem (known, at least) is the little dimension of the SSD itself. My setup consists of 2 partitions: the root (named /) of about 4.5GB and /home (about 2.5GB). On one hand this setup make it easy to get a fresh reinstall of the Operating System without losing data: just remember to assign the same user name and you’ll enter in your old home directory keeping the configuration of system and programs. On the other hand, using this configuration you have less contiguous free space available on disk, especially in the root partition: so the update of the programs is a little more difficult, because the packages to be updated are downloaded (by apt, Synaptic or Ubuntu Software Center) in /var/cache/apt/archives and then they are unzipped and installed in their proper places all over the root directory. For the same reason the whole system upgrade, for example from Ubuntu 10.10 to Ubuntu 11.04, is more difficult (or still impossible, as I reported in my aforesaid article) because a great amount of files (800 MB or more, depending of the number of programs installed) has to be downloaded, saved to disk and then unzipped and installed.
These space and speed issues suggested me to try to move the directory /var/cache/apt on the 8 GB SD card (better, in a partition) permanently inserted into the Storage Expansion slot. Of course an USB pendrive or an external hard disk are ok for this purpose.
First of all, using GParted I created a new partition on the drive (recognised as /dev/mmcblk0). I sized it 2.5GB, formatted as ext2 and labeled as archives. The new partition is seen as /dev/mmcblk0p2.
Then I opened a terminal to edit the file /etc/fstab as super-user:
sudo gedit /etc/fstab
There I added the following line:
/dev/mmcblk0p2 /var/cache/apt ext2 defaults,noatime,nodiratime 0 0
It will mount the new partition in /var/cache/apt at boot time, so that /var/cache/apt/archives will reside on the SD card.
Then I saved the file, quitted Gedit and rebooted.
To check that all is ok just open a console and type mount:
~$ mount ... /dev/mmcblk0p2 on /var/cache/apt type ext2 (rw,noatime,nodiratime)
From now on, who is not used at command-line tools could proceed by running the Update Manager (System/Administration/Update Manager).
Nevertheless you could get an error because it needs some files in the (still empty) directory /var/cache/apt (for example pkgcache.bin e srcpkgcache.bin). To recreate them just type in the (still open) console:
sudo apt-get upgrade
Now it is possible to run the Update Manager. It will show, if necessary, the chance to upgrade to a more recent Ubuntu version or that updated packages are available. Now the .deb packages will be saved into the new partition on the removable media, and from here they will be installed on the root partition. This way you will save space on the SSD, and you will avoid to (slowly) write hundreds of MB onto it, so that the download will be faster; finally the installation procedure will be more efficient, avoiding to read (the .deb packages) and write (the installed programs) onto the same slow device.
Of course, after the upgrade, you can get back to the initial state deleting both the record you wrote in the file /etc/fstab and the partition on the SD card (after having it unmounted).