[LUGSB] PXE boot

Ilya Sukhanov (dotCOMmie) lugsb at sukhanov.net
Sun Jan 13 13:23:19 EST 2008


Jim Robert wrote:
> I recently got a hold of 6 diskless workstations and wanted to try setting
> up a small cluster, but I'm having trouble setting up the PXE server. Does
> anyone know where I can get a relatively comprehensive guide on setting up
> this type of system (booting several diskless clients from one server using
> PXE)?
 >
 > Also... do I need an ISO on the server? or can I just do a regular debian
 > install and copy/paste all the files to an NFS partition.

PXE is quite straight forward you install a tftp server and a dhcp server 
(dnsmasq is good for this) in the DHCP server you need to announce the tftp 
server and the image in dnsmasq this is done with the dhcp-boot directive:
dhcp-boot=pxelinux.0,$TFTPD_SERVER_NAME,$TFTPD_SERVER_ADDRESS

To your tftp directory copy /usr/lib/syslinux/pxelinux.0 (install syslinux), 
alternatively you can get it from a mirror 
http://debian.ams.sunysb.edu/debian/dists/lenny/main/installer-i386/current/images/netboot/debian-installer/i386/pxelinux.0

Now you need to make a pxelinux.cfg/default file with the boot options
default linux
label linux
	kernel $MY_KERNEL_IMAGE_RELATIVE_TO_TFTP_PATH
	append init=/sbin/init root=/dev/nfs 
ip=::::$MY_TMP_HOSTNAME:$DEVICE_TO_USE:dhcp 
nfsroot=$NFS_SERVER:/$NFS_PATH,nfsvers=3 panic=1
	#Unwrap prev 2 lines

Now compile a kernel with nfsroot and dhcp support. Drop it into your tftp dir, 
and make sure its name corresponds to $MY_KERNEL_IMAGE_RELATIVE_TO_TFTP_PATH.

Do a dummy debian install to a machine and cp -a it into directory on your 
server and export it with NFS. BTW since you have bunch of machines booting of 
the same image you'll eventually want to have 2 exports one RW to one of the 
machines and one RO for the rest of the machines. This way you dont' have nasty 
problems with your systems. On the RO machines you'll have to deal somehow with 
files/dirs which have to be changed by the system IE make couple ramfs 
partitions and populate them on boot.

This should get you started.

Useful websites:
http://www.debian-administration.org/articles/478
http://www.jukie.net/~bart/blog/20070316092236
http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
http://syslinux.zytor.com/pxe.php
http://www.mjmwired.net/kernel/Documentation/nfsroot.txt



More information about the lugsb mailing list