LittleFe:PXE Booting

From Earlham CS Department
Jump to navigation Jump to search

In order to setup PXE booting the client nodes must get their DHCP information from the node serving the kernel. We have setup dhcpd on littlefe0 with the following entry for each littlefe node to know where to get it's kernel.
group {

next-server 192.168.10.100;
filename "pxelinux.0";
use-host-decl-names on;
host littlefe1 { hardware ethernet 00:40:63:d8:a2:2c; fixed-address 192.168.10.101; }
host littlefe2 { hardware ethernet 00:40:63:d8:a2:93; fixed-address 192.168.10.102; }

....
}

The host entry gives the remote its own hostname through dhcp. The "filename" entry here specifies the pxe boot loader. We use the pxe linux bootloader based on the syslinux bootloader (http://syslinux.zytor.com/pxe.php ). The filename is relative to the tftpd root directory, /tftpboot/ on littlefe0. The "/tftpboot/pxelinux.cfg" file specifies the kernel binary, again relative to the tftp root directory, and kernel options to be passed on client nodes. We pass the following options:
DEFAULT vmlinuz-2.6.12 ramdisk_size=16384 ip=dhcp root=/dev/nfs nfsroot=192.168.10.100:/diskless/
This specifies which kernel binary to load. Thus, to change the kernel loaded by the diskless nodes you either copy over the file that the config points to or point the config at the new kernel binary. It also prepares a ramdisk and tells the client to mount /diskless/ nfs export from littlefe0. The /diskless/ directory on littlefe0 is the root directory of each of the client nodes.

The ramdisk on each client node is further prepared by the /init/local script. This script formats the ramdisk, mounts it to /mnt/ramdisk, and copies the skeleton ramdisk directory sturcture from /mnt/ramdisk_skel. Currently we put three directories on the ramdisk, /var/lock/ , /var/run/ , and /var/spool/ each of these are linked to the equivalent ramdisk directory, ie /var/lock -> /mnt/ramdisk/lock.

In order to make changes to client nodes, first boot littlefe0 and another node with all of the networking in place so that they can communicate. Next, login to the client node. This node has littlefe0's /diskless/ directory mounted as its root directory, / . In order to make changes that affect each client node simply modify the root directory on the single booted client node. These changes will be updated on /diskless/ on littlefe0 and thus on every other client node. For example, running "apt-get install" on littlefe1 will add a package to every littlefe client node. To modify scripts or configuration, in /etc/ for example, it is also possible to modify the /diskless/ directory on littlefe0 directly from the root node.

Making changes to the root node, littlefe0 is done in the normal way. In order to modify all the nodes, root and clients, the commands must be run on both littlefe0 and one client node.

To add rc scripts, for example kdm, to particular runlevels in debian use the following

update-rc.d kdm defaults

To remove rc scripts, for example, from every runlevel while leaving the /etc/init.d/ script intact use the following

update-rc.d -f kdm remove

For this example if we wanted to run kdm on some subset of the diskless nodes we would need to modify the kdm init.d script to check the hostname of the local machine and only execute kdm if the local hostname matches a node on which we want kdm running.

Since the littlefe0's hard drive has every node's filesystem it is important to backup regularly. There is a backup script in root's home directory on the diskless nodes, backupfe0.sh. It requires that there is a hard drive connected to the diskless node's ide0 channel. This script mounts littlefe0's root directory to /mnt/fe0, the local hard drive to /mnt/part1 . Then, it rsyncs the /mnt/part1 to a copy of /mnt/fe0.