DEPRECATED
NOTE: The information below is deprecated, as the diskless package is not in Debian Etch; it only applies to the older Sarge distribution. Instead you might try lessdisks, DebianLive, or LTSP.
Introduction
diskless helps an administrator to manage a cluster of client machines running NFS root, that is, which mount their root filesystem from a server at boot time. In most cases, the client machines also NetBoot (load their kernel from the server at boot time), so all you need to do to start a client is set the BIOS to boot from the network, then just turn it on.
This simplifies administration of any cluster of machines, from a DebianBeowulf to a set of user workstations, since all package management can be done right on the server. But it can lead to high network traffic and CPU load and storage requirement on the server.
Scroll down for a description of the package and its NFS management utilities, then a basic HOWTO in "Getting Started".
The Package
This package provides tools for managing NFS images for a cluster. An image is a directory on the server which will serve as the root directory for client machines. Fortunately, most of the files will be shared among all of the machines, so we do not need to create a separate entire image for each machine. Instead, we create a single image with all of the common files, then separate host sub-images with the /etc, /var and /tmp directories for each host. Since the clients share the same Debian packages, we can save further disk space by sharing /var/lib/dpkg as well.
When a client machine boots, it (usually) gets its kernel from the server, which then boots and mounts the main image as its root filesystem. It then runs the /sbin/init command, which in the diskless image is a special script which mounts that machine's /etc, /var and /tmp directories, and the global /var/lib/dpkg. The diskless init script then runs the standard init script, continuing the boot process as usual.
Getting Started
To set up management of "diskless" NFS-root machines:
1. Install the following packages on the server:
- diskless
- nfs-kernel-server
- dhcp, dhcp3-server or rarpd
- mknbi+
- tftpd+
+ only needed if you want the clients to NetBoot by getting their kernel from the server as well as the NFS root filesystem.
2. Debian no longer ships base.tgz files with the contents of all of the base packages, so you will need to create one using diskless-createbasetgz, e.g.:
% mkdir /tmp/diskless % mkdir /var/lib/diskless % mkdir /var/lib/diskless/default % diskless-createbasetgz /tmp/diskless sarge \ http://http.us.debian.org/debian /var/lib/diskless/default/base.tgz
This downloads from http.us.debian.org all of the Debian packages which make up the base files of the "sarge" (a.k.a. 3.1) release of Debian, installs them into temporary storage space in /tmp/diskless (which must be empty, so don't use /tmp), and creates a compressed tarball base.tgz in directory /var/lib/diskless/default from the scratch storage.
3. Download one of the diskless-image packages to the /var/lib/diskless/default directory, but DO NOT INSTALL IT!
4. Use the diskless-newimage program to create the NFS root image for your client machines from the existing base.tgz and diskless-image-*.deb file, e.g.:
% cd /var/lib/diskless/default (where base.tgz and the diskless-image .deb are) % diskless-newimage /var/lib/diskless/default/root
In the course of creating the image, you will be asked several questions, which will require that you know the IP adress by which the clients will reach the server, the name server, the mail server (likely localhost since exim is installed), and whether you want to use devfs for the /dev directory of the clients.
5. Install and remove packages from the image, e.g.:
% cp /etc/apt/sources.list /var/lib/diskless/default/root/etc/apt/sources.list % cp /etc/resolv.conf /var/lib/diskless/default/root/etc/resolv.conf % cp /etc/kernel-img.conf /var/lib/diskless/default/root/etc/kernel-img.conf % chroot /var/lib/diskless/default/root % mount -t proc /proc proc % mount -t devfs none dev % dselect
I recommend getting rid of lilo (since it could otherwise corrupt your server's boot record!!) and pcmcia-cs, and adding anacron. This is a convenient time to install any other packages which you know you will want on the clients. One you need for sure is nfs-common.
6. Set up the "host" sub-images' /etc, /var and /tmp directories using diskless-newhost, e.g.:
% diskless-newhost /var/lib/diskless/default/root
If 192.168.0.2 is in your /etc/hosts, then the default hostname and mailname will be set according to that file. Note that diskless-newhost can set up a host sub-image, or update an existing one.
If you have UpdateCluster installed, and have populated the cluster.xml file (using update-cluster-add), then you can use the script diskless-rebuild-hosts to create/update all of the host sub-images automatically.
(This script is at http://lyre.mit.edu/~powell/cluster/diskless.updatelist and will be added to the diskless package at some point.)
7. Modify /etc/exports to allow clients to mount the image and their respective /etc, /var and /tmp directories. For example:
#diskless node's root directory /var/lib/diskless/default/root 10.0.0.0/255.255.255.0(ro) #diskless nodes directories /var/lib/diskless/default/10.0.0.2 10.0.0.2(rw,no_root_squash) /var/lib/diskless/default/10.0.0.3 10.0.0.3(rw,no_root_squash) /var/lib/diskless/default/10.0.0.4 10.0.0.4(rw,no_root_squash)
With this setup, node 10.0.0.2 will mount /var/lib/diskless/default/root as root, /var/lib/diskless/default/10.0.0.2/var as /var (likewise for /etc and /tmp), then /var/lib/diskless/default/root/var/lib/dpkg as /var/lib/dpkg.
8. Build a client kernel with NFS-root support, or setup a NFSRootInitrd. At a minimum, this means the following options must be set:
Networking options:
CONFIG_IP_PNP=Y (IP: kernel level autoconfiguration)
CONFIG_IP_PNP_DHCP=Y, or _BOOTP or _RARP
File systems:
CONFIG_NFS_FS=Y (NFS file system support)
CONFIG_ROOT_NFS=Y (Root file system on NFS)
Also, make sure the network device is built in (=Y), not a module!
9. Set up DHCP, BOOTP or RARP on the server to give an IP address to the client machines.
10. Boot clients using this kernel, either via floppy, CD, lilo/grub MBR on local hard drive, or NetBoot.