DISKLESS(8) | System Manager's Manual | DISKLESS(8) |
diskless
— booting
a system over the network
The ability to boot a machine over the network is useful for diskless or dataless machines, or as a temporary measure while repairing or re-installing filesystems on a local disk. This file provides a general description of the interactions between a client and its server when a client is booting over the network. The general description is followed by specific instructions for configuring a server for diskless clients.
When booting a system over the network, there are three phases of interaction between client and server:
Each of these phases are described in further detail below.
In phase 1, the PROM loads a boot program. PROM designs vary widely, so this phase is inherently machine-specific. Sun and Motorola machines use RARP to determine the client's IP address and then use TFTP to download a boot program from whoever sent the RARP reply. HP 300-series machines use the HP Remote Maintenance Protocol to download a boot program. Other machines may load a network boot program either from diskette or using a special PROM on the network card.
In phase 2, the boot program loads a kernel. Operation in this phase depends on the design of the boot program. The procedure used by the boot program is as follows:
In phase 3, the kernel does NFS mounts for root and swap. The kernel repeats much of the work done by the boot program because there is no standard way for the boot program to pass the information it gathered on to the kernel. The procedure used by the kernel is as follows:
The INSTALL.⟨arch⟩ notes that come with each distribution also give details on the specifics of net/diskless booting for each architecture.
The procedures for AMD64 and i386 clients vary somewhat to the stages detailed above. See pxeboot(8) for more detailed information.
Before a client can boot over the network, its server must be configured correctly. This example will demonstrate how to configure a server and client.
Assuming the client's hostname is to be "myclient":
8:0:20:7:c5:c7 myclient
This will be used by rarpd(8).
192.197.96.12 myclient
If booting an HP 300 or older HPPA machine, ensure that /etc/rbootd.conf is configured properly to transfer the boot program to the client. An entry might look like this:
08:00:09:01:23:E6 SYS_UBOOT # myclient
See the rbootd(8) manual page for more information.
If booting a Motorola or Sun client, make a link such that the boot program is accessible as a file named after the client's IP address in hex. For example:
# cd /tftpboot # ln -s boot.net C0C5600C
The following example converts an IP address to hex:
$ echo 192.197.96.12 | awk -F . \ '{ printf "%02X%02X%02X%02X\n", $1, $2, $3, $4 }'
Sun Sparc machines also require a “.⟨arch⟩” suffix. So the filename in the example above for a Sun4 machine would be “C0C5600C.SUN4”. The name used is really architecture dependent: it simply has to match what the booting client's PROM wishes it to be. If the client's PROM fails to fetch the expected file, tcpdump(8) can be used to discover which filename the client is trying to read.
Architectures using DHCP (newer alpha, amd64, hppa, i386, or sgi) should ensure that dhcpd(8) is configured on the server to serve BOOTP protocol requests. An example entry in dhcpd.conf(5):
subnet 10.0.0.0 netmask 255.0.0.0 { host myclient { filename "netboot"; option root-path "/export/myclient/root"; hardware ethernet 00:02:56:00:73:31; fixed-address 10.42.42.42; } }
Note that procedures for AMD64 and i386 clients vary somewhat. See pxeboot(8) for more detailed information.
Architectures using the HP remote boot server (HP 300 or older HPPA) should ensure that the general purpose boot program is installed in the directory /usr/mdec/rbootd.
Architectures using MOP (older Alpha) should follow the instructions in mopd(8) for setting up a TFTP boot.
myclient root=server:/export/myclient/root \ swap=server:/export/myclient/swap
Note that some bootparam servers are somewhat sensitive. Some require fully qualified hostnames or partially qualified hostnames (which can be solved by having both fully and partially qualified entries). Other servers are case sensitive.
# mkdir -p /export/myclient/root/swap # cd /export/myclient # dd if=/dev/zero of=swap bs=1m count=120
This creates a 120 Megabyte swap file and an empty /swap directory. A smaller swap file may be created if the boot is for maintenance (i.e. temporary) purposes only.
/usr -ro myclient /export/myclient -maproot=root -alldirs myclient
If the server and client are of the same architecture, then the client can share the server's /usr filesystem (as is done above). If not, a properly fleshed out /usr partition will have to be built for the client in some other place.
# cd /export/myclient/root/etc # cp /etc/fstab fstab # cp /etc/hosts hosts # echo myclient > myname # echo inet 192.197.96.12 > hostname.le0
Note that "le0" above should be replaced with the name of the network interface that the client will use for booting.
myserver:/export/myclient/root / nfs rw 0 0 myserver:/export/myclient/swap none swap sw,nfsmntpt=/swap myserver:/export/myclient/root/usr /usr nfs rw,nodev 0 0 myserver:/export/myclient/root/var /var nfs rw,nosuid,nodev 0 0
The above example works even if /usr
and /var are not on separate partitions. It
allows them to be mounted with NFSv3, if the server allows it, and to
specify per-partition mount options, such as
nodev
.
If the /usr partition is to be shared between machines, as in the example /etc/exports above, a more suitable entry might be:
myserver:/usr /usr nfs ro 0 0
For all clients: mountd(8), nfsd(8), portmap(8), rarpd(8), and rpc.bootparamd(8).
For alpha, amd64, hppa, i386, sgi, and sparc64 clients: tftpd(8)
For HP 300 and older HPPA clients: rbootd(8)
For newer alpha, amd64, hppa, i386, and sgi clients: dhcpd(8)
For older alpha clients: mopd(8)
bootparams(5), dhcpd.conf(5), ethers(5), exports(5), fstab(5), hostname.if(5), hosts(5), myname(5), dhcpd(8), mopd(8), mountd(8), nfsd(8), portmap(8), pxeboot(8), rarpd(8), rbootd(8), rpc.bootparamd(8), tcpdump(8), tftpd(8)
June 11, 2017 | OpenBSD-6.7 |