Installation walkthrough

From FAIWiki
Jump to: navigation, search



Why 4.0? It comes with out-of-the-box support for multiple interfaces thanks to dracut.

Why this document? Installing FAI is very simple, but there are a couple of common pitfalls. So - before you attempt to use any of the fancy features (like splitting the FAI-server into multiple components, installing multiple operating systems, etc.) make sure you got the basics right. This will help you to get up to speed and this will help the mailing list to avoid answering the same common problems over and over again. ;) This document intentionally describes a full bare-bones installation and not just the 'interesting' parts in order to (hopefully) avoid any kind of trouble.

Important This document assumes you have a nice little subnet all for yourself which is separated physically or via a VLAN from any other network. If you don't then you MUST not configure the DHCP Server as described or else your colleagues and your network administrators WILL most definitely hate you.

This document assumes the following network configuration:

Type Value
Network /
Server (TFTP, NFS, FAI)
ClientIP range -

operating system

initial install from CD-ROM

Debian Squeeze 6.0.7 (64bit)

- minimal installation
- sources: main + security (no contrib / non-free / volatile)
- no additional software collections

We only need a very minimal operating system. It is strongly suggested to start your first steps into the FAI world by installing a Debian FAI-Server and Debian Clients. (Server and client can be mixed however you like - but for starters let's stick to the simplest and best supported case. Installing a 64bit server is preferred because it makes installing 32bit clients a bit easier then installing 64bit clients from a 32bit server.)

upgrade to wheezy (for fai 4.x)

edit /etc/apt/sources.list

  • remove all sources relating to the installation CD/DVD
  • replace all occurrences of 'squeeze' with 'wheezy'
aptitude update
aptitude dist-upgrade
aptitude clean

post-install configuration

  • edit /etc/network/interfaces and configure a static ip address (makes remote login easier)
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static

Install OpenSSH to access this machine remotely

aptitude install openssh-server

configure FAI server

install FAI software package

The current version as of 2013-02-26 is 4.0.6 (provided by debian repository and

aptitude install fai-server fai-doc

configure DHCP daemon

# configuration file for ISC dhcpd for Debian

# (Going boom early is good. It makes debugging easier.)

ddns-update-style none;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

subnet netmask {
	# network settings
	option domain-name         "installnet.invalid";
	option domain-name-servers;
	option routers   ;

	# client IP allocation
	range    ;
	default-lease-time 60;
	max-lease-time     720;

	# PXE boot server
	filename    "fai/pxelinux.0";

This config file is stripped down to a minimum. Simply allocate an ip address to whoever is asking. If you run into trouble check '/var/log/syslog'.

configure TFTP server

The installation default is for the tftp-daemon to run in 'standalone' mode. If the netstat output does not show 'in.tftpd' then you are using either a different tftp server or it is handled via inetd/xinetd. The server in itself will continue to work just fine, but you may have to check other config files for the configured tftp root directory.

netstat -anp|grep :69
udp        0      0    *                           29269/in.tftpd

This tftp server is running in standalone mode. Now let's check its configuration for the root directory:

cat /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa

Exactly where I like it to be. Another possible value would be '/var/lib/tftpboot'. There's nothing wrong with that, but you have to make sure that FAI is configured for the proper directory or the PXE-boot process will fail.

configure FAI itself

install GPG key for

gpg -a --recv-keys DC13E54EAB9B66FD; gpg -a --export DC13E54EAB9B66FD | apt-key add -

Please note: This is slightly different then the description on <>.

create NFS directory layout, configure /etc/exports, setup log user

echo '/srv/fai/config,ro,no_subtree_check,no_root_squash)' >> /etc/exports
/etc/init.d/nfs-kernel-server restart

(One could use 'exportfs -r' instead of the restart, but I want to make sure that the NFS server is truly started.)

create minimal configspace directory layout

for dir in class disk_config package_config scripts ; do
  mkdir -p /srv/fai/config/$dir

(This is just enough to make the installation not fail due to missing directories - this will NOT produce a useable installation!)

generate a fai-client configuration for ALL clients

 fai-chboot -B -I default

(This ~will~ attempt to reinstall any PXE-booting client!)

testing the installation

The following minimal client configuration is assumed:

  • a CPU
  • enough RAM to start the installation (at least about 200MB??)
  • an empty disk containing at least 250MB of disk space
  • a network interface connected to the FAI install network
  • boot device order: disk, network

single network interface

the most basic of configurations

  • create a client with a single network interface connected to the fai network
  • boot the client

-> expected result: fai starts, but drops out into a 'root@(none):/#' prompt

possible problem sources: DHCP, TFTP, NFS

Please note: In previous 4.0 releases there was a problem were the FAI nfsroot did not properly configure NFSv4. The fai client mounted the nfsroot seemingly successfully but complained about missing file permissions. You may or may not run into this issue when running 4.0.6 or later. (The exact circumstances under which this issue triggers are unknown to me. ThomasNeumann 21:45, 15 March 2013 (UTC))

If you get an error similar to this one (emphasis added)

[   11.578824] dracut: Mounted root filesystem a.b.c.d:/srv/fai/wheezy/nfsroot-amd64
[   11.581213] aufs: module is from the staging directory, the quality is unknown, you have been warned
[   11.582117] aufs 3.2-20120827 warning: can't open /etc/fstab: No such file or directory
[   12.010629] aufs test_add:261:mount[366]: uid/gid/perm /live/image 65534/65534/0755, 0/0/01777
[   12.015811] type=1702 audit(1358959337.356:2): op=follow_link action=denied pid=371 comm="ls" [...]
[   12.015995] type=1702 audit(1358959337.356:2): op=follow_link action=denied pid=371 comm="ls" [...]
[   12.260523] dracut: Switching root  pcbind: rpcbind terminating on signal. Restart with "rpcbind -u" [...]
[   12.262090] Kernel panic - not syncing: attempting to kill init!

(The most relevant message is in line 3. The highlighted text hints at a permission problem due to NFSv4 not properly mapping the user id's.)

then try to manually change the 'nfsboot'-setting in /srv/tftp/fai/pxelinux.cfg/default from

append initrd=initrd.img-3.2.0-4-amd64 ip=dhcp  root=/dev/nfs nfsroot=/srv/fai/nfsroot aufs [...]


append initrd=initrd.img-3.2.0-4-amd64 ip=dhcp  root=/dev/nfs nfsroot= aufs [...]

In other words change nfsroot directory from <directory> to <NFS-server IP>:<directory>:vers=3

related Debian Bug reports:

multiple network interface

Since FAI 4.0 / dracut-network supports netbooting with multiple network interfaces. We're going to test that thoroughly. The main goal is to prove whether any given client can boot from the network regardless if the 'primary' or 'secondary' network interface is connected to the FAI install network. (Common failure symptoms are 'installation did not start' and 'Client hangs / times out during installation' )

  • add a second network interface to the client
  • connect second interface to somewhere different (It must NOT able to reach the fai install network!)
  • boot the client

-> expected result: fai starts after a long timeout, but drops out into a 'root@(none):/#' prompt

  • switch configured network interfaces with each other
  • boot the client

-> expected result: fai starts after a long timeout, but drops out into a 'root@(none):/#' prompt

  • configure both network interfaces so they can't reach the fai install network
  • boot the client

-> expected result: client does not PXE-boot

(Untested: Connect both interfaces to the FAI install network.)

accessing the config space

update the client config to use a config space

fai-chboot -B -I -u nfs:// default
  • Create a client with a single network interface connected to the fai network
  • boot the client

-> expected result: fai starts, and reports about actually starting the installation, but finally drops out into a 'root@(none):/#' prompt

possible problem sources: NFS

using a minimal disk layout

create and edit '/srv/fai/config/disk_config/DEFAULT'

# an extremely simple layout
disk_config disk1 disklabel:msdos
primary /      250      ext3  rw
  • reuse previous client
  • boot the client

-> expected result: fai does a complete installation and reboots the client afterwards

(Due to lack of configuration a dysfunctional client is installed. It must be manually terminated.)

test for LVM-related bugs

modify '/srv/fai/config/disk_config/DEFAULT'

# configure LVM
disk_config disk1 disklabel:msdos
primary -      250      - -

disk_config lvm
vg  vg_system   disk1.1
vg_system-root          /     100    ext4    rw
vg_system-var           /var  100    ext4    rw
  • create a new client or make sure the client performs a netboot
  • boot the client

-> expected result: fai stops installation because tar runs out of diskspace

  • reuse the previous client, make sure the client performs a netboot
  • boot the client

-> expected result: dracut finds a volume group and does NOT mount nfsroot


  • modify client pxeboot configuration
fai-chboot -B -I -u nfs:// -k rd_NO_LVM default
  • reuse the previous client, make sure the client performs a netboot
  • boot the client

-> expected result: fai starts again, but stops with a 'FATAL ERROR'

Solution: No truly accepted solution. It's an unfixed bug in setup_storage. Inofficial patches against setup-storage are available.

related Debian Bug reports:

install a bootable client

For this we need some more files. This is the bare minimum you need to install a Debian Wheezy client from a Debian Wheezy server. I intentionally skip anything that is not essential.


# root password for the new installed linux system; md5 and crypt are possible
# pw is "fai"


# provide just a root partition
disk_config disk1 disklabel:msdos
primary /      1024-         ext3 rw


# a very simplistic package collection
# (just install the bare minimum amount of packages)

PACKAGES aptitude

# explicitely delete these bootloaders
# (just in case the base tgz contains them)
PACKAGES aptitude



# set root password
$ROOTCMD usermod -p $ROOTPW root


# support for GRUB version 2 (1.98-1)

error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code

set -a

# during softupdate use this file
[ -r $LOGDIR/ ] && . $LOGDIR/

[ -z "$BOOT_DEVICE" ]    && exit 701

$ROOTCMD grub-mkdevicemap --no-floppy
GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
# see
GROOT=$(echo $GROOT | sed 's:md/:md:g')

$ROOTCMD grub-install --no-floppy "$GROOT"
echo "Grub installed on $BOOT_DEVICE = $GROOT"

$ROOTCMD update-grub

exit $error

go for it!

Start your test client and watch it go. Should proceed pretty fast, most of the time is spent with downloading packages and installing them. After about 2 minutes more or less the client reboots and presents you with a nice login prompt. At least it should. ;)


Congratulations. Your FAI-server is now fully functional and you can start your own experiments.

Personal tools