Thursday, September 25, 2008

Reclaiming disk space on the A110L


The A110L ships with an 8GB SSD, which in fact is only 7.51GB small.
And another GB is lost to the swap partition. When you boot your A110L
for the first time you will only have 3.6GB of free space. However up
to 2.2GB can be reclaimed by removing various unnecessary things or
simply replacing software with smaller versions. It doesn't sound like
much, especially in the days of TB disks, and might not seem like it's
worth the hassle, but with only 7.51GB it certainly is.

Press Alt+F2 to show the Run program window, check Run in terminal and click Run to open a terminal. Lets take a look at the installed packages sorted by size first.
You may see a connection refused error whenever you use sudo, ignore it.

rpm -qa --qf "%{SIZE}\t%{NAME}\n" | sort -k1,1n

You'll
notice ten OpenOffice language packs and a few spellchecking libraries
with a combined size of 367MB. Unless you're in the translation
business you will probably not need any of them, english is built in
and cannot be removed.

sudo yum remove openoffice.org-langpack-it openoffice.org-langpack-ru \
openoffice.org-langpack-de openoffice.org-langpack-fr openoffice.org-langpack-pt_PT \
openoffice.org-langpack-es openoffice.org-langpack-nl openoffice.org-langpack-zh_TW \
openoffice.org-langpack-zh_CN openoffice.org-langpack-ja_JP hunspell-it hunspell-ru \
hunspell-de hunspell-es hunspell-fr hunspell-pt hunspell-nl

There are also korean, chinese and japanese fonts installed, 168MB.

sudo yum remove acs-firefox-fonts cjkunifonts\* taipeifonts scim-tables-chinese \
baekmuk\* libhangul fonts-japanese sazanami-fonts-mincho anthy

By removing all unused locales additional 172MB can be gained. Find out your locale using locale. It will show sth. like en_US.UTF8.
First all unused locales are removed. Then the cache is deleted and
rebuild only using the remaining locales. It's all automatically done
using the few commands below. Just replace en behind the name flag in the first line, and en_US and en_US.UTF8 in the last line corresponding to your locale. You will be asked to confirm the deletion of every locale to avoid mistakes.

sudo find /usr/share/locale/* -maxdepth 0 -type d -not -name en\* -ok rm -rf {} \;
sudo rm /usr/lib/locale/locale-archive
sudo localedef -f UTF-8 -i en_US en_US.UTF8

You
might even get rid of OpenOffice, 240MB, completely and install
Abiword, only 17 MB, instead. It supports OpenDocument and can also
export to PDF. For your spreadsheet needs Gnumeric, 30MB, is available.

sudo yum remove openoffice.org\*
sudo yum install abiword gnumeric

There are also alternatives to Adobe Reader, 115MB, available. Try evince and epdfview, both only a few MB small.

sudo yum remove AdobeReader_enu
sudo yum install evince epdfview

Next in line are the Acer games, or should i say demos, with a total size of 47MB.

sudo rm -rf /usr/share/games/*

If
you want to remove the other games as well, for 46MB, try this. They
are listed in the order of appearance in the game menu in case you
still want to keep some.

sudo yum remove ltris frozen-bubble tuxpuck supertux llk_linux

You can also remove the Acer branded mail and messenger clients and install thunderbird and pidgin instead.

sudo yum remove evolution-data-server libpurple
sudo yum install thunderbird pidgin

I've also removed the Acer media master, photo master and mplayer. Instead i installed VLC, capable of playing all formats, using the Fedora 8 installation method.

sudo yum remove pdvdlinux pcmlinux mplayer\*

The Online Updater will try to re-install a few things whenever a patch is available, you can find a way to prevent it here.

Whenever
you use yum to download and install something it will keep the
downloaded package in a cache, the following command sets keepcache in
the config file to 0 to prevent this.

sudo sed -i.1 3s:1:0: /etc/yum.conf

If
some package automatically installs a few dependent packages but
doesn't automatically uninstall them when the original package is
removed you can show the last packages installed and remove them
yourself.

rpm -qa --last | head -n 20

You can find unused libraries or packages using package-cleanup, provided by yum-utils. It is not always safe to trust package-cleanup.

Also
worth noting is that whenever you think you delete something using the
file browser it is moved to /home/user/.local/share/Trash instead.
However you can permanently delete a file using Shift+Del.

If you're using Firefox 3 you might have heard that safe browsing
has been implemented and is used by default. It does check every URL
you visit against a local database, which is quite big, 50MB, and will
grow. If you're not easily fooled by phishing websites or don't want to
use this feature for privacy reasons enter about:config in the address
bar and set both browser.safebrowsing.enabled and
browser.safebrowsing.malware.enabled to false. You can use the
following line to automatically delete the database, it will be
recreated with a size of 32KB. If you ever decide to re-enable both
options the database will be automatically rebuild.

find /home/user -name urlclassifier3.sqlite -delete

Unless
you're on a slow connection you can also disable the disk cache in
Firefox. Set browser.cache.disk.enable to false. Disabling both this
and safe browsing also reduces the frequent accessing of the SSD,
potentially speeding things up.

One more thing. If you ever get
the feeling that's there not enough disk space available because deep
down in the filesystem hierarchy some files got lost use find to track them down. Replace 100M with any size you like.

sudo find / -size +100M -printf "%s %p\n" | sort -n

Now
to the interesting part. The 1GB swap partition. If you got 1GB of RAM
installed you can easily disable it, even with 512MB if you're only
using the default applications. A booted system uses only 135MB. You
can check your memory usage by pressing Ctrl+Alt+Del.

To get that extra GB, you'll need to boot gparted from an USB stick. You can download it here, instructions here, syslinux here. You can also use partedmagic, no difference. Remove any SD cards when booting.

Next prevent swap from mounting, the following command does all the work you.

sudo sed -i.1 "s:/dev/sda2:#/dev/sda2:" /etc/fstab

Boot
gparted, delete the linux-swap partition and resize the remaining one.
I've made some screenshots showing the progress, from left to right, of
the whole operation. Be warned that you might lose all your data if you
make some terrible mistake! The recovery tool will still work and
recreate both partitions and everything as it once was.



1 comment:

Marcelo Sanjuan said...

Awesome post!! very useful, I cannot thank you enough for this iniative. I'm a debian user, therefore i was quite unfamiliar with the package management, you really cleared up a lot of things for beginners and for experienced users too!!!

thanks a lot and long live the aspire1!!!

instantptr.com