A few weeks back I re-published a great article on setting up a PXE server. Since then I've had to use this server for a number of other tasks, from cloning 15 machines to running Ubuntu LiveCD over a PXE network. I'd like to share with you a couple more tips on getting the most from your PXE Server.
NFS
In order to get the most out of your PXE, I recommend install nfs on your machine.
apt-get install nfs-kernel-server
With this you'll be able to share more than just the initial boot - but mount directories after boot to have a fat-client setup.
My exports file (directories which I've explicitly shared via NFS looks like this:
/exports/clonezilla *(ro,sync)
/exports/ubuntu *(ro,sync)
/exports/images *(rw,sync)
I don't currently have a fat-client setup, but the above directories are a good introduction to two ways of extending the PXE Server.
Clonezilla
Clonezilla Live, based on DRBL, Partition Image, ntfsclone, partclone, and udpcast, allows you to do bare metal backup and recovery. That means it reads the physical hard disk, and copies the blocks one-for-one. This is pretty useful when cloning identical machines (which is what I was doing) - but there's also a Server Edition - which uses multicasting and is capable of cloning a 5.6GB Disk Image onto 42 machines simulteneously in around 10 minutes.
I downloaded Clonezilla Live! from the UK Mirror Service.
cd /tmp
wget http:////www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/c/cl/clonezilla/clonezilla-live-1.0.11-19.iso
Once that's done, I mounted it at /media/clonezilla
mkdir /media/clonezilla
mount -t loop /tmp/clonezilla-live-1.0.11-19.iso /media/clonezilla
then copied the entire iso into /exports/clonezilla
cp -r /media/clonezilla/* /exports/clonezilla
Since that was now setup - and using the PXE configuration from the previous post, I created the folder clonezilla in /var/lib/tftpboot/ and copied the kernel and initrd there.
mkdir /var/lib/tftpboot/clonezilla
cp /exports/clonezilla/live/initrd.img /var/lib/tftpboot/clonezilla
cp /exports/clonezilla/live/vmlinuz /var/lib/tftpboot/clonezilla
I then edited /var/lib/tftpboot/pxelinux.cfg/default to include the following
LABEL clonezilla
kernel clonezilla/vmlinuz1
append initrd=clonezilla/initrd1.img boot=live union=aufs netboot=nfs nfsroot=192.168.1.12:/exports/clonezilla
Once that was saved, I could then boot up a machine over the network - and typing 'clonezilla' at the prompt allowed me to boot into clonezilla and clone my computers :)
Ubuntu LiveCD
The Ubuntu live CD pretty much followed the same configuration as the Clonezilla setup (except, of course, downloading the iso of ubuntu, not Clonezilla).
The pxelinux.cfg/default entry is also slightly different (NB: casper), and as I already had ubuntu intrepid and hardy directories in the tftpboot directory - I created a new directory called /live (which has the latest iso in it).
LABEL ubuntulive
kernel ubuntu/live/vmlinuz
append initrd=ubuntu/live/initrd boot=casper netboot=nfs nfsroot=192.168.1.12:/exports/ubuntu
The next stage for me is to set up the /var/lib/tftpboot dir to automatically rsync the latest version of all the files, and for the /exports/ directories for the isos to do the same. However, as this is currently a 'work setup,' I don't have the time available to implement this. I hope that I can get something sorted for India though, as I've been asked to look into setting up a mini computer suite - and having second hand computers booting over PXE would be a pretty good way of managing them (and lowers the overhead in setting up the PCs individually). I'm also looking at ltsp, so if anyone can give me some advice I'm sure it'd be welcome in the not-to-distant future.