As mentioned in the introduction laptops sometimes have less resources if you compare them to desktops. To deal with limited space, memory, CPU speed and battery power, I have written this chapter.
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.
man strip
. To find every unstripped file you can use the file
command or more convenient the tool findstrip
. Attention: don't strip libraries, sometimes the wrong symbols are removed due to a bad programming technique. Or use the --strip-unneeded
option.zum(1)
reads a file list on stdin and attempts to perforate these files. Perforation means, that series of null bytes are replaced by lseek
, thus giving the file system a chance of not allocating real disk space for those bytes. Example: find . -type f | xargs zum
patch
recovery files. Find duplicates, you may try finddup
. Choose a system to name your backup, temporary and test files, e.g. with a signature at the end.tmpwatch
.binstats
package to find unused libraries (Thanks to Tom Ed White).rsfs
. Tune your filesystem e.g. tune2fs
. Choose an appropriate partition and block size.bzImage
.gzip
and decompress it on the fly. Alternatively you may choose to compress only certain files. You can even execute compressed files with zexec
- For e2fs filesystems there is a compression version available e2compr
, see http://debs.fuller.edu/e2compr/ .
- DMSDOS which enables your machine to access Windows95 compressed drives (drivespace, doublestacker). If you don't need DOS/Windows95 compatibility, i.e. if you want to compress Linux-only data, this is really discouraged by the author of the program. See http://fb9nt-ln.uni-duisburg.de/mitarbeiter/gockel/software/dmsdos/ .
mount
). For mounting MS-DOS Windows95 compressed drives (doublespace, drivespace) you may use dmsdos
http://metalab.unc.edu/pub/Linux/system/filesystems/dosfs/.libc5
, this library seems to be smaller than libc6
aka glibc2
.Use the tool hdparm
to set up better harddisk performance. Though I have seen laptop disk enabled with striping, I can't see a reason to do so, because IMHO aka RAID0 striping needs at least two different disks to increase performance.
See UNIX and LINUX Computing Journal: Tunable Filesystem Parameters in /proc How to increase, decrease and reconfigure filsystem behavior from within /proc.
Check the memory usage with free
and top
.
Mergemem Project . Many programs contain memory areas of the same content that remain undetected by the operating system. Typically, these areas contain data that have been generated on startup and remain unchanged for longer periods. With mergemem
such areas are detected and shared. The sharing is performed on the operating system level and is invisible to the user level programs. mergemem
is particularily useful if you run many instances of interpreters and emulators (like Java or Prolog) that keep their code in private data areas. But also other programs can take advantage albeit to a lesser degree.
You may also reduce the kernel size as much as possible by removing any feature which is not necessary for your needs and by modularizing the kernel as much as possible.
Also you may shutdown every service or daemon which is not needed, e.g. lpd
, mountd
, nfsd
and close some virtual consoles. Please see Small-Memory-mini-HOWTO for details.
And of coarse use swap space, when possible.
If possible you use the resources of another machine, for instance with X, VNC or even telnet
. For more information on Virtual Network Computing (VNC), see http://http://www.uk.research.att.com/vnc/ .
You may want to overdrive the CPU speed but this can damage your hardware and I don't have experience with it. For some examples look at Adorable Toshiba Libretto - Overclocking http://www.cerfnet.com/~adorable/libretto.html.
ls -lu
gives you the access time?). Therefore, you can safely disable it, then preventing disk access each time you cat
a file. Here is an example of a /etc/fstab with this power-saving option:
/dev/hda7 /var ext2 defaults,noatime 0 2
update
daemon, mobile-update
minimizes disk spin ups and reduces disk uptime. It flushes buffers only when other disk activity is present. To ensure a consistent file system call sync
manually. Otherwise files may be lost on power failure. mobile-update
does not use APM. So it works also on older systems.noflushd
monitors disk activity and spins down disks that have been idle for more than <timeout> seconds. It requires a kernel >=2.2.11 . Useful in combination with hdparm
and mount
with noatime option to bring down disk activity.Many kernel features are related to laptops. For instance APM, IrDA, PCMCIA and some options for certain laptops, e.g. IBM ThinkPads. In some distributions they not configured. And the kernel is usually bigger than necessary. So it's seems a good idea to customize the kernel. Though this task might seem difficult for the beginner it is highly recommended. Since this involves dangerous operations you need to be careful. But, if you can install a better kernel successfully, you've earned your intermediate Linux sysadmin merit badge. - Since this topic is already covered in other documents I want handle this here.
A small collection yet, but I'm looking for more information.
boa
is a single-tasking HTTP server. That means that unlike traditional web servers, it does not fork for each incoming connection, nor does it fork many copies of itself to handle multiple connections. It internally multiplexes all of the ongoing HTTP connections, and forks only for CGI programs (which must be separate processes.) Preliminary tests show boa is capable of handling several hundred hits per second on a 100 MHz Pentium."Alan Cox in LINUX REDUX February 1998 " .. there are two that handle normal applications very nicely. LBX (Low Bandwidth X) is the official application of the X Consortium (now OpenGroup www.opengroup.org). Dxpc http://ccwf.cc.utexas.edu/~zvonler/dxpc is the alternative most people prefer. These systems act as proxy X11 servers and compress datastreams by well over 50 percent for normal requests, often reaching a reduction to 25 percent of the original bandwidth usage. With dxpc, X windows applications are quite usable over a 28.8 modem link or across the Internet."
fdisk
and mkfs.ext2
so that a harddisk install can be done. Useful to boot up on old machines with less than 4MB of RAM.screen
- tiny but powerful console manager. John M. Fisk <[email protected]> in LINUX GAZETTE July 1, 1996 :"It's a GUI, GUI, GUI, GUI world! " -- or so the major OS manufacturers would have you belief. Truth is, that while this is increasingly the case, there are times when the command line interface (CLI) is still a very good choice for getting things done. It's fast, generally efficient, and is a good choice on memory or CPU constrained machines. And don't forget that there are still a lot of very nifty things that can be done at the console."You may also take into account to upgrade the hardware itself, though this may have some caveats, see chapter Open a Laptop Case above. If you need a survey about the possibilities, you can take a look at http://www.upgrade.de, this page is also available in French and English.