[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ next ]

FAI Guide (Fully Automatic Installation)
Chapter 3 - Preparing booting


Before booting for the first time, you have to choose which medium you use for booting. You can use the boot floppy or configure the computer to boot via network card using a boot PROM, which is much smarter.


3.1 Booting from 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[6], you can enter the MBA setup by typing Ctrl+Alt+B during boot. The setup will 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 or set it to TCP/IP and the protocol to BOOTP. The advantage of the BOOTP protocol it, that the BOOTP daemon automatically reloads its configuration when it has changed, but using the PXE environment is more comfortable. When using BOOTP, you have to make a symbolic link from the hostname of your client to the appropriate kernel image in /boot/fai. You can also use the utility tlink (/usr/share/doc/fai/examples/utils/tlink) to create this link. The file installimage_3com is created by imggen and is suitable for booting 3Com network cards[7].


3.2 Booting from network card with a PXE conforming boot ROM

Most modern bootable network cards support the PXE boot environment. Some network cards (e.g. Intel EtherExpress PRO 100) 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:

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

Then set up the DHCP daemon. A sample configuration files can be found in /usr/share/doc/fai/examples/etc/dhcpd.conf. Copy this file to /etc/dhcp3/dhcpd.conf. Then enable the special tftp daemon using this line in file /etc/inetd.conf:

     tftp dgram udp wait root /usr/sbin/in.tftpd in.tftpd -r blksize -s /boot/fai

See /usr/share/doc/syslinux/pxelinux.doc.gz for more information about how to boot such an environment. There are also some mails in the FAI mailing list archive concerning this topic. The PXE environment uses the original kernel image (not the netboot image made by mknbi-linux) which is copied to /boot/fai/vmlinuz-install. Using the command fai-chboot(8) you can select which kernel will be loaded by the PXE linux loader. You should read the manual pages, which also gives you some good examples.


3.3 Creating a boot floppy

If your network card can't boot itself, you have two options. The first is to create a small boot floppy that uses etherboot, 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 http://rom-o-matic.net/. In depth documentation about booting via ethernet may be found at http://etherboot.sourceforge.net. The second option is to boot via floppy disk that is created with the command make-fai-bootfloppy(8). Since there's no client specific information on this floppy, it's suitable for all your install clients. You can also specify additional kernel parameters for this boot floppy or set other variables, if desired. Do not enable BOOTP support when you have a DHCP server running in your network and vice versa. This could lead to missing information. There's also a manual page for make-fai-bootfloppy(8). If you have no BOOTP or DHCP server, supply the network configuration as kernel parameters. The format is:

ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>

For additional information see /usr/src/linux/Documentation/nfsroot.txt in the kernel sources.


3.4 Booting from a CD-ROM

There some ongoing work to create a bootable CD-ROM which can boot and install an install client. Currently this script is not included in the FAI package but a beta version is available. It will contain the nfsroot, the configuration space and a subset of the Debian mirror, which contains all packages that you need for an unattended installation. Look at the mailing list archive of FAI for more information. A first version is available at http://holbytla.org/fai/.


3.5 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 hostname 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:

     # tcpdump -qte broadcast and port bootpc >/tmp/mac.lis

After the hosts has 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:

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

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


3.6 Configuration of the BOOTP daemon

You should only use this method if you can't use a DHCP server, since it's easier to create and manage the configuration for DHCP. An example configuration for the BOOTP daemon can be found in /usr/share/doc/fai/examples/etc/bootptab.

     # /etc/bootptab example for FAI
     # replace FAISERVER with the name of your install server
     
     .faiglobal:\
      :ms=1024:\
      :hd=/boot/fai:\
      :hn:bs=auto:\
      :rp=/usr/lib/fai/nfsroot:
     
     .failocal:\
      :tc=.faiglobal:\
      :sa=FAISERVER:\
      :ts=FAISERVER:\
      :sm=255.255.255.0:\
      :gw=134.95.9.254:\
      :dn=informatik.uni-koeln.de:\
      :ds=134.95.9.136,134.95.100.209,134.95.100.208,134.95.140.208:\
      :ys=rubens:yd=informatik4711.YP:\
      :nt=time.rrz.uni-koeln.de,time2.rrz.uni-koeln.de:
     
     # now one entry for each install client
     demohost:ha=0x00105A240012:bf=demohost:tc=.failocal:T172="verbose sshd createvt debug":
     ant01:ha=0x00105A000000:bf=ant01:tc=.failocal:T172="sshd":

Insert one line for each install client at the end of this file as done for the hosts demohost and ant01. Replace the string FAISERVER with the name of your install server. If the install server has multiple network cards and host names, use the host name of the network card to which the install clients are connected. Then adjust the other network tags (sm, gw, dn, ds) to your local needs.

sm:
Subnet mask
gw:
Default gateway / router
dn:
Domain name
ds:
List of DNS server. The /etc/resolv.conf file will be created using this list of DNS servers and the domain name.
T172:
List of FAI_FLAGS; e.g. verbose, debug, reboot, createvt, sshd, syslogd

The tags for NIS and time servers (yp, yd, nt) are optional. Tags with prefix T (starting from T170) are generic tags which are used to transfer some FAI specific data to the clients[8] The list of FAI_FLAGS can be space or comma separated. FAI_FLAGS in bootptab must be separated by whitespace. If you define FAI_FLAGS as an additional kernel parameter, the flags must be separated with a comma. If you do not have full control over the BOOTP or DHCP daemon (because this service is managed by a central service group) you can also define the variable FAI_ACTION in a /fai/class/*.var scripts. Look at LAST.var for an example. The variable T170 can also be defined by a daemon. It's better to use a script for that. When you have created your bootptab file, you have to enable the BOOTP daemon once. It's installed but Debian does not enable it by default. Edit /etc/inetd.conf and remove the comment (the hash) in the line containing #bootps. Then tell inetd to reload its configuration.

     # /etc/init.d/inetd reload

The BOOTP daemon automatically reloads the configuration file if any changes are made to it. The daemon for DHCP must always be manually restarted after changes to the configuration file are made.

Now it's time to boot all install clients again! FAI can perform several actions when the client is booting. This action is defined in the variable FAI_ACTION. Be very careful if you set FAI_ACTION to install. This can destroy all your data on the install client, indeed most time it should do this ;-). It's recommended to change this only on a per-client base in the BOOTP configuration. Do not change it in the section .failocal in /etc/bootptab, which is a definition for all clients.


3.6.1 Troubleshooting BOOTP daemon

The BOOTP daemon can also be started in debug mode if it is not enabled in inetd.conf:

     # bootpd -d7

3.7 Configuration of the DHCP daemon

An example for dhcp.conf(5) is available in /usr/share/doc/fai/examples/etc, which is tested with version 3.x of the DHCP daemon. Start using this example and look at all options used therein. If you make any changes to this configuration, you must restart the daemon.

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

Therefore it's recommended to only supply data into this configuration file, which doesn't change frequently. By default, the DHCP daemon write 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.


3.8 Boot messages

These are the messages when booting from floppy disk.

     GRUB loading stage2..............
     < now the grub menu with multiple boot options is displayed >
     BOOTING 'FAI-BOTH'
     kernel (fd0)/vmlinuz-2.4.20 root=/dev/nfs ip=both
       [Linux-bzImage, setup=0x1400, size=0xd8450]
     
     Uncompressing Linux... OK, booting the Kernel.
     Linux version 2.4.20 (root@kueppers) (gcc version 2.95.4 20011002
     .
     .
     .

After this, the rest of the boot message will be equal to those when booting from network card. 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 A2 43
     DHCP.../
     CLIENT IP: 134.95.9.150 MASK: 255.255.255.0  DHCP IP: 134.95.9.149
     GATEWAY IP: 134.95.9.254
     
     PXELINUX 1.66 2002-01-01  Copyright (C) 1994-2002 H. Peter Anvin
     Found PXEENV+ structure
     PXE API version is 0201
     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 865F0996 134.95.9.150
     ip=134.95.9.150:134.95.9.149:134.95.9.254:255.255.255.0
     TFTP prefix:
     Trying to load pxelinnux.cfg/865F0996
     Loading vmlinuz-install.....................
      ready.
     
     Faile to free base memory, sorry...
     Uncompressing Linux... OK, booting the Kernel.
     Linux version 2.4.20 (root@kueppers) (gcc version 2.95.4 20011002
     .
     .
     .
     Sending DHCP requests ., OK
     IP-Config: Got DHCP answer from 134.95.9.149, my address is 134.95.9.150
     IP-Config: Complete:
        device=eth0, addr=134.95.9.150, mask=255.255.255.0, gw=134.95.9.254,
        host=demohost, domain=informatik.uni-koeln.de, nis-domain=informatik4711.YP,
        bootserver=134.95.9.149, rootserver=134.95.9.149, rootpath=/usr/lib/fai/nfsroot
     Looking up port of RPC 1000003/2 on 134.95.9.149
     Looking up port of RPC 1000005/1 on 134.95.9.149
     .
     .
        ------------------------------------------------------
          FAI 2.5, 6 aug 2003
          Fully Automatic Installation for Debian GNU/Linux
     
          Copyright (c) 1999-2003, Thomas Lange
                  lange@informatik.uni-koeln.de
        ------------------------------------------------------
     
     Calling task_confdir
     Kernel parameters: ip=dhcp devfs=nomount FAI_ACTION=install root=/dev/nfs FAI_FLAGS=verbose,sshd,createvt,syslogd BOOT_IMAGE=vmlinuz-install 
     Defining variable: ip=dhcp
     Defining variable: devfs=nomount
     Defining variable: FAI_ACTION=install
     Defining variable: root=/dev/nfs
     Defining variable: FAI_FLAGS=verbose,sshd,createvt,syslogd
     Defining variable: BOOT_IMAGE=vmlinuz-install
     Reading /tmp/fai/boot.log
     FAI_FLAGS: verbose=1
     FAI_FLAGS: sshd=1
     FAI_FLAGS: createvt=1
     FAI_FLAGS: syslogd=1
     Configuration space /fai mounted from kueppers:/usr/local/share/fai
     Calling task_setup
     .
     .
     Calling task_defclass
     /usr/bin/fai-class: Defining classes.
     .
     .
     Calling task_action
     FAI_ACTION: install
     Performing FAI installation. All data may be overwritten!
     .
     .
     FAI finished.
     Calling task_chboot
     append parameters:   
     kernel is dom-localboot
     rootfs is /dev/hda6
     dom has 134.95.9.150 in hex 865F0996
     Writing file /boot/fai/pxelinux.cfg/865F0996 for dom
     Calling hook: savelog.LAST
     ERRORS found in log files. See /tmp/fai/error.log.
     savelog.LAST         OK.
     Calling task_savelog
     Save log files via rsh to fai@kueppers:dom/install-20030801_155242
     Calling task_faiend
     Press <RETURN> to reboot or ctrl-c to execute a shell

When the copyright message of fai is shown, the install client has mounted the nfsroot[9] to the clients' root directory /. This is the whole filesystem for the client at this moment. After task_confdir is executed, the configuration space is mounted or received from an CVS repository. Before the installation is started (FAI_ACTION=install) the computer beeps three times. So, be watchful when you hear three beeps but you do not want to perform an installation!


3.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.

     Root-NFS: Server returned error -13 while mounting /usr/lib/fai/nfsroot
     VFS: Unable to mount root fs via NFS, trying floppy.
     VFS: Cannot open root device "nfs" or 02:00
     Kernel panic: VFS Unable to mount root fs on 02:00

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

     showmount -e kueppers

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

These are the messages when you are using the BOOTP method and no BOOTP server replies.

     Sending BOOTP requests ........ timed out!
     IP-Config: Retrying forever (NFS root)...

If you get the following error message, the install kernel has no driver compiled in for your network card.

     IP-Config: No network devices available
     Partition check:
      hda: hda1 hda2 < hda5 hda6 hda7 hda8 >
     Root-NFS: No NFS server available, giving up.
     VFS: Unable to mount root fs via NFS, trying floppy.
     VFS: Insert root floppy and press ENTER

Then you have to compile the driver for your network card into a new kernel. This driver must not be a kernel module. To compile the new kernel, start using the default kernel configuration of FAI.

     kueppers# cd /usr/src/kernel-source-2.4.20
     kueppers# cp /usr/lib/fai/nfsroot/boot/config-2.4.20 .config
     kueppers# make menuconfig

Call make menuconfig and add the driver in menu Network device support/Ethernet which supports your network card. Then create a Debian package using make-kpkg(8):

     kueppers# make-kpkg clean
     kueppers# make-kpkg --revision fai2 kernel-image

This command creates the file /usr/src/kernel-image-2.4.20_fai2_i386.deb. Adjust the variable KERNELPACKAGE in /etc/fai/fai.conf and rebuild the nfsroot.

     kueppers# make-fai-nfsroot

After that, you have to create a new boot floppy if you need it. Now your network card should be recognized and the install kernel should mount the nfsroot successfully. More information how to compile an install kernel can be found in the README of the package fai-kernels.


3.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 variable FAI_ROOTPW in /etc/fai/fai.conf and defaults to "fai". You can create the encrypted password using mkpasswd(1). 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 ant01 in this example) use:

     > ssh root@ant01
     Warning: Permanently added 'ant01,134.95.9.200' to the list of known hosts.
     root@ant01'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 install server) into the directory ~fai/ant01/sysinfo/[10]

A very nice feature is that FAI mounts all filesystems 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:

     ant01:~# df
     
     Filesystem 1k-blocks     Used Available Use% Mounted on
     rootfs       2064192  1071184    888152  55% /
     /dev/root    2064192  1071184    888152  55% /
     shm            63548       76     63472   1% /tmp
     kueppers:/usr/local/share/fai
                  2064192   994480   964856   51% /fai
     /dev/hda1      54447     9859    41777   19% /tmp/target
     /dev/hda10   1153576       20  1141992    0% /tmp/target/files/install
     /dev/hda9     711540       20   711520    0% /tmp/target/home
     /dev/hda8     303336       13   300191    0% /tmp/target/tmp
     /dev/hda7    1517948    98252  1342588    7% /tmp/target/usr
     /dev/hda6     202225     8834   182949    5% /tmp/target/var

This method can be used as a rescue environment! In the future it will be possible to make backups or restore data to existing filesystems. If you need a filesystem with read-write access use the rwmount command:

     ant01:~# rwmount /tmp/target/home

3.10 Checking parameters from BOOTP and DHCP servers

If the install client boots with action sysinfo, you can also check if all information from the BOOTP or DHCP daemons 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 The setup routines of the install clients, Section 6.3.


3.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.


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ next ]

FAI Guide (Fully Automatic Installation)

Version 2.3.3, 6 jan 2004 for FAI version 2.5
Thomas Lange lange@informatik.uni-koeln.de