xref: /freebsd/share/man/man8/diskless.8 (revision 247ca3ded5f35eb3d643e8f511d656829c7ff108)
1247ca3deSSteve Price.\"	$NetBSD: diskless.8,v 1.11 1997/06/16 07:50:35 mrg Exp $
2247ca3deSSteve Price.\"
3247ca3deSSteve Price.\" Copyright (c) 1994 Gordon W. Ross, Theo de Raadt
4247ca3deSSteve Price.\" All rights reserved.
5247ca3deSSteve Price.\"
6247ca3deSSteve Price.\" Redistribution and use in source and binary forms, with or without
7247ca3deSSteve Price.\" modification, are permitted provided that the following conditions
8247ca3deSSteve Price.\" are met:
9247ca3deSSteve Price.\" 1. Redistributions of source code must retain the above copyright
10247ca3deSSteve Price.\"    notice, this list of conditions and the following disclaimer.
11247ca3deSSteve Price.\" 2. Redistributions in binary form must reproduce the above copyright
12247ca3deSSteve Price.\"    notice, this list of conditions and the following disclaimer in the
13247ca3deSSteve Price.\"    documentation and/or other materials provided with the distribution.
14247ca3deSSteve Price.\" 3. The name of the author may not be used to endorse or promote products
15247ca3deSSteve Price.\"    derived from this software without specific prior written permission.
16247ca3deSSteve Price.\"
17247ca3deSSteve Price.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18247ca3deSSteve Price.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19247ca3deSSteve Price.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20247ca3deSSteve Price.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21247ca3deSSteve Price.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22247ca3deSSteve Price.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23247ca3deSSteve Price.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24247ca3deSSteve Price.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25247ca3deSSteve Price.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26247ca3deSSteve Price.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27247ca3deSSteve Price.\"
28247ca3deSSteve Price.Dd October 2, 1994
29247ca3deSSteve Price.Dt DISKLESS 8
30247ca3deSSteve Price.Os
31247ca3deSSteve Price.Sh NAME
32247ca3deSSteve Price.Nm diskless
33247ca3deSSteve Price.Nd booting a system over the network
34247ca3deSSteve Price.Sh DESCRIPTION
35247ca3deSSteve PriceThe ability to boot a machine over the network is useful for
36247ca3deSSteve Price.Xr diskless
37247ca3deSSteve Priceor
38247ca3deSSteve Price.Xr dataless
39247ca3deSSteve Pricemachines, or as a temporary measure while repairing or
40247ca3deSSteve Pricere-installing filesystems on a local disk.
41247ca3deSSteve PriceThis file provides a general description of the interactions between
42247ca3deSSteve Pricea client and its server when a client is booting over the network.
43247ca3deSSteve PriceThe general description is followed by specific instructions for
44247ca3deSSteve Priceconfiguring a server for diskless Sun clients.
45247ca3deSSteve Price.Pp
46247ca3deSSteve Price.Sh OPERATION
47247ca3deSSteve PriceWhen booting a system over the network, there are three
48247ca3deSSteve Pricephases of interaction between client and server:
49247ca3deSSteve Price.Pp
50247ca3deSSteve Price.Bl -tag -width 1.2 -compact
51247ca3deSSteve Price.It 1.
52247ca3deSSteve PriceThe PROM (or stage-1 bootstrap) loads a boot program.
53247ca3deSSteve Price.It 2.
54247ca3deSSteve PriceThe boot program loads a kernel.
55247ca3deSSteve Price.It 3.
56247ca3deSSteve PriceThe kernel does NFS mounts for root.
57247ca3deSSteve Price.El
58247ca3deSSteve Price.Pp
59247ca3deSSteve PriceEach of these phases are described in further detail below.
60247ca3deSSteve Price.Pp
61247ca3deSSteve PriceIn phase 1, the PROM loads a boot program.  PROM designs
62247ca3deSSteve Pricevary widely, so this phase is inherently machine-specific.
63247ca3deSSteve PriceSun machines use
64247ca3deSSteve Price.Tn RARP
65247ca3deSSteve Priceto determine the client's
66247ca3deSSteve Price.Tn IP
67247ca3deSSteve Priceaddress and then use
68247ca3deSSteve Price.Tn TFTP
69247ca3deSSteve Priceto download a boot program from whoever sent the
70247ca3deSSteve Price.Tn RARP
71247ca3deSSteve Pricereply.  HP 300-series machines use the
72247ca3deSSteve Price.Tn HP Remote Maintenance Protocol
73247ca3deSSteve Priceto download a boot program.
74247ca3deSSteve PriceTypical personal computers may load a
75247ca3deSSteve Pricenetwork boot program either from diskette or
76247ca3deSSteve Priceusing a special PROM on the network card.
77247ca3deSSteve Price.Pp
78247ca3deSSteve PriceIn phase 2, the boot program loads a kernel.  Operation in
79247ca3deSSteve Pricethis phase depends on the design of the boot program.
80247ca3deSSteve Price(The design described here is the one used by Sun and NetBSD/hp300.)
81247ca3deSSteve PriceThe boot program:
82247ca3deSSteve Price.Pp
83247ca3deSSteve Price.Bl -tag -width 2.2 -compact
84247ca3deSSteve Price.It 2.1
85247ca3deSSteve Pricegets the client IP address using
86247ca3deSSteve Price.Tn RARP .
87247ca3deSSteve Price.It 2.2
88247ca3deSSteve Pricegets the client name and server
89247ca3deSSteve Price.Tn IP
90247ca3deSSteve Priceaddress by broadcasting an
91247ca3deSSteve Price.Tn RPC / BOOTPARAMS / WHOAMI
92247ca3deSSteve Pricerequest with the client IP address.
93247ca3deSSteve Price.It 2.3
94247ca3deSSteve Pricegets the server path for this client's
95247ca3deSSteve Priceroot using an
96247ca3deSSteve Price.Tn RPC / BOOTPARAMS / GETFILE
97247ca3deSSteve Pricerequest with the client name.
98247ca3deSSteve Price.It 2.4
99247ca3deSSteve Pricegets the root file handle by calling
100247ca3deSSteve Price.Xr mountd 8
101247ca3deSSteve Pricewith the server path for the client root.
102247ca3deSSteve Price.It 2.5
103247ca3deSSteve Pricegets the kernel file handle by calling
104247ca3deSSteve Price.Tn NFS
105247ca3deSSteve Pricelookup on the root file handle.
106247ca3deSSteve Price.It 2.6
107247ca3deSSteve Priceloads the kernel using
108247ca3deSSteve Price.Tn NFS
109247ca3deSSteve Priceread calls on the kernel file handle.
110247ca3deSSteve Price.It 2.7
111247ca3deSSteve Pricetransfers control to the kernel entry point.
112247ca3deSSteve Price.El
113247ca3deSSteve Price.Pp
114247ca3deSSteve PriceIn phase 3, the kernel does NFS mounts for root.
115247ca3deSSteve PriceThe kernel repeats much of the work done by the boot program
116247ca3deSSteve Pricebecause there is no standard way for the boot program to pass
117247ca3deSSteve Pricethe information it gathered on to the kernel.
118247ca3deSSteve PriceThe procedure used by the kernel is as follows:
119247ca3deSSteve Price.Pp
120247ca3deSSteve Price.Bl -tag -width 2.2 -compact
121247ca3deSSteve Price.It 3.1
122247ca3deSSteve PriceThe kernel finds a boot server using the same procedure
123247ca3deSSteve Priceas described in steps 2.1 and 2.2 above.
124247ca3deSSteve Price.It 3.2
125247ca3deSSteve PriceThe kernel gets the
126247ca3deSSteve Price.Tn NFS
127247ca3deSSteve Pricefile handle for root using the same procedure
128247ca3deSSteve Priceas described in steps 2.3 through 2.5 above.
129247ca3deSSteve Price.It 3.3
130247ca3deSSteve PriceThe kernel calls the
131247ca3deSSteve Price.Tn NFS
132247ca3deSSteve Pricegetattr function to get the last-modified time of the root
133247ca3deSSteve Pricedirectory, and uses it to check the system clock.
134247ca3deSSteve Price.El
135247ca3deSSteve Price.Sh CONFIGURATION
136247ca3deSSteve PriceBefore a client can boot over the network,
137247ca3deSSteve Priceits server must be configured correctly.
138247ca3deSSteve PriceThis example will demonstrate how a Sun client
139247ca3deSSteve Pricemight be configured -- other clients should be similar.
140247ca3deSSteve Price.Pp
141247ca3deSSteve PriceAssuming the client's hostname is to be
142247ca3deSSteve Price"myclient",
143247ca3deSSteve Price.Pp
144247ca3deSSteve Price.Bl -tag -width 2.1 -compact
145247ca3deSSteve Price.It 1.
146247ca3deSSteve PriceAdd an entry to
147247ca3deSSteve Price.Pa /etc/ethers
148247ca3deSSteve Pricecorresponding to the client's ethernet address:
149247ca3deSSteve Price.Bd -literal -offset indent -compact
150247ca3deSSteve Price8:0:20:7:c5:c7          myclient
151247ca3deSSteve Price.Ed
152247ca3deSSteve PriceThis will be used by
153247ca3deSSteve Price.Xr rarpd 8 .
154247ca3deSSteve Price.Pp
155247ca3deSSteve Price.It 2.
156247ca3deSSteve PriceAssign an IP address for myclient in your
157247ca3deSSteve Price.Pa /etc/hosts
158247ca3deSSteve Priceor DNS database:
159247ca3deSSteve Price.Bd -literal -offset indent -compact
160247ca3deSSteve Price192.197.96.12           myclient
161247ca3deSSteve Price.Ed
162247ca3deSSteve Price.Pp
163247ca3deSSteve Price.It 3.
164247ca3deSSteve PriceIf booting a Sun machine, ensure that
165247ca3deSSteve Price.Pa /etc/inetd.conf
166247ca3deSSteve Priceis configured to run
167247ca3deSSteve Price.Xr tftpd 8
168247ca3deSSteve Pricein the directory
169247ca3deSSteve Price.Pa /tftpboot .
170247ca3deSSteve Price.Pp
171247ca3deSSteve PriceIf booting an HP 300-series machine, ensure that
172247ca3deSSteve Price.Pa /etc/rbootd.conf
173247ca3deSSteve Priceis configured properly to transfer the boot program to the client.
174247ca3deSSteve PriceAn entry might look like this:
175247ca3deSSteve Price.Bd -literal -offset indent -compact
176247ca3deSSteve Price08:00:09:01:23:E6	SYS_UBOOT	# myclient
177247ca3deSSteve Price.Ed
178247ca3deSSteve Price.Pp
179247ca3deSSteve PriceSee the
180247ca3deSSteve Price.Xr rbootd 8
181247ca3deSSteve Pricemanual page for more information.
182247ca3deSSteve Price.Pp
183247ca3deSSteve Price.It 4.
184247ca3deSSteve PriceIf booting a SPARC machine, install a copy of the appropriate diskless boot
185247ca3deSSteve Priceloader (such as
186247ca3deSSteve Price.Pa /usr/mdec/boot )
187247ca3deSSteve Pricein the
188247ca3deSSteve Price.Pa /tftpboot
189247ca3deSSteve Pricedirectory.
190247ca3deSSteve PriceMake a link such that the boot program is
191247ca3deSSteve Priceaccessible by a file name composed of the client's IP address
192247ca3deSSteve Pricein HEX, a dot, and the architecture name (all upper case).
193247ca3deSSteve PriceFor example:
194247ca3deSSteve Price.Bd -literal -offset indent -compact
195247ca3deSSteve Price# cd /tftpboot
196247ca3deSSteve Price# ln -s boot C0C5600C.SUN4
197247ca3deSSteve Price.Ed
198247ca3deSSteve Price.Pp
199247ca3deSSteve PriceFor a Sun3 machine, the name would be just C0C5600C
200247ca3deSSteve Price(the sun3 PROM does not append the architecture name). The name
201247ca3deSSteve Priceused is architecture dependent, it simply has to match what the
202247ca3deSSteve Pricebooting client's PROM wishes to it to be.
203247ca3deSSteve PriceIf the client's PROM fails to fetch the expected file,
204247ca3deSSteve Price.Xr tcpdump 8
205247ca3deSSteve Pricecan be used to discover which filename the client is trying to read.
206247ca3deSSteve Price.Pp
207247ca3deSSteve PriceIf booting an HP 300-series machine, ensure that the network boot program
208247ca3deSSteve Price.Pa SYS_UBOOT
209247ca3deSSteve Price(which may be called
210247ca3deSSteve Price.Pa uboot.lif
211247ca3deSSteve Pricebefore installation)
212247ca3deSSteve Priceis installed in the directory
213247ca3deSSteve Price.Pa /usr/mdec/rbootd .
214247ca3deSSteve Price
215247ca3deSSteve Price.It 5.
216247ca3deSSteve PriceAdd myclient to the bootparams database
217247ca3deSSteve Price.Pa /etc/bootparams :
218247ca3deSSteve Price.Bd -literal -offset indent -compact
219247ca3deSSteve Pricemyclient  root=server:/export/myclient/root
220247ca3deSSteve Price.Ed
221247ca3deSSteve Price.Pp
222247ca3deSSteve Price.It 6.
223247ca3deSSteve PriceBuild the swap file for myclient:
224247ca3deSSteve Price.Bd -literal -offset indent -compact
225247ca3deSSteve Price# mkdir /export/myclient
226247ca3deSSteve Price# cd /export/myclient
227247ca3deSSteve Price# dd if=/dev/zero of=swap bs=16k count=1024
228247ca3deSSteve Price.Ed
229247ca3deSSteve PriceThis creates a 16 Megabyte swap file.
230247ca3deSSteve Price.Pp
231247ca3deSSteve Price.It 7.
232247ca3deSSteve PricePopulate myclient's
233247ca3deSSteve Price.Pa /
234247ca3deSSteve Pricefilesystem on the server.  How this is done depends on the
235247ca3deSSteve Priceclient architecture and the version of the NetBSD distribution.
236247ca3deSSteve PriceIt can be as simple as copying and modifying the server's root
237247ca3deSSteve Pricefilesystem, or perhaps you need to get those files out of the
238247ca3deSSteve Pricestandard binary distribution.
239247ca3deSSteve Price.Pp
240247ca3deSSteve PriceNote that, unlike SunOS, you need to create a mount point for the
241247ca3deSSteve Priceclient's swap:
242247ca3deSSteve Price.Bd -literal -offset indent -compact
243247ca3deSSteve Price# mkdir /export/myclient/root/swap
244247ca3deSSteve Price.Ed
245247ca3deSSteve Price.Pp
246247ca3deSSteve Price.It 8.
247247ca3deSSteve PriceExport the required filesystems in
248247ca3deSSteve Price.Pa /etc/exports :
249247ca3deSSteve Price.Bd -literal -offset indent -compact
250247ca3deSSteve Price/usr -ro myclient
251247ca3deSSteve Price# for SunOS:
252247ca3deSSteve Price# /export/myclient -rw=myclient,root=myclient
253247ca3deSSteve Price# for NetBSD:
254247ca3deSSteve Price/export/myclient -maproot=root -alldirs myclient
255247ca3deSSteve Price.Ed
256247ca3deSSteve Price.Pp
257247ca3deSSteve PriceIf the server and client are of the same architecture, then the client
258247ca3deSSteve Pricecan share the server's
259247ca3deSSteve Price.Pa /usr
260247ca3deSSteve Pricefilesystem (as is done above).
261247ca3deSSteve PriceIf not, you must build a properly fleshed out
262247ca3deSSteve Price.Pa /usr
263247ca3deSSteve Pricepartition for the client in some other place.
264247ca3deSSteve Price.Pp
265247ca3deSSteve PriceIf your server was a sparc, and your client a sun3,
266247ca3deSSteve Priceyou might create and fill
267247ca3deSSteve Price.Pa /export/usr.sun3
268247ca3deSSteve Priceand then use the following
269247ca3deSSteve Price.Pa /etc/exports
270247ca3deSSteve Pricelines:
271247ca3deSSteve Price.Bd -literal -offset indent -compact
272247ca3deSSteve Price/export/usr.sun3 -ro myclient
273247ca3deSSteve Price/export/myclient -rw=myclient,root=myclient
274247ca3deSSteve Price.Ed
275247ca3deSSteve Price.Pp
276247ca3deSSteve Price.It 9.
277247ca3deSSteve PriceCopy and customize at least the following files in
278247ca3deSSteve Price.Pa /export/myclient/root :
279247ca3deSSteve Price.Bd -literal -offset indent -compact
280247ca3deSSteve Price# cd /export/myclient/root/etc
281247ca3deSSteve Price# cp fstab.nfs fstab
282247ca3deSSteve Price# cp /etc/hosts hosts
283247ca3deSSteve Price# echo myclient > myname
284247ca3deSSteve Price# echo 192.197.96.12 > hostname.le0
285247ca3deSSteve Price.Ed
286247ca3deSSteve Price.Pp
287247ca3deSSteve PriceNote that "le0" above should be replaced with the name of
288247ca3deSSteve Pricethe network interface that the client will use for booting.
289247ca3deSSteve Price.Pp
290247ca3deSSteve Price.It 10.
291247ca3deSSteve PriceCorrect the critical mount points and the swap file in the client's
292247ca3deSSteve Price.Pa /etc/fstab
293247ca3deSSteve Price(which will be
294247ca3deSSteve Price.Pa /export/myclient/root/etc/fstab )
295247ca3deSSteve Priceie.
296247ca3deSSteve Price.Bd -literal -offset indent -compact
297247ca3deSSteve Pricemyserver:/export/myclient/root / nfs rw 0 0
298247ca3deSSteve Pricemyserver:/usr /usr nfs rw 0 0
299247ca3deSSteve Pricemyserver:/export/myclient/swap none swap sw,nfsmntpt=/swap
300247ca3deSSteve Price.Ed
301247ca3deSSteve Price.Pp
302247ca3deSSteve PriceNote, you must specify the swap file in
303247ca3deSSteve Price.Pa /etc/fstab
304247ca3deSSteve Priceor it will not be used!
305247ca3deSSteve Price.El
306247ca3deSSteve Price.Sh FILES
307247ca3deSSteve Price.Bl -tag -width /usr/mdec/rbootd -compact
308247ca3deSSteve Price.It Pa /etc/ethers
309247ca3deSSteve PriceEthernet addresses of known clients
310247ca3deSSteve Price.It Pa /etc/bootparams
311247ca3deSSteve Priceclient root pathname
312247ca3deSSteve Price.It Pa /etc/exports
313247ca3deSSteve Priceexported NFS mount points
314247ca3deSSteve Price.It Pa /etc/rbootd.conf
315247ca3deSSteve Priceconfiguration file for HP Remote Boot Daemon
316247ca3deSSteve Price.It Pa /tftpboot
317247ca3deSSteve Pricelocation of boot programs loaded by the Sun PROM
318247ca3deSSteve Price.It Pa /usr/mdec/rbootd
319247ca3deSSteve Pricelocation of boot programs loaded by the HP Boot ROM
320247ca3deSSteve Price.El
321247ca3deSSteve Price.Sh "SEE ALSO"
322247ca3deSSteve Price.Xr rarpd 8 ,
323247ca3deSSteve Price.Xr ethers 5 ,
324247ca3deSSteve Price.Xr tftpd 8 ,
325247ca3deSSteve Price.Xr bootparamd 8 ,
326247ca3deSSteve Price.Xr bootparams 5 ,
327247ca3deSSteve Price.Xr mountd 8 ,
328247ca3deSSteve Price.Xr exports 5 ,
329247ca3deSSteve Price.Xr nfsd 8 ,
330247ca3deSSteve Price.Xr rbootd 8 ,
331247ca3deSSteve Price.Xr reboot 8
332