8.1.4. Dealing with Limited Resources or Tuning the System
This chapter is taken from my Linux-Mobile-Guide - A Guide for Laptops, PDAs and Mobile Phones .
8.1.4.1. Related HOWTOs
8.1.4.2. Introduction
8.1.4.3. Small Space
8.1.4.4. Harddisk Speed
8.1.4.5. Small Memory
8.1.4.6. Low CPU Speed
8.1.4.7. Tiny Applications and Distributions
8.1.4.1. Related HOWTOs
Small-Memory-HOWTO Describes how to run Linux on a system with a small amount of memory.
8.1.4.2. Introduction
To deal with limited space, memory, CPU speed and battery power, I have written this chapter.
8.1.4.3. Small Space
8.1.4.3.1. Introduction
There are different types of techniques to gain more disk space, such as sharing of space, freeing unused or redundant space, filesystem tuning and compression. Note: some of these techniques use memory instead of space. As you will see, there are many small steps necessary to free some space.
8.1.4.3.2. Techniques
Stripping: Though many distributions come with stripped binaries today it is useful to check this. For details see man strip . To find every unstripped file you can use the file command or more convenient the tool findstrip (find it in the Debian perforate package) . Attention: don't strip libraries, sometimes the wrong symbols are removed due to a bad programming technique.
A recommendation from Russell Marks <rus at beeb.net>:
These days a lot of people compile with -g , which I find a bit annoying (though AFAIK this only loses you disk space, in practice).
strip has a --strip-debug option which doesn't strip symbols, but does still get rid of the debugging stuff. This is almost as good, in many cases, and it's ok to use it on libraries. As it happens, I recently got SuSE 6.3, so I can give you a live example:
bash-2.03# cd /lib
bash-2.03# ls -l libc.so.6
-rwxr-xr-x 1 root root 4223971 Nov 6 16:22 libc.so.6
bash-2.03# strip --strip-debug libc.so.6
bash-2.03# ls -l libc.so.6
-rwxr-xr-x 1 root root 1200355 Dec 8 00:13 libc.so.6
Sparse files: in the case when files contain blocks with only null characters, these blocks can be replaced by lseek command calls, saving space. Applications (and not the operating system) are responsible for creating or handling such files in a correct way. For example, both the tar and cp commands have options for handling sparse files in a correct way. See the http://www.lrdev.com/lr/unix/sparsefile.html page for more details and for a sparse command to create such files. In Debian, you can also use the zum command from the perforate package.
Remove Odd Files and Duplicates: Check your system for core files, emacs recovery files <#FILE#> vi recovery files <FILE>.swp, RPM recovery files <FILE>.rpmorig and patch recovery files. Find duplicates, you may try finddup . Choose a system to name your backup, temporary and test files, e.g.
* License

