Chapter 8. Extending the Life Cycle of your Hardware

Table of Contents
Recycling of Hardware
Other Techniques
Linux BadRAM Patch
Installing Linux on Older Hardware
Upgrading and Repairing Hardware
Other Operating Systems

Recycling of Hardware

The commercial computer market is largely driven by vendors seeking to sell new hardware and software. There is no commercial marketing benefit in promoting reuse.

Hence Linux doesn't require big hardware, it's very useful if you like or need to use old and small hardware.

Supported CPU Families

Linux runs on Intel-compatible processors, including Intel's 386, 486, Pentium, Pentium Pro and Pentium II, and compatible processors by AMD, Cyrix and others. Linux doesn't support the 286 CPU family yet. But there are some efforts from the ELKS project. If you like, you may use Minix one of the predecessors of Linux. Minix supports 8088 to 286 with as little as 640K memory. Of course there are also ports to other systems, such as ALPHA, PowerPC, etc. For details about systems which are supported by the Linux Kernel, see the Linux-FAQ . The ARM is a fast AND low-power alternative. For example, the Corel/Rebel Netwinder is based on the ARM processor see Rebel and Strong-ARM.

Linux Applications and Distributions for Old Computers

RULE

Hardware is only as old as the software it runs. RULE wants to make modern Free Software useable even on 5 or more years old machines, on which current Linux distributions won't install or run too slowly.

ISDN Router

ISDN Router allows you to convert old hardware into a secure masquerading ISDN router, including caching nameserver, IP Port Forwarding, and on-demand channel bundling. The system fits onto a single disk, and users can change the configuration through a simple menu-based system (on the console or over telnet) and store it permanently on the disk.

Linux LiveCD Router

Linux LiveCD Router allows you to share and firewall your broadband connection and use WiFi. It works with DSL, cable modem, T1, and dial-up connections and supports inexpensive hardware such as USB and PCMCIA WiFi and ethernet cards. Hardware requirements: One dedicated computer with the following minimum specifications: 486 Processor, 16 MBytes of RAM, 2X CDRom reader, floppy drive, 1 or 2 ethernet cards. NO hard disk! Optionally a WIFI card.

DeLi Linux

DeLi Linux is a Linux distribution for old computers, from 486 to Pentium MMX 166 or so. It's focused on desktop usage. It includes email clients, a graphical Web browser, an office package with word processor and spreadsheet, etc. A full install, including XFree86 and development tools, needs no more than 300 MB of harddisk space.

Using Gentoo on Old Machines

"Old computers don't have to run old software. Old software does not have it's bugs covered and is bad for security. Most modern distros will be very sluggish when run on those machines; not because they use new software, but because they expect to be run on new machines and may automatically install large amounts of software. The thrust of Gentoo-on-old-hardware is to obtain a light, minimalist system that runs what you need it to and no more; unlike many proprietary OSes and the "heavier" distros such as Fedora, Gentoo starts very light by default."

FreeS/WAN

Linux FreeS/WAN provides IPSEC (IP Security, which is both encryption and authentication) kernel extensions and an IKE (Internet Key Exchange, keying and encrypted routing daemon) as well as various rc scripts and documentation. This lets a bright Linux sysadmin build VPN's gateways out of even old 584 and 486 PC Clone boxes. The 1.00 version is known to inter-operate with other IPSEC and IKE system already deployed by other vendors such as OpenBSD.

Print Server

A common use for an old computer is running a print server on it.

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.

Related HOWTOs

  • LBX-HOWTO LBX (Low Bandwidth X) is an X server extension which performs compression on the X protocol. It is meant to be used in conjunction with X applications and an X server which are separated by a slow network connection, to improve display and response time.

  • Small-Memory-HOWTO Describes how to run Linux on a system with a small amount of memory.

Introduction

To deal with limited space, memory, CPU speed and battery power, I have written this chapter.

Small Space

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.

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. 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
    

  • Perforation: 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.

  • 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. with a signature at the end.

  • Clean Temporary Files: , e.g. /tmp, there is even a tool tmpwatch.

  • Shorten the Log Files: usually the files in /var/log. There are some nice helpers for this task around, e.g. savelog .

  • Remove Files: Remove files which are not "necessary" under all circumstances such as man pages, documentation /usr/doc and sources e.g. /usr/src .

  • Unnecessary Libraries: You may use the binstats package to find unused libraries (Thanks to Tom Ed White).

  • Filesystem: Choose a filesystem which treats disk space economically e.g. rsfs aka Reiser Filesystem. Tune your filesystem e.g. tune2fs. Choose an appropriate partition and block size.

  • Reduce Kernel Size: Either by using only the necessary kernel features and/or making a compressed kernel image bzImage.

  • Compression: I didn't check this but AFAIK you may compress your filesystem with gzip and decompress it on the fly. Alternatively you may choose to compress only certain files. You can even execute compressed files with zexec

  • Compressed Filesystems:

    - For e2fs filesystems there is a compression version available e2compr , see 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

  • Partition Sharing: You may share swap-space (see Swap-Space-HOWTO) or data partitions between different OS (see mount). For mounting MS-DOS Windows95 compressed drives (doublespace, drivespace) you may use dmsdos http://metalab.unc.edu/pub/Linux/system/filesystems/dosfs/.

  • Libraries: Take another (older) library, for instance libc5 , this library seems to be smaller than libc6 aka glibc2 .

  • Kernel: If your needs are fitted with an older kernel version, you can save some space.

  • GUI: Avoid as much Graphical User Interface (GUI) as possible.

  • Tiny Distributions: There are some distributions available which fit from one 3.5" floppy to 10MB disk space and fit for small memories, too. See Laptop-HOWTO

  • Tailmerging for Ext2: Tailmerging is a technique that helps save space on a filesystem with large blocks and many small files. Tailmerging for Ext2 is an experimental extension for ext2 that packs together tail blocks of several files into a shared block.

Harddisk Speed

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 to different disks to increase performance.

Small Memory

Related HOWTOs

Techniques

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 course use swap space, when possible. If possible you may use the resources of another machine, for instance with X, VNC or even telnet. For more information on Virtual Network Computing (VNC), see VNC .

Low CPU Speed

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.

Tiny Applications and Distributions

A small collection yet, but I'm looking for more information.

  • BOA - "Lightweight and High Performance WebServer. 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."

  • MGR - a graphical windows system, which uses much less resources than X.

  • Low Bandwidth X - 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."

  • blackbox - "This is a window manager for X. It is similar in many respects to such popular packages as Window Maker, Enlightenment, and FVWM2. You might be interested in this package if you are tired of window managers that are a heavy drain on your system resources, but you still want an attractive and modern-looking interface."

  • linux-lite - distribution based on a 1.x.x kernel for systems with only 2MB memory and 10MB harddisk. URL see above.

  • smallLinux - http://www.superant.com/smalllinux/ . Three disk micro-distribution of Linux and utilities. Based on kernel 1.2.11. Root disk is ext2 format and has 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.

  • cLIeNUX - client-use-oriented Linux distribution.

  • minix - not a Linux but a UNIX useful for very small systems, such as 286 CPU and 640K RAM http://www.cs.vu.nl/~ast/minix.html . There is even X support named mini-x by David I. Bell ftp://ftp.linux.org.uk/pub/linux/alan/ .

  • screen - tiny but powerful console manager. John M. Fisk <fiskjm at ctrvax.vanderbilt.edu> in LINUX GAZETTE : "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." "screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. Each virtual terminal provides the functions of the DEC VT100 terminal and, in addition, several control functions from the ANSI X3.64 (ISO 6429) and ISO 2022 standards (e.g., insert/delete line and support for multiple character sets). Real multiuser support, split screen support, hardstatus emulation support, configurable window seperator and hardstatus strings, permanent window seperator, many new escapes, logfile timestamps and flush timeout, optional builtin telnet, optional Braille support, support for history compaction."

  • tinyirc - "A tiny, stripped down IRC Client. Doesn't have most of the more advance commands in the ircII family of IRC Clients, nor does it have any color, but it works, and it's tiny."

  • tinyproxy - "Tinyproxy is a lightweight HTTP proxy designed to do the job with a minimum of system resource use. It's ideal for small networks where a larger HTTP proxy such as squid might be overkill or a security risk. This simplicity also makes tinyproxy an ideal candidate for customization - it takes very little time to read and understand the tinyproxy source, and thus you can start adding your own desired features on short order."