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. 27950c15fcSAlexey Zelkin.\" 287f3dea24SPeter Wemm.\" $FreeBSD$ 29247ca3deSSteve Price.\" 30247ca3deSSteve Price.Dd October 2, 1994 31247ca3deSSteve Price.Dt DISKLESS 8 32247ca3deSSteve Price.Os 33247ca3deSSteve Price.Sh NAME 34247ca3deSSteve Price.Nm diskless 35247ca3deSSteve Price.Nd booting a system over the network 36247ca3deSSteve Price.Sh DESCRIPTION 37247ca3deSSteve PriceThe ability to boot a machine over the network is useful for 38950c15fcSAlexey Zelkin.Em diskless 39247ca3deSSteve Priceor 40950c15fcSAlexey Zelkin.Em dataless 41247ca3deSSteve Pricemachines, or as a temporary measure while repairing or 42247ca3deSSteve Pricere-installing filesystems on a local disk. 43247ca3deSSteve PriceThis file provides a general description of the interactions between 44247ca3deSSteve Pricea client and its server when a client is booting over the network. 45247ca3deSSteve PriceThe general description is followed by specific instructions for 46247ca3deSSteve Priceconfiguring a server for diskless Sun clients. 47247ca3deSSteve Price.Sh OPERATION 48247ca3deSSteve PriceWhen booting a system over the network, there are three 49247ca3deSSteve Pricephases of interaction between client and server: 50247ca3deSSteve Price.Pp 513136363fSRuslan Ermilov.Bl -enum -compact 523136363fSRuslan Ermilov.It 53247ca3deSSteve PriceThe PROM (or stage-1 bootstrap) loads a boot program. 543136363fSRuslan Ermilov.It 55247ca3deSSteve PriceThe boot program loads a kernel. 563136363fSRuslan Ermilov.It 57247ca3deSSteve PriceThe kernel does NFS mounts for root. 58247ca3deSSteve Price.El 59247ca3deSSteve Price.Pp 60247ca3deSSteve PriceEach of these phases are described in further detail below. 61247ca3deSSteve Price.Pp 62247ca3deSSteve PriceIn phase 1, the PROM loads a boot program. PROM designs 63247ca3deSSteve Pricevary widely, so this phase is inherently machine-specific. 64247ca3deSSteve PriceSun machines use 65247ca3deSSteve Price.Tn RARP 66247ca3deSSteve Priceto determine the client's 67247ca3deSSteve Price.Tn IP 68247ca3deSSteve Priceaddress and then use 69247ca3deSSteve Price.Tn TFTP 70247ca3deSSteve Priceto download a boot program from whoever sent the 71247ca3deSSteve Price.Tn RARP 72247ca3deSSteve Pricereply. HP 300-series machines use the 73247ca3deSSteve Price.Tn HP Remote Maintenance Protocol 74247ca3deSSteve Priceto download a boot program. 75247ca3deSSteve PriceTypical personal computers may load a 76247ca3deSSteve Pricenetwork boot program either from diskette or 77247ca3deSSteve Priceusing a special PROM on the network card. 78247ca3deSSteve Price.Pp 79247ca3deSSteve PriceIn phase 2, the boot program loads a kernel. Operation in 80247ca3deSSteve Pricethis phase depends on the design of the boot program. 81247ca3deSSteve Price(The design described here is the one used by Sun and NetBSD/hp300.) 82247ca3deSSteve PriceThe boot program: 83247ca3deSSteve Price.Pp 843136363fSRuslan Ermilov.Bl -tag -width \&2.2 -compact 85247ca3deSSteve Price.It 2.1 86247ca3deSSteve Pricegets the client IP address using 87247ca3deSSteve Price.Tn RARP . 88247ca3deSSteve Price.It 2.2 89247ca3deSSteve Pricegets the client name and server 90247ca3deSSteve Price.Tn IP 91247ca3deSSteve Priceaddress by broadcasting an 92247ca3deSSteve Price.Tn RPC / BOOTPARAMS / WHOAMI 93247ca3deSSteve Pricerequest with the client IP address. 94247ca3deSSteve Price.It 2.3 95247ca3deSSteve Pricegets the server path for this client's 96247ca3deSSteve Priceroot using an 97247ca3deSSteve Price.Tn RPC / BOOTPARAMS / GETFILE 98247ca3deSSteve Pricerequest with the client name. 99247ca3deSSteve Price.It 2.4 100247ca3deSSteve Pricegets the root file handle by calling 101247ca3deSSteve Price.Xr mountd 8 102247ca3deSSteve Pricewith the server path for the client root. 103247ca3deSSteve Price.It 2.5 104247ca3deSSteve Pricegets the kernel file handle by calling 105247ca3deSSteve Price.Tn NFS 106247ca3deSSteve Pricelookup on the root file handle. 107247ca3deSSteve Price.It 2.6 108247ca3deSSteve Priceloads the kernel using 109247ca3deSSteve Price.Tn NFS 110247ca3deSSteve Priceread calls on the kernel file handle. 111247ca3deSSteve Price.It 2.7 112247ca3deSSteve Pricetransfers control to the kernel entry point. 113247ca3deSSteve Price.El 114247ca3deSSteve Price.Pp 115247ca3deSSteve PriceIn phase 3, the kernel does NFS mounts for root. 116247ca3deSSteve PriceThe kernel repeats much of the work done by the boot program 117247ca3deSSteve Pricebecause there is no standard way for the boot program to pass 118247ca3deSSteve Pricethe information it gathered on to the kernel. 119247ca3deSSteve PriceThe procedure used by the kernel is as follows: 120247ca3deSSteve Price.Pp 1213136363fSRuslan Ermilov.Bl -tag -width \&2.2 -compact 122247ca3deSSteve Price.It 3.1 123247ca3deSSteve PriceThe kernel finds a boot server using the same procedure 124247ca3deSSteve Priceas described in steps 2.1 and 2.2 above. 125247ca3deSSteve Price.It 3.2 126247ca3deSSteve PriceThe kernel gets the 127247ca3deSSteve Price.Tn NFS 128247ca3deSSteve Pricefile handle for root using the same procedure 129247ca3deSSteve Priceas described in steps 2.3 through 2.5 above. 130247ca3deSSteve Price.It 3.3 131247ca3deSSteve PriceThe kernel calls the 132247ca3deSSteve Price.Tn NFS 133247ca3deSSteve Pricegetattr function to get the last-modified time of the root 134247ca3deSSteve Pricedirectory, and uses it to check the system clock. 135247ca3deSSteve Price.El 136247ca3deSSteve Price.Sh CONFIGURATION 137247ca3deSSteve PriceBefore a client can boot over the network, 138247ca3deSSteve Priceits server must be configured correctly. 139247ca3deSSteve PriceThis example will demonstrate how a Sun client 140247ca3deSSteve Pricemight be configured -- other clients should be similar. 141247ca3deSSteve Price.Pp 142247ca3deSSteve PriceAssuming the client's hostname is to be 143247ca3deSSteve Price"myclient", 144247ca3deSSteve Price.Pp 1453136363fSRuslan Ermilov.Bl -enum 1463136363fSRuslan Ermilov.It 147247ca3deSSteve PriceAdd an entry to 148247ca3deSSteve Price.Pa /etc/ethers 149247ca3deSSteve Pricecorresponding to the client's ethernet address: 150247ca3deSSteve Price.Bd -literal -offset indent -compact 151247ca3deSSteve Price8:0:20:7:c5:c7 myclient 152247ca3deSSteve Price.Ed 153247ca3deSSteve PriceThis will be used by 154247ca3deSSteve Price.Xr rarpd 8 . 1553136363fSRuslan Ermilov.It 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 1623136363fSRuslan Ermilov.It 163247ca3deSSteve PriceIf booting a Sun machine, ensure that 164247ca3deSSteve Price.Pa /etc/inetd.conf 165247ca3deSSteve Priceis configured to run 166247ca3deSSteve Price.Xr tftpd 8 167247ca3deSSteve Pricein the directory 168247ca3deSSteve Price.Pa /tftpboot . 169247ca3deSSteve Price.Pp 170247ca3deSSteve PriceIf booting an HP 300-series machine, ensure that 171247ca3deSSteve Price.Pa /etc/rbootd.conf 172247ca3deSSteve Priceis configured properly to transfer the boot program to the client. 173247ca3deSSteve PriceAn entry might look like this: 174247ca3deSSteve Price.Bd -literal -offset indent -compact 175247ca3deSSteve Price08:00:09:01:23:E6 SYS_UBOOT # myclient 176247ca3deSSteve Price.Ed 177247ca3deSSteve Price.Pp 178247ca3deSSteve PriceSee the 179247ca3deSSteve Price.Xr rbootd 8 180247ca3deSSteve Pricemanual page for more information. 1813136363fSRuslan Ermilov.It 182247ca3deSSteve PriceIf booting a SPARC machine, install a copy of the appropriate diskless boot 183247ca3deSSteve Priceloader (such as 184247ca3deSSteve Price.Pa /usr/mdec/boot ) 185247ca3deSSteve Pricein the 186247ca3deSSteve Price.Pa /tftpboot 187247ca3deSSteve Pricedirectory. 188247ca3deSSteve PriceMake a link such that the boot program is 189247ca3deSSteve Priceaccessible by a file name composed of the client's IP address 190247ca3deSSteve Pricein HEX, a dot, and the architecture name (all upper case). 191247ca3deSSteve PriceFor example: 192247ca3deSSteve Price.Bd -literal -offset indent -compact 193247ca3deSSteve Price# cd /tftpboot 194247ca3deSSteve Price# ln -s boot C0C5600C.SUN4 195247ca3deSSteve Price.Ed 196247ca3deSSteve Price.Pp 197247ca3deSSteve PriceFor a Sun3 machine, the name would be just C0C5600C 198247ca3deSSteve Price(the sun3 PROM does not append the architecture name). The name 199247ca3deSSteve Priceused is architecture dependent, it simply has to match what the 200247ca3deSSteve Pricebooting client's PROM wishes to it to be. 201247ca3deSSteve PriceIf the client's PROM fails to fetch the expected file, 2020d3dc5eaSChris Costello.Xr tcpdump 1 203247ca3deSSteve Pricecan be used to discover which filename the client is trying to read. 204247ca3deSSteve Price.Pp 205247ca3deSSteve PriceIf booting an HP 300-series machine, ensure that the network boot program 206247ca3deSSteve Price.Pa SYS_UBOOT 207247ca3deSSteve Price(which may be called 208247ca3deSSteve Price.Pa uboot.lif 209247ca3deSSteve Pricebefore installation) 210247ca3deSSteve Priceis installed in the directory 211247ca3deSSteve Price.Pa /usr/mdec/rbootd . 2123136363fSRuslan Ermilov.It 213247ca3deSSteve PriceAdd myclient to the bootparams database 214247ca3deSSteve Price.Pa /etc/bootparams : 215247ca3deSSteve Price.Bd -literal -offset indent -compact 216247ca3deSSteve Pricemyclient root=server:/export/myclient/root 217247ca3deSSteve Price.Ed 218247ca3deSSteve Price.Pp 2197ac6273fSAlexey ZelkinNote: For the swap file to be mountable, you have to make sure that mountd is 2207ac6273fSAlexey Zelkinstarted with the 2217ac6273fSAlexey Zelkin.Fl r 2227ac6273fSAlexey Zelkinflag. 2233136363fSRuslan Ermilov.It 224247ca3deSSteve PriceBuild the swap file for myclient: 225247ca3deSSteve Price.Bd -literal -offset indent -compact 226247ca3deSSteve Price# mkdir /export/myclient 227247ca3deSSteve Price# cd /export/myclient 228247ca3deSSteve Price# dd if=/dev/zero of=swap bs=16k count=1024 229247ca3deSSteve Price.Ed 230247ca3deSSteve PriceThis creates a 16 Megabyte swap file. 2313136363fSRuslan Ermilov.It 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 2453136363fSRuslan Ermilov.It 246247ca3deSSteve PriceExport the required filesystems in 247247ca3deSSteve Price.Pa /etc/exports : 248247ca3deSSteve Price.Bd -literal -offset indent -compact 249247ca3deSSteve Price/usr -ro myclient 250247ca3deSSteve Price# for SunOS: 251247ca3deSSteve Price# /export/myclient -rw=myclient,root=myclient 252247ca3deSSteve Price# for NetBSD: 253247ca3deSSteve Price/export/myclient -maproot=root -alldirs myclient 254247ca3deSSteve Price.Ed 255247ca3deSSteve Price.Pp 256247ca3deSSteve PriceIf the server and client are of the same architecture, then the client 257247ca3deSSteve Pricecan share the server's 258247ca3deSSteve Price.Pa /usr 259247ca3deSSteve Pricefilesystem (as is done above). 260247ca3deSSteve PriceIf not, you must build a properly fleshed out 261247ca3deSSteve Price.Pa /usr 262247ca3deSSteve Pricepartition for the client in some other place. 263247ca3deSSteve Price.Pp 264247ca3deSSteve PriceIf your server was a sparc, and your client a sun3, 265247ca3deSSteve Priceyou might create and fill 266247ca3deSSteve Price.Pa /export/usr.sun3 267247ca3deSSteve Priceand then use the following 268247ca3deSSteve Price.Pa /etc/exports 269247ca3deSSteve Pricelines: 270247ca3deSSteve Price.Bd -literal -offset indent -compact 271247ca3deSSteve Price/export/usr.sun3 -ro myclient 272247ca3deSSteve Price/export/myclient -rw=myclient,root=myclient 273247ca3deSSteve Price.Ed 2743136363fSRuslan Ermilov.It 275247ca3deSSteve PriceCopy and customize at least the following files in 276247ca3deSSteve Price.Pa /export/myclient/root : 277247ca3deSSteve Price.Bd -literal -offset indent -compact 278247ca3deSSteve Price# cd /export/myclient/root/etc 279247ca3deSSteve Price# cp fstab.nfs fstab 280247ca3deSSteve Price# cp /etc/hosts hosts 281247ca3deSSteve Price# echo myclient > myname 282247ca3deSSteve Price# echo 192.197.96.12 > hostname.le0 283247ca3deSSteve Price.Ed 284247ca3deSSteve Price.Pp 285247ca3deSSteve PriceNote that "le0" above should be replaced with the name of 286247ca3deSSteve Pricethe network interface that the client will use for booting. 2873136363fSRuslan Ermilov.It 288247ca3deSSteve PriceCorrect the critical mount points and the swap file in the client's 289247ca3deSSteve Price.Pa /etc/fstab 290247ca3deSSteve Price(which will be 291247ca3deSSteve Price.Pa /export/myclient/root/etc/fstab ) 292247ca3deSSteve Priceie. 293247ca3deSSteve Price.Bd -literal -offset indent -compact 294247ca3deSSteve Pricemyserver:/export/myclient/root / nfs rw 0 0 295247ca3deSSteve Pricemyserver:/usr /usr nfs rw 0 0 296247ca3deSSteve Pricemyserver:/export/myclient/swap none swap sw,nfsmntpt=/swap 297247ca3deSSteve Price.Ed 298247ca3deSSteve Price.Pp 299247ca3deSSteve PriceNote, you must specify the swap file in 300247ca3deSSteve Price.Pa /etc/fstab 301247ca3deSSteve Priceor it will not be used! 302247ca3deSSteve Price.El 303247ca3deSSteve Price.Sh FILES 304247ca3deSSteve Price.Bl -tag -width /usr/mdec/rbootd -compact 305247ca3deSSteve Price.It Pa /etc/ethers 306247ca3deSSteve PriceEthernet addresses of known clients 307247ca3deSSteve Price.It Pa /etc/bootparams 308247ca3deSSteve Priceclient root pathname 309247ca3deSSteve Price.It Pa /etc/exports 310247ca3deSSteve Priceexported NFS mount points 311247ca3deSSteve Price.It Pa /etc/rbootd.conf 312247ca3deSSteve Priceconfiguration file for HP Remote Boot Daemon 313247ca3deSSteve Price.It Pa /tftpboot 314247ca3deSSteve Pricelocation of boot programs loaded by the Sun PROM 315247ca3deSSteve Price.It Pa /usr/mdec/rbootd 316247ca3deSSteve Pricelocation of boot programs loaded by the HP Boot ROM 317247ca3deSSteve Price.El 318950c15fcSAlexey Zelkin.Sh SEE ALSO 319247ca3deSSteve Price.Xr bootparams 5 , 320bceb8aedSWolfram Schneider.Xr ethers 5 , 321247ca3deSSteve Price.Xr exports 5 , 322bceb8aedSWolfram Schneider.Xr bootparamd 8 , 323bceb8aedSWolfram Schneider.Xr mountd 8 , 324247ca3deSSteve Price.Xr nfsd 8 , 325bceb8aedSWolfram Schneider.Xr rarpd 8 , 326247ca3deSSteve Price.Xr rbootd 8 , 327bceb8aedSWolfram Schneider.Xr reboot 8 , 328bceb8aedSWolfram Schneider.Xr tftpd 8 329