With the aid of an initrd image, it is possible to boot a linux kernel on a diskless computer without kernel network autoconfiguration, and without statically building in network modules. This makes it simple to use a vendor-provided kernel image, rather than building one from scratch. We use this technique on our set of diskless x86 and x86_64 systems. Each system mounts its own root file system (containing a complete installed image of Scientific Linux) from an NFS server. This is wasteful of space on the server, but each system can be managed using the standard tools (except rpm doesn't work - see below for more information).
The easiest way to do this is to build busybox statically (using these configuration options), install this with make install, and use a modified version of this init script in _install. In the _install directory, make a directory modules containing nfs.o, lockd.ko and sunrpc.ko from the kernel you are using (and optionally in modules64 for x86_64 systems), and the network card modules. You will need to edit the init script to insert the appropriate network card modules.
You will also need to copy examples/udhcp/simple.script from busybox into _install/xray/udhcpc-script, and make it executable. Finally, you can make a dhcp image (suitable for 2.6 kernels) using the command in the _install directory:
find . | grep -v "~" | cpio -c -o | gzip > ../initrd.img
To use the image, you need a tftp server with PXELinux, providing the kernel (copied from the linux distribution) and initrd images.
As I stated above, rpm doesn't work over an nfs root directory. We initially tried to fix this by using a rpm over an rpc calls to a database on the server. See the bugzilla report. We found this to be unreliable. The system is slow and breaks for no determinable reason. We found a better solution, which was to mount the /var/lib/rpm directory from a server using gnbd. We use small ext3 images for each client which are mounted on boot using an init script. The perfect solution would be to use gnbd for the root device itself. After a lot of experimenting, I was unable to get the reconnection to work. Perhaps it could, but I suspect all of gnbd's files need to be stored on a memory disk, but this didn't seem to be the entire solution.
Back to my homepageThis is not an official page of the Institute of Astronomy. Page was last updated on 2006-01-22 by Jeremy Sanders.