Next Previous Contents

5. Network Booting with Etherboot

This is a slightly more complicated method of getting diskless systems to work. However, once configured, it allows greater flexibility than LTSP. It allows users access to six terminals in addition to the standard X session.

Etherboot works on the same principle as LTSP, but it uses BOOTP (Boot Protocol) instead of DHCP. A server running BOOTP will receive the request for an IP address and return the IP address the client system is to use. Since the BOOTP request is broadcast -- that is, addressed to all computers on the network -- the client doesnt need to know the address of the server.

Note: BOOTP is not a standard part of the Red Hat 9 distribution; you must download it from http://www.rpmfind.net.

5.1 Configuring BOOTP

Configuring BOOTP is extremely simple compared to DHCP. You just need to remember the following commonly used fields and flags:

bf Boot File
dn Domain Name
ds Domain Name Server address List
ha Host Hardware Address
ip Host's IP Address
hn Send client's hostname to client
ht Hardware Type
sa TFTP server address
rp Root Path to mount as root
tc Table Continuation

Based on this, my /etc/bootptab file looks like this:
.def:ht=ethernet:hn=y
ws001:ha=000B2B0B6B2E:ip=192.168.100.14:tc=linux

linux:bf=/tftpboot/linux.diskless

Setup BOOTP to start up automatically in runlevel 5
[root@quaker root]#chkconfig --level 5 bootp on

5.2 Configuring TFTP

Edit the file /etc/xinetd.d/tftp. Change the line that reads:

disable = yes

to read:

disable = no

and the line that reads

server_args = -s /tftpboot

to read:

server_args = /tftpboot

Finally, setup TFTP to start automatically in runlevel 5


[root@quaker root]#chkconfig --level 5 tftp on

5.3 Building and configuring the kernel image for the Diskless Systems

We now need to build the kernel image that will be loaded into the RAM of the diskless system.

Configuring the kernel

Dive into the kernel sources directory and run make menuconfig Then do the following:

  1. Enable the option [General Setup-->Networking Support].
  2. Enable the option [File systems-->Network File Systems-->NFS file system support] and [File systems-->Network File Systems-->NFS file system support-->Root over NFS].
  3. Enable the options [Networking Options-->IP: kernel level autoconfiguration] and [Networking Options-->BOOTP support].
  4. Build your network card drivers into the kernel instead of selecting them as modules: [Network Device Support-->Select your card driver]

Building the Kernel

It takes just one command to build the kernel:


[root@quaker linux2.4]# make dep clean bzImage

This leaves a your new kernel image at /usr/src/linux2.4/arch/i386/boot/bzImage. Move this to the /tftpboot directory.
[root@quaker linux2.4]# mv i386/boot/bzImage /tftpboot/kernel.diskless

Making the kernel network bootable

We now need to explicitly make sure that the kernel is meant to boot from the network rather than a hard disk. To ensure this, we run the following set of commands:


[root@quaker linux2.4]# cd /tftpboot
[root@quaker tftpboot]# mknod /dev/nfs c 0 255
[root@quaker tftpboot]# rdev kernel.diskless /dev/nfs

Creating a Tagged Image

The last step that remains is to create the tagged image. A kernel image intended for a diskless client needs a special header which tells the network bootloader where the bytes go in the memory and at what address to start the program. This image is called the tagged image. Creating a tagged image is simple; all we need is the mknbi-linux tool from the etherboot package:


[root@quaker tftpboot]# mknbi-linux kernel.diskless > linux.diskless

5.4 Configuring NFS

A diskless system configured with IP address 192.168.100.14 attempts to mount the root filesystem from the location /tftpboot/192.168.100.14. We therefore add the following workstation-specific lines to /etc/exports


/tftpboot/192.168.100.14        ws001(rw,no_root_squash)
/usr    (ro)
/opt    (ro)

As you can see above, we export the directory /tftpboot/192.168.100.14 with read+write options and allowing root access to the workstation ws001 ( Hostname Mapping needs to be configured here). The /usr and /opt directories are made available in order to allow workstations to access installed programs. Finally, make the exported file systems available and setup NFS to start up automatically in runlevel 5:
[root@quaker root]# exportfs -a
[root@quaker root]# chkconfig --level 5 nfs on

5.5 Initializing the root filesystem

A minimal root filesystem for the client should contain the following directories in their entirety: /etc - Configuration files /var - Log files /lib - Libraries used at boot time /dev - device files

A simple script, buildroot automates the process of creating the root filesystem with the minimum of fuss. The script is as follows


#!/bin/bash
if [ $# != 1 ]
then
        echo Usage: $0 client-IP-address-or-name
        exit 1
fi

cd /
umask 022
mkdir -p /tftpboot/$1

for d in home mnt proc tmp usr opt
do
        mkdir /tftpboot/$1/$d
done

chmod 1777 /tftpboot/$1/tmp

touch /tftpboot/$1/fastboot
chattr +i /tftpboot/$1/fastboot
cp -a bin lib sbin dev etc root var /tftpboot/$1
cat << EOF
Now, in /tftpboot/$1/etc, edit

sysconfig/network
sysconfig/network-scripts/ifcfg-eth0
fstab
hosts
modules.conf

and configure rc.d/rc3.d
EOF

Move the script to /usr/bin. The script can be invoked from the command line, like this:


[root@quaker tftpboot] buildroot 192.168.100.14

Setting up NFS mounts

Now it's time to set up the filesystems exported from NFS. We do this in order that the client should mount them. The file /etc/exports should be set up as shown below:


192.168.100.13:/tftpboot/192.168.100.14 /       nfs     rw      0 0
192.168.100.13:/usr     /usr    nfs     ro      0 0
192.168.100.13:/opt     /opt    nfs     ro      0 0
proc    /proc   proc    defaults        0 0
devpts  /dev/pts        devpts  defaults        0 0

Setting up the network scripts

Set the values of HOSTNAME and IPADDR in the files /tftpboot/192.168.100.14/etc/sysconfig/network and /tftpboot/192.168.100.14/etc/sysconfig/network-scripts/ifcfg-eth0 respectively. Finally, delete unwanted scripts in /tftpboot/192.168.100.14/etc/rc.d/rc3.d/.

5.6 Setting up the display manager

Setting up GDM as the display manager usually involves 2 simple steps:

  1. Open the /etc/X11/gdm/gdm.conf file and scroll down to the section [xdmcp]. Add this line:
    Enable = true
    

  2. Open the file /etc/inittab and replace this line:
    x:5:respawn:/etc/X11/prefdm -nodaemon
    

    with this one:
    x:5:respawn:/usr/bin/gdm -nodaemon
    

    to force GDM as the display manager.
All that needs to be done now is to switch to runlevel 5:
[root@quaker root]# init 5

5.7 Building the bootable disk for the client

Building the bootdisk for the diskless client is the same as described for the LTSP configuration. Just pop in the disk and boot up your clients.

5.8 Running X on the client

To run X on the diskless node, execute the following command:


$ X -query 192.168.100.13

This should give you a GDM login window. Login and enjoy your remote X session. You can also switch between X and the 6 consoles from Ctrl+Alt+F1 through F6.


Next Previous Contents
Hosted by www.Geocities.ws

1