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.
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 |
/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
[root@quaker root]#chkconfig --level 5 bootp on
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
We now need to build the kernel image that will be loaded into the RAM of the diskless system.
Dive into the kernel sources directory and run make menuconfig
Then do the following:
It takes just one command to build the kernel:
[root@quaker linux2.4]# make dep clean bzImage
/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
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
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
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)
/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
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
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
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/.
Setting up GDM as the display manager usually involves 2 simple steps:
/etc/X11/gdm/gdm.conf file and scroll down to the section [xdmcp]. Add this line:
Enable = true
/etc/inittab and replace this line:
x:5:respawn:/etc/X11/prefdm -nodaemon
x:5:respawn:/usr/bin/gdm -nodaemon
[root@quaker root]# init 5
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.
To run X on the diskless node, execute the following command:
$ X -query 192.168.100.13