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:
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.
Some of the popular shells for Linux, such as
bash
and tcsh
, are large and require many libraries.shells/
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://sunsite.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.
libraries/ 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
strip/objcopy/libraries, stripping/ When copying libraries, use:
objcopy --strip-debug FROM TO
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. utility diskette/
ramdisk/
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; for such cases a root filesystem can be built that is mounted directly instead of copied to ramdisk.
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 far less space available.
mke2fs
, create a root filesystem on a diskette of the
appropriate size.
rdev
's as
described.rdev/ramdisk word/
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.
utility diskette/
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:
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, 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
).
Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter