- What's this? Why do you need it?
- How does it work?
- DHCP
- TFTP, pxelinux
- Kernel
- NFS Root
- NFS Swap
- Support
- Links
What's this? Why do you need it?
The idea behind “Thin Clients” is to centralize the administration of desktop computers and thus reduce work. Storage is consolidated and integrated into backup concepts. Configurations will be managed centrally.
Since the goal is not to save the costs for the local disk, but to centralize management, an alternative is to use “near diskless” systems with a local disk for swap und temporary data.
This article does not describe the use of FibreChannel or iSCSI HBAs with Boot-Prom (int 13 for “Wintel” and “EFI” for Itanium) but booting via NAS. The primary target is Unix, because Windows only supports booting via NAS not directly or not at all. The sample is based on SuSE Linux.
A similar idea is to use the network only to install the operating system on a machine with an empty disk. (“Remote Installation Services” abbreviated as “RIS”) In this case the installation program is booted via the network, but the real operating system is installed on the local Disk.
How does it work?
- The diskless system (subsequently called “Netboot-System”), gets its IP configuration from the DHCP Server, which refers to the TFTP server in addition to sending configuration information
- The TFTP server delivers a mini Linux (“pxelinux”), which can either provide a menu with a choice of boot options or it decides itself what has to be loaded next.
- Now an adapted Linux kernel is loaded, and a parameter is passed, which tells the kernel where to find the NFS export with the root file system.
- The NFS export and the data on it must be created by by a different machine prior to the netboot attempt.
It's useful to have two machines, which are identical except that only one of them has a local disk, while the other boots via network. I call the first one “reference system”, while I call the other “netboot system”.
DHCP
In order for the NIC to do anything before the OS is loaded, e.g. to send
a RARP, bootp or DHCP request and subsequently communicate with the TFTP
server, it needs a Boot-Prom or support by the BIOS. Different methods exist
e.g. “Etherboot”. Therefore
numerous complex and confusing documents exist. Luckily most of the current
computers do PXE, and therefore the configuration of the DHCP server is quite easy.
On SuSE Linux you can do a base configuration by “yast2 dhcp-server,
and on a Windows server you can also set up a DCHP-Server with just a few mouse
clicks. Then you have to add two options to the configuration of the DHCP servers:
filename "/pxelinux.0"; next-server name or IP of th TFTP server;
According to my experiences, other options, frequently described in other documents are not necessary.
TFTP, pxelinux
The TFTP server can be installed on SuSE Linux with “yast2 tftp-server”
This includes the creation of the directory “/tftpboot”
You have to copy the file “pxelinux.0” into that directory.
(Das “Mini-Linux”). You get it from the Syslinux-Site
or from SuSE's syslinux RPM,
which places this file under “/usr/share/syslinux/pxelinux.0”.
The configuration directory is located under “/tftpboot/pxelinux.cfg”.
pxelinux searches this directory for a file, whith a name that matches the client's MAC adress,
then for a file, which matches the client's IP address or the clients subnet and finally
for a file named “default”. This text file could look as follows:
default netboot prompt 0 # timeout 10 label netboot kernel /SuSE/i386/vmlinuz append root=/dev/nfs rw nfsroot=servername:/nfsroot ip=dhcp label install kernel /SuSE/i386/linux-install append initrd=/SuSE/i386/initrd-install install=nfs://servername/Instserver/source/suse/ label local LOCALBOOT 0
Watch out: “/SuSE” in this sample is relative to “/tftpboot”
The Option “install” is meant to install a system with a local, but yet empty drive.
Sometimes “localboot” is used as default, in order for machines to work correctly, which are not meant to be booted via network, not to speak of beeing installed via natwork but happen to have switched on PXE.
Kernel
The kernel or the initrd has to contain all modules, required to support the hardware
if you copy both from the “reference system” to the TFTP server, it's a good
start already. However the kernel also needs the option “CONFIG_ROOT_NFS”,
which in turn requires “CONFIG_IP_PNP”. These options are not
contained in the kernel by default, as you can easily verify with the commands
“zcat /proc/config.gz | grep CONFIG_ROOT_NFS” or
“grep CONFIG_ROOT_NFS /boot/config-`uname -r`”.
In order to build a new kernel, the Linux system the development system and the kernel sources
must be installed on your system. You can transfer the configuration of the currently running
kernel to the development environment by “make cloneconfig”.
Then you can do the required changes with “make menuconfig”.
It is recommendet to set the following options built-in (not as initrd modules):
device driver | network support | networking options
TCP/IP networking
IP Kernel level autoconfiguration
dhcp support, Bootp support
Network device support
Ethernet 10 or 100 MBit
AMD Pcnet32 PCI support
file system
Network File Systems
NFS file system support
Root file system on NFS
“make bzImage” compiles a new kernel.
“cp /usr/src/linux/arch/i386/boot/bzImage /tftpboot/SuSE/i386/vmlinuz”
copies it to the TFTP-Server. (Depending on the architecture it could read
“x86_64” instead of “i386”.)
The alternative (not discussed here) to using a kernel with a root directory on an NFS mount,
is to use a mini root-file system on ram disk, and only mount the directories below
(/usr, /var, /home, ...) via NFS. You
could even mount some of the file systems, e.g. Swap,
via software iSCSI initiator instead of NFS.
NFS Root
Mount the servers NFS Export to the reference system under “/var/tmp/dirinstall”
and use “yast2 dirinstall” to install something there or mount it
under “/mnt” and use “cd /; cp -R alles außer /mnt mnt”
to copy the reference system there. “chroot /var/tmp/dirinstall”
or “chroot /mnt” changes to the new environment and enables you to
use “yast” for the required configurations, like e.g a different network
address than the reference system.
The sequence in which services are started and stopped, is not optimized for NFS Root. Especially
the network services are stopped too early during shutdown An entry CONNECTION_CHECK_BEFORE_IFDOWN="yes"
in /etc/sysconfig/network/eth-id-mac-addr may help.
NFS Swap
Swap via NFS will give you a bad performance and is not directly supported. The workaround is, to create a file of the size of the intended swap space on the NFS mount mount it via the loopback dreiber and format the mounted “drive” as swap space Even better is to use enough RAM in order not to need any swap space at all or use a local disk. The latter statemant is of course problematic in a company who emphasizes that NAS is faster than a local disk.
Support
Most of the Linux distributors remind you that you loose support with a self compiled kernel. Some colleagues notified me about FujitsuSiemens' documentation about FlexFrame, which is booted via NFS and easier to install than I described it above. Actually FSC cared for all this and takes the responsibility for the maintenance of the “unsupported” Linux.
Links
- iSCSI boot
- Diskless Linux
- How to Install Red Hat Linux via PXE and Kickstart:
- Computer Mutter GmbH PXE Boot Server Installation - Mini Howto bzw. Kurzanleitung (German)
- Tipps, Howto
