The Installation Backend: FAI

We have designed our Linux system so that it is easy for volunteers to install. As such, you don't need to know very much about the installation process in order to get Linux on a computer.

Having said that, understanding the machinery behind the install can be helpful. If nothing else, it will help you troubleshoot the installation process when installs fail. Learning about the installation process helps the Linux project, too: it helps volunteers understand Linux better, and it gives the project security in case the current administrators stop volunteering.

The next section introduces FAI, and documents some resources that can help you understand the package. Next, we explain the installation process - from bootup to configuration - in some detail.

FAI overview

The software we use for our backend is called FAI (Fully Automated Install). It is a set of scripts that allows Linux to be installed on many workstations at once, without human intervention. FAI can be customized to suit local needs, and we have customized FAI to install our subset of Debian automatically.

In our project, FAI scripts are responsible for:

We do not yet exploit the full functionality of FAI. One problem is that we face many different hardware configurations. We have not figured out how to automatically detect and select packages specific to hardware, monitors and mice, so we rely on volunteers to configure X. Similarly, volunteers must create user accounts on the system. As our Linux installation matures, we may be able to automate some of these things as well.

FAI resources

The homepage for FAI is . This page offers the latest version of the FAI manual, and archives of the FAI mailing list.

The FAI manual is also installed locally on the server. You can find it at


Working through the manual and setting up FAI is the best way to understand the system. Failing that, working through the manual and comparing that to the files on our server is good too.

FAI tips

FAI logfiles

FAI logs configuration information and runtime messages into a directory full of logfiles. During the installation process, you can access these logfiles in the directory


After installation, you can find the logfiles in the directory


on the client machine, where hostname is the name of the machine.

Log files of interest include:


The boot process of our FAI installation goes through the following steps:

  1. The BIOS finds LILO on the boot floppy.

  2. LILO loads a Linux kernel from the floppy.

  3. LILO connects to the network and NFS-mounts a Linux filesystem that sits on the server. This filesystem contains the FAI installer, which begins execution.

  4. The installer NFS-mounts the FAI configuration files off the server. (Check this -P.)

After these steps, the FAI installer is ready to partition the local hard disks, mount local hard drives and install program files.

The following subsections explain the startup process in more detail.

BIOS and the boot loader

The BIOS of a computer contains basic information the computer needs to interact with its components. Part of the BIOS's job is to look for boot information for the computer's operating system.

The BIOS is not very smart. It knows some locations where the boot information may exist - the boot sequence - and it knows how to load enough information from those locations to get the rest of the boot loader going.

Most BIOSes allow you to boot from the floppy or the hard drive. Some allow booting from CD-ROMs, and a few allow direct booting off a network, using a network card.

Our installation uses a bootable floppy for installation. The first few sectors of the floppy contain LILO, a boot loader for Linux. The BIOS finds LILO, loads it into memory and executes it.


LILO stands for LInux LOader. Its job is to tell the computer where to find Linux components. LILO can also be used to boot other operating systems (such as Windows 95), but we do not use that functionality in FAI.

In order to boot Linux, LILO needs two pieces of information:

Kernel location: The Linux kernel is the core of the operating system. It is a program that serves as an interface between the computer's hardware and software, managing system resources, allowing access to hardware, and interacting with application programs.

There may be several different versions of the Linux kernel on a computer. LILO needs to know which one to use, and where to find it. In our installations, the kernel is located on the boot floppy disk.

Root location: The root directory is the top of the directory structure. The directory structure contains all of the user programs and data present on the system. The directory structure may be spread over many hard drives, but it has a single root directory. (The hard drive partition that contains the root directory is called the root partition.)

LILO needs to know the location of this root directory, so that it can mount the directory tree. Other filesystems (on hard drives, CD-ROMS or the network) can then be mounted relative to the root.

On standalone Linux systems, the root directory is often located on the same partition as the kernel. However, this is not required, and in our installation the root directory is located on the server. It is accessible via a protocol called NFS. LILO is smart enough to know about NFS, and it is able to tell the kernel where to find the root directory that should be used for booting.

On our server, the NFS root directory is:


Permission for the server to export this directory is contained in the /etc/exports file.

(Where should I be talking about NFS? Here, or elsewhere? -P.)


Traditionally, when Linux boots it executes startup scripts. These scripts start services, such as X-Windows and the printing daemon. On Debian, these scripts can be found in /etc/init.d/ .

To start the install, FAI includes a script in the /etc/init.d directory called rcS_fai . The Linux kernel finds this script (or rather, a symbolic link to this file) and starts executing it.

rcS_fai contains the control code for FAI. It is the installer program; its job is to co-ordinate the installation process, calling subroutines that carry out each stage of the install.


Once the installer has started, installation proceeds in the following steps:

  1. Classes are defined.

  2. Local hard drives are partitioned and formatted.

  3. Packages get installed and configured.

  4. Local configuration changes are made.

  5. GRUB is installed onto the local hard drive.

The FAI manual goes through each of these steps in detail. Over the next few sections, we will describe the basic ideas, and document local changes we made for our project.

FAI classes

FAI has the capability to install many different Linux configurations at the same time. Different configurations are specified by classes - labels that specify which configuration files FAI should use in the installation.

Each installation starts out with three classes defined: DEFAULT, LAST and a class labelled with the client's hostname.

Once an installation starts, one of the installer's first jobs is to figure out what additional classes (if any) should be defined. To do this, FAI looks in

/usr/local/share/fai/installer/classes/ .

Three different kinds of files are allowed in this directory:

The installer executes any scripts matching the name of an existing class. This may define new classes, so the process iterates until no more classes have been defined. Finally, scripts of the form classname.var are executed.

We explain relevant classes in the parts of the installation where they are used. Hostnames in the classes/ directory which directly pertain to class definition are:

This hostname does not call any of the standard packages or classes. It is meant as a testing hostname, so that administrators can fiddle around with new features while other people are doing standard installations.

wc_191 ... wc_198:
Each one of our standard installation FAI floppies is given one of these names. Hosts with these names use the standard disk partitioning and formatting, and choose the amount of software to install based on the local hard drive size.

The names themselves are defined in .

Partitioning Hard Drives

In this phase, the installer looks in /usr/local/share/fai/installer/disk_config for partitioning information. It should partition the local hard drive(s) according to the information specified in exactly one of these files, which means exactly one class should match a filename in this directory.

FAI partitions the local hard drive(s) according to the information it finds in this file. It also formats the partitions appropriately.

One big advantage of these files is that they are robust with respect to hard drive sizes. They can size partitions proportionally according to the size of the hard drive.

(What happens if there are multiple matches? -P.)

The format of these files is described in the FAI manual. We have defined the following classes:

This configures a single IDE drive. It wipes out the entire drive, then creates three partitions:

As well, this file specifies that all partitions should be checked for errors as they are formatted. (This is the “-c” option.)

Like TWCN_DISK, except that the swap size is fixed at 32MB.

Like TWCN_DISK, except that the swap size is fixed at 64MB.

Like TWCN_DISK, except that hard drives are not checked for errors. For new installs, you should not use this class. Checking for hard drive errors adds time to the install, but it saves a lot of headaches later on.

Other classes we should add include:

After the hard drives have been partitioned and formatted, they are mounted. In Linux, hard drives must be mounted before the system can access their data.

The root partition is mounted to /tmp/target/ . Any other partitions are mounted relative to this point. For example, if we create a partition that should end up at /usr/local/ , the installer will mount this partition to /tmp/target/usr/local/ .

Base package installation

A certain subset of the Debian distribution is labelled “required”, and another subset is labelled “important”. These packages make up a barebones Debian installation.

A program called debootstrap is responsible for downloading these packages and unpacking them into /tmp/target/ .

The packages that debootstrap installs are listed in /usr/lib/debootstrap/scripts/ on the server.

Package installation

Once the local hard drives have been prepared, package installation begins. The installer NFS-mounts the local mirror on the server. It then downloads and installs packages according to the classes defined in


The contents of every file matching a defined class name are used.

Again, the format of these configuration files is described in the FAI manual.

(Where can readers find out about Debian packaging policies? -P.)

Below, we document some of the more notable package configuration classes we use. This list is undoubtedly incomplete:

We have changed this file significantly from the version shipped with FAI. We consider the default installation to include very few packages: basically just a few useful utilities not provided by UNIXLIKE:

(Is this it? -P.)

This package contains X-Window functionality; all the packages needed for graphical mode except the X-server packages.

This includes almost all packages in the “standard” Debian distribution. We want this because FAI will (correctly) not install these packages by default.

These packages provide most of the functionality that one would find on a standard Linux or UNIX system, with the following exceptions:

This package contains applications that make Linux look like Windows. Here is an incomplete list of some of the things it includes:

These packages are graphical. They have a lot of dependencies.

This is the DEFAULT class that ships with FAI. We do not use it.

emacs is a super powerful text editor. However, it is large and thus optional.

The development tools (gcc and its friends) that we removed from the default package installation.

SGML development. No installation uses this yet.

TEX and LATEX development, which is removed from the default installation.

The gnumeric spreadsheet. Originally we included this spreadsheet by default, and it is installed in STANDARD installations, but we took it out of WINLIKE to save space on systems with smaller hard drives, and because it appears that many people do not use spreadsheets.

A rudimentary desktop publishing program. It is more cute than functional now, but is useful for making posters.

The abiword word processor has some extra components not necessary for operation, such as clip art. We take these packages out for smaller installations.

Currently only used by the TINY installation, this is an alternative office suite. It consists of a word processor, a spreadsheet and an animation program.

Some bigger but useful utilities for managing Debian packages. aptitude is a useful front-end command-line apt-get utilities. deborphan is used to discover packages that can be safely removed from the system.

This package is obsolete, because we now include aptitude in the DEFAULT package.

Packages we should add include:

FAI's package configuration system is powerful and useful, but it has its quirks:


In order to make our setup look like Windows, we have to tweak some configuration files. You can find the code that executes these tweaks in the installer/hooks and installer/scripts directories.

To learn about specific tweaks we make to our applications, see Section 8.1.

Finishing up

The LAST class triggers operations that clean up the Linux installation.

The GRUB and BOOT classes together trigger the BOOT script, which makes the computer bootable. The kernel to install is specified in installer/class/DEFAULT.var . The corresponding kernel package is located in installer/files/packages/