4. Preparing booting

Before booting the client for the first time, you have to choose which medium you use for booting. Normally, you will configure the computer to boot via network card. The preferred method for booting is using PXE. PXE is the Preboot Execution Environment which most modern network cards support. Also booting from CD-ROM or from an USB stick is easy to set up.

4.1. Enabling PXE on a 3Com network card with boot PROM

If you have a 3Com network card that is equipped with a boot ROM by Lanworks Technologies or already includes the DynamicAccess Managed PC Boot Agent (MBA) software [5], you can enter the MBA setup by typing Ctrl+Alt+B during boot. The setup should look like this:

Managed PC Boot Agent (MBA) v4.00
(C) Copyright 1999 Lanworks Technologies Co. a subsidiary of 3Com Corporation
All rights reserved.
============================================================
                            Configuration

Boot Method:                PXE

Default Boot:               Network
Local Boot:                 Enabled
Config Message:             Enabled
Message Timeout:            3 Seconds
Boot Failure Prompt:        Wait for timeout
============================================================
  Use cursor keys to edit: Up/Down change field, Left/Right change value
  ESC to quit, F9 restore previous settings, F10 to save

Set the boot method to PXE (do not use RPL or BOOTP) and enable local boot in this menu. So the first boot device will be the network card using PXE, and the second should be the local hard disk. This has to be configured in the BIOS of your computer.

4.2. Booting from network card with a PXE conforming boot ROM

Almost all modern bootable network cards support the PXE boot environment. Some network cards (e.g. on notebooks) have a fixed boot configuration, so they can only use the PXE boot protocol. This requires a PXE Linux boot loader and a special version of the TFTP daemon, which is available in the Debian package tftpd-hpa.

First, install following additional needed packages:

faiserver# apt-get install dhcp3-server syslinux-common tftpd-hpa

Then set up the DHCP daemon. A sample configuration file can be found in /usr/share/doc/fai-doc/examples/etc/dhcpd.conf. Copy this file to /etc/dhcp3/dhcpd.conf.

The install client then loads the pxelinux boot loader which receives its configuration via TFTP from a file in the directory /srv/tftp/fai/pxelinux.cfg (defined by the variable $TFTPROOT in make-fai-nfsroot.conf). Using the command fai-chboot(8) you can define which kernel will be loaded by the PXE Linux loader and which additional parameters are passed to this kernel. You should read the manual pages, which give you some good examples.

See /usr/share/doc/syslinux/pxelinux.doc for more detailed information.

4.3. Creating a boot floppy

If your network card can't boot by itself, you can create a small boot floppy that uses etherboot, which will provide the PXE feature for your network card. So you can use DHCP and TFTP to get the install kernel that was created with mknbi-linux(8). A lot of ethernet cards support booting via ethernet if a special boot EPROM is inserted or booted from floppy provided by http://rom-o-matic.net. In depth documentation about booting via ethernet may be found at http://www.etherboot.org.

4.4. Booting from a CD-ROM

It's possible to perform an automatic installation from CD-ROM without an install server. The CD-ROM contains all data needed for the installation. The command fai-cd(8) puts the nfsroot, the configuration space and a subset of the Debian mirror onto a CD-ROM. The partial mirror is created using the command fai-mirror(1) which contains all packages that are used by the classes used in your configuration space. A sample ISO image is available at http://www.informatik.uni-koeln.de/fai/fai-cd.

4.5. Booting from USB stick

Using the command fai-cd(8) you can also create a bootable USB stick. First, format your stick with an ext2 file system (ext3 makes no sense on flash memory devices). Then mount it. After that call:

faiserver# fai-cd -m /path/to/mirror -u /path/to/mounted/stick

Then unmount the USB stick. The USB stick must be formatted with an ext2 file system. VFAT is not yet supported. Currently the file system that will be written onto the stick is not compressed.

4.6. Collecting Ethernet addresses

Now it's time to boot your install clients for the first time. They will fail to boot completely, because no BOOTP or DHCP daemon is running yet or recognizes the hosts. But you can use this first boot attempt to easily collect all Ethernet addresses of the network cards.

You have to collect all Ethernet (MAC) addresses of the install clients and assign a host name and IP address to each client. To collect all MAC addresses, now boot all your install clients. While the install clients are booting, they send broadcast packets to the LAN. You can log the MAC addresses of these hosts by running the following command simultaneously on the server:

faiserver# tcpdump -qtel broadcast and port bootpc >/tmp/mac.list

After the hosts have been sent some broadcast packets (they will fail to boot because bootpd isn't running or does not recognize the MAC address yet) abort tcpdump by typing ctrl-c. You get a list of all unique MAC addresses with these commands:

faiserver$ perl -ane 'print "\U$F[0]\n"' /tmp/mac.lis|sort|uniq

After that, you only have to assign these MAC addresses to host names and IP addresses (/etc/ethers and /etc/hosts or corresponding NIS maps). With this information you can configure your DHCP daemon (see the section [bootdhcp]). I recommend to write the MAC addresses (last three bytes will suffice if you have network cards from the same vendor) and the host name in the front of each chassis.

4.7. Configuration of the DHCP daemon

An example for dhcpd.conf(5) is available in /usr/share/doc/fai-doc/examples/etc/dhcpd.conf, which is working with version 3.x of the DHCP daemon. Start using this example and look at all options used therein. The only FAI specific information inside this configuration file is to set filename to fai/pxelinux.0 and to set next-server and server-name. All other information is only network related data, which is used in almost all DHCP configurations.

If you make any changes to the DHCP daemon configuration, you must restart the daemon.

# /etc/init.d/dhcp3-server restart

By default, the DHCP daemon writes its log files to /var/log/daemon.log. The command fai-chboot(8) is used for creating a per host configuration for the pxelinux environment.

4.8. Boot messages

When booting from network card with PXE you will see:

Managed PC Boot Agent (MBA) v4.00
.
.
Pre-boot eXecution Environment (PXE) v2.00
.
.
DHCP MAC ADDR: 00 04 75 74 6E 4A
DHCP.../
CLIENT IP: 192.168.1.12 MASK: 255.255.255.0  DHCP IP: 192.168.1.250
GATEWAY IP: 192.168.1.254

PXELINUX 3.71 (Debian-2008-09-06)  Copyright (C) 1994-2008 H. Peter Anvin
UNDI data segment at:   0009D740
UNDI data segment size: 3284
UNDI code segment at:   00090000
UNDI code segment size: 24C0
PXE entry point found (we hope) at 9D74:00F6
My Ip address seems to be C0A801C0 192.168.1.12
ip=192.168.1.12:192.168.1.250:192.168.1.254:255.255.255.0
TFTP prefix: fai/
Trying to load pxelinux.cfg/01-00-04-75-74-6e-4a
Trying to load pxelinux.cfg/C0A801C0
Loading vmlinuz-2.6.26-2-486.....................Ready.
Loading initrd.img-2.6.26-2-486..................................
Ready
Uncompressing Linux... OK, booting the Kernel.
Linux version 2.6.26-2-486 (Debian 2.6.26-4)
.
.
Done.
Mounting root file system.....
eth0: link up
RPC: Registered upd transport module.
RPC: Registered tcp transport module.
aufs 20080714
.
.
Begin: Running /scripts/live-premount ... done.
IP-Config: eth0 hardware address 00:0c:29:c9:81:38 mtu 1500 DHCP RARP
IP-Config: eth0 guessed broadcast address 192.168.1.255
IP-Config: eth0 complete (from 192.168.1.250):
 address: 192.168.1.12   broadcast: 192.168.1.255  netmask: 255.255.255.0
 gateway: 192.168.1.254  dns0     : 192.168.1.250  dns1   : 192.168.8.9
 host   : demohost
 domain : informatik.uni-koeln.de
 rootserver: 192.168.1.250 rootpath:
 filename  : pxelinux.0
Begin: Trying netboot from 192.168.1.250:/srv/fai/nfsroot ...
Begin: Trying nfsmount -o nolock -o ro 192.168.1.250:/srv/fai/nfsroot /live/image ...
.
.
          -------------------------------------------------
                Fully Automatic Installation  -  FAI

                FAI 3.3, 03 Nov 2009   (c) 1999-2009
            Thomas Lange  <lange@informatik.uni-koeln.de>
          -------------------------------------------------

Calling task_confdir
Kernel parameters: initrd=initrd.img-2.6.26-2-486 ip=dhcp root=/dev/nfs nfsroot=/srv/fai/nfsroot \
 boot=live FAI_FLAGS=verbose,sshd,createvt FAI_ACTION=install \
 FAI_CONFIG_SRC=nfs://kueppers/srv/fai/config BOOT_IMAGE=vmlinuz-2.6.26-2-486
Reading /tmp/fai/boot.log
FAI_FLAGS: verbose sshd createvt
FAI_CONFIG_SRC is set to nfs://kueppers/srv/fai/config
Configuration space kueppers:/srv/fai/config mounted to /var/lib/fai/config
Calling task_setup
Calling task_setup
FAI_FLAGS: verbose sshd createvt
Fri Oct 30 14:34:37 UTC 2009
30 Oct 14:34:37 ntpdate[3279]: step time server 134.95.4.129 offset 5.691554 sec
Press ctrl-c to interrupt FAI and to get a shell
Calling task_defclass
fai-class: Defining classes.
Executing /var/lib/fai/config/class/10-base-classes.
10-base-classes      OK.
Executing /var/lib/fai/config/class/20-hwdetect.source.
.
.
50-host-classes      OK.
List of all classes: DEFAULT LINUX I386 FAIBASE DHCPC DEMO GRUB demohost LAST
Calling task_defvar
Executing FAIBASE.var
++ FAI_ALLOW_UNSIGNED=1
++ CONSOLEFONT=
++ KEYMAP=us-latin1
++ UTC=yes
++ TIMEZONE=Europe/Berlin
++ ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
++ STOP_ON_ERROR=700
++ USE_SETUP_STORAGE=1
Loading keymap(s) us-latin1 ...done.
Calling task_action
FAI_ACTION: install
Performing FAI installation. All data may be overwritten!

When the copyright message of FAI is shown, the install client has mounted the nfsroot [6] to the clients' root directory. This is the whole file system for the client at this moment.

After task_confdir is executed, the configuration space is mounted via NFS.

Before the installation is started ($FAI_ACTION=install) the computer beeps three times. So, be careful when you hear three beeps but you do not want to perform an installation!

4.8.1. Troubleshooting the boot messages

This is the error message you will see, when your network card is working, but the install server does not export the configuration space directory to the install clients, mostly a problem of missing permissions on the server side.

Begin: Mounting root file system... ...
eth0: link up

BusyBox v1.10.2 (Debian 1:1.10.2-1) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
/bin/sh: can't access tty: job control turned off
(initramfs)

You will get a shell prompt and can look at the log files, for examples /live.log or /tmp/net-eth0.conf. You can also enter the initramfs shell for debugging if you append the parameter break to the kernel command line.

Use the following command on the install server to see which directories are exported from the install server (named faiserver):

$ showmount -e faiserver

The following error message indicates that your install client doesn't get an answer from a DHCP server. Check your cables or start the dhcpd(8) daemon with the debug flag enabled.

PXE-E51: No DHCP or BOOTP offers received
Network boot aborted

If you get the following error message, the install kernel could not detect your network card, for example because of a missing driver:

Begin: Mounting root file system... ...
Kernel panic - not syncing: Attempted to kill init!

Check the initrd in the nfsroot if the kernel driver of your network card is included there.

4.9. Collecting other system information

Now the clients have booted with $FAI_ACTION set to sysinfo. Type ctrl-c to get a shell or use Alt-F2 or Alt-F3 and you will get another console terminal, if you have added createvt to $FAI_FLAGS.

Remote login is available via the secure shell if sshd is added to $FAI_FLAGS. The encrypted password is set with the variable $FAI_ROOTPW in make-fai-nfsroot.conf and defaults to "fai". You can create the encrypted password using mkpasswd(1) and use the crypt(3) or md5 algorithm. This is only the root password during the installation process, not for the new installed system. You can also log in without a password when using $SSH_IDENTITY. To log in from your server to the install client (named demohost in this example) use:

$ ssh root@demohost
Warning: Permanently added 'demohost,134.95.9.200' to the list of known hosts.
root@demohost's password:

You now have a running Linux system on the install client without using the local hard disk. Use this as a rescue system if your local disk is damaged or the computer can't boot properly from hard disk. You will get a shell and you can execute various commands (dmesg, lsmod, df, lspci, …). Look at the log file in /tmp/fai. There you can find much information about the boot process.

All log files from /tmp/fai are also written to the $LOGSERVER (if not defined: the server defined by $SERVER from get-boot-info) into the directory ~fai/demohost/sysinfo/.

Two additional symbolic links are created. The symlink last points to the log directory of the last fai action performed. The symlinks last-install and last-sysinfo point to the directory with of the last corresponding action. Examples of the log files can be found on the FAI homepage.

FAI mounts all file systems it finds on the local disks read only. It also tells you on which partition a file /etc/fstab exists. When only one file system table is found, the partitions are mounted according to this information. Here's an example:

demohost:~# df
Filesystem      1K-blocks      Used Available Use% Mounted on
rootfs            4099064    414088   3645296  11% /
udev                10240        76     10164   1% /dev
192.168.1.250:/srv/fai/nfsroot
                  3905600    410976   3454944  11% /live/image
aufs              4099064    414088   3645296  11% /
tmpfs              193464         0    193416   0% /live
tmpfs              193464      3112    190352   2% /live/cow
faiserver:/srv/fai/config
                  3905600    410976   3454944  11% /var/lib/fai/config
/dev/sda1          241116     74519    154149  33% /target
/dev/sda9         4364212    139888   4179988   4% /target/home
/dev/sda7          553376     16840    536536   4% /target/tmp
/dev/sda8         2221628    275936   1832840  14% /target/usr
/dev/sda6          577096    172924    374856  32% /target/var
aufs               193464      2376    191243   2% /target/dev

This method can be used as a rescue environment! If you need a file system with read-write access use the rwmount command:

demohost# rwmount /target/home

4.10. Checking parameters from DHCP servers

If the install client boots with action sysinfo, you can also check if all information from the DHCP daemon are received correctly. The received information is written to /tmp/fai/boot.log. An example of the result of a DHCP request can be found in [setuproutines].

4.11. Rebooting the computer

At any time you can reboot the computer using the command faireboot, also if logged in from remote. If the installation hasn't finished, use faireboot -s, so the log files are also copied to the install server.



[5] http://support.3com.com/infodeli/tools/nic/mba.htm

[6] /srv/fai/nfsroot from the install server