Next Previous Contents

8. Miscellaneous topics.

8.1 Reducing root filesystem size.

Sometimes a root filesystem is too large to fit on a diskette even after compression. Here are some ways to reduce the filesystem size, listed in decreasing order of effectiveness:

Increase the disk density

By default, floppy diskettes are formatted at 1440K, but higher density formats are available. fdformat will format disks for the following sizes: 1600, 1680, 1722, 1743, 1760, 1840, and 1920. Most 1440K drives will support 1722K, and this is what I always use for bootdisks. See the fdformat man page and /usr/src/linux/Documentation/devices.txt.

Replace your shell

Some of the popular shells for Linux, such as bash and tcsh, are large and require many libraries. Light-weight alternatives exist, such as ash, lsh, kiss and smash, which are much smaller and require few (or no) libraries. Most of these replacement shells are available from http://metalab.unc.edu/pub/Linux/system/shells/. Make sure any shell you use is capable of running commands in all the rc files you include on your bootdisk.

Strip libraries and binaries

Many libraries and binaries are typically unstripped (include debugging symbols). Running 'file' on these files will tell you 'not stripped' if so. When copying binaries to your root filesystem, it is good practice to use:

        objcopy --strip-all FROM TO

When copying libraries, use:

        objcopy --strip-debug FROM TO

Move non-critical files to a utility disk

If some of your binaries are not needed immediately to boot or login, you can move them to a utility disk. See section Building a utility disk for details. You may also consider moving modules to a utility disk as well.

8.2 Non-ramdisk root filesystems.

Section Building a root filesystem gave instructions for building a compressed root filesystem which is loaded to ramdisk when the system boots. This method has many advantages so it is commonly used. However, some systems with little memory cannot afford the RAM needed for this, and they must use root filesystems mounted directly from the diskette.

Such filesystems are actually easier to build than compressed root filesystems because they can be built on a diskette rather than on some other device, and they do not have to be compressed. We will outline the procedure as it differs from the instructions above. If you choose to do this, keep in mind that you will have much less space available.

  1. Calculate how much space you will have available for root files. If you are building a single boot/root disk, you must fit all blocks for the kernel plus all blocks for the root filesystem on the one disk.
  2. Using mke2fs, create a root filesystem on a diskette of the appropriate size.
  3. Populate the filesystem as described above.
  4. When done, unmount the filesystem and transfer it to a disk file but do not compress it.
  5. Transfer the kernel to a floppy diskette, as described above. When calculating the ramdisk word, set bit 14 to zero, to indicate that the root filesystem is not to be loaded to ramdisk. Run the rdev's as described.
  6. Transfer the root filesystem as before.

There are several shortcuts you can take. If you are building a two-disk set, you can build the complete root filesystem directly on the second disk and you need not transfer it to a hard disk file and then back. Also, if you are building a single boot/root disk and using LILO, you can build a single filesystem on the entire disk, containing the kernel, LILO files and root files, and simply run LILO as the last step.

8.3 Building a utility disk.

Building a utility disk is relatively easy -- simply create a filesystem on a formatted disk and copy files to it. To use it with a bootdisk, mount it manually after the system is booted.

In the instructions above, we mentioned that the utility disk could be mounted as /usr. In this case, binaries could be placed into a /bin directory on your utility disk, so that placing /usr/bin in your path will access them. Additional libraries needed by the binaries are placed in /lib on the utility disk.

There are several important points to keep in mind when designing a utility disk:

  1. Do not place critical system binaries or libraries onto the utility disk, since it will not be mountable until after the system has booted.
  2. You cannot access a floppy diskette and a floppy tape drive simultaneously. This means that if you have a floppy tape drive, you will not be able to access it while your utility disk is mounted.
  3. Access to files on the utility disk will be slow.

Appendix Sample utility disk directory listing shows a sample of files on a utility disk. Here are some ideas for files you may find useful: programs for examining and manipulating disks (format, fdisk) and filesystems (mke2fs, fsck, debugfs, isofs.o), a lightweight text editor (elvis, jove), compression and archive utilities (gzip, tar, cpio, afio), tape utilities (mt, tob, taper), communications utilities (ppp.o, slip.o, minicom) and utilities for devices (setserial, mknod).


Next Previous Contents