2003-05-25 23:53:07 +04:00
|
|
|
.\" $NetBSD: diskless.8,v 1.27 2003/05/25 19:53:07 fair Exp $
|
1994-10-18 09:48:51 +03:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1994 Gordon W. Ross, Theo de Raadt
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. The name of the author may not be used to endorse or promote products
|
|
|
|
.\" derived from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2003-05-25 23:53:07 +04:00
|
|
|
.Dd May 25, 2003
|
1994-10-18 09:48:51 +03:00
|
|
|
.Dt DISKLESS 8
|
1999-03-17 23:31:19 +03:00
|
|
|
.Os
|
1994-10-18 09:48:51 +03:00
|
|
|
.Sh NAME
|
|
|
|
.Nm diskless
|
|
|
|
.Nd booting a system over the network
|
|
|
|
.Sh DESCRIPTION
|
2003-05-22 10:45:55 +04:00
|
|
|
The ability to boot a system over the network is useful for
|
|
|
|
two kinds of systems:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width diskless
|
|
|
|
.It Em diskless
|
|
|
|
a system with no attached mass storage media to boot or run from
|
|
|
|
.Pq e.g. a network computer .
|
|
|
|
.It Em dataless
|
|
|
|
a system with a hard drive that only contains system and application
|
|
|
|
software, and user data is mounted over the network from a central server.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
It can also be done as a temporary measure while repairing or
|
2001-06-24 05:04:49 +04:00
|
|
|
re-installing file systems on a local disk.
|
2003-05-22 10:45:55 +04:00
|
|
|
This capability is necessarily platform dependent because of its
|
|
|
|
dependence on system firmware support; not all platforms supported by
|
|
|
|
.Nx
|
|
|
|
are capable of being network booted.
|
|
|
|
.Pp
|
|
|
|
The protocols used to obtain a network address
|
|
|
|
.Pq e.g. an Tn \&IP host address ,
|
|
|
|
include, but are not limited to:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width BOOTP -offset indent -compact
|
|
|
|
.It Tn RARP
|
|
|
|
Reverse Address Resolution Protocol
|
|
|
|
.Pq Tn ARP
|
|
|
|
.It Tn DHCP
|
|
|
|
Dynamic Host Configuration Protocol
|
|
|
|
.It Tn BOOTP
|
|
|
|
Bootstrap Protocol
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
This information can also be derived from non-volatile
|
|
|
|
.Tn RAM
|
|
|
|
or by a transform of a network interface
|
|
|
|
.Pq e.g. Tn Ethernet
|
|
|
|
.Tn MAC
|
|
|
|
address.
|
|
|
|
.Pp
|
|
|
|
The protocols used to load a
|
|
|
|
.Nx
|
|
|
|
kernel over a network include, but are not limited to:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width TFTP -offset indent -compact
|
|
|
|
.It Tn TFTP
|
|
|
|
Trivial File Transfer Protocol
|
|
|
|
.It Tn NFS
|
|
|
|
.Tn Sun
|
|
|
|
Network File System
|
|
|
|
.It Tn RMP
|
|
|
|
.Tn \&HP
|
|
|
|
Remote Maintenance Protocol
|
|
|
|
.It Tn MOP
|
|
|
|
.Tn DEC
|
|
|
|
Maintenance Operations Protocol
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Derivation of the filename of the secondary bootstrap program can
|
|
|
|
be done by a transform of a network interface
|
|
|
|
.Tn MAC
|
|
|
|
address
|
|
|
|
.Pq or other protocol address ,
|
|
|
|
or provided by a server as with
|
|
|
|
.Tn BOOTP ,
|
|
|
|
and
|
|
|
|
.Tn DHCP .
|
|
|
|
How this is done is platform dependent; see
|
|
|
|
.Xr boot 8 .
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nx
|
|
|
|
kernel doesn't care how it gets loaded and started.
|
|
|
|
The protocols used to boot
|
|
|
|
.Nx
|
|
|
|
can be completely different than the ones that
|
|
|
|
.Nx
|
2003-05-22 11:06:53 +04:00
|
|
|
uses operationally, i.e. you can netboot the system using
|
2003-05-22 10:45:55 +04:00
|
|
|
.Tn \&HP
|
|
|
|
.Tn RMP
|
|
|
|
and the
|
|
|
|
.Nx
|
|
|
|
kernel can use
|
|
|
|
.Tn \&IP
|
|
|
|
to communicate after bootstrap.
|
|
|
|
.Pp
|
|
|
|
There is no standard way to pass all the required information
|
|
|
|
from a boot loader to an operating system kernel, so the
|
|
|
|
.Nx
|
|
|
|
kernel usually has to recapitulate the same
|
|
|
|
.Pq or similar
|
|
|
|
protocol exchanges over the network to obtain a network address,
|
|
|
|
determine which servers to use, and so on.
|
|
|
|
.Nx
|
|
|
|
supports obtaining this information from
|
|
|
|
.Tn RARP ,
|
|
|
|
.Tn BOOTP ,
|
|
|
|
.Tn DHCP ,
|
|
|
|
and
|
|
|
|
.Tn Sun RPC
|
|
|
|
.Qq bootparams .
|
|
|
|
See
|
|
|
|
.Xr options 4
|
|
|
|
for a list of methods that can be compiled into a
|
|
|
|
.Nx
|
|
|
|
kernel.
|
|
|
|
.Pp
|
|
|
|
.Nx
|
|
|
|
only supports the
|
|
|
|
.Tn Sun
|
|
|
|
Network File System
|
|
|
|
.Pq Tn NFS
|
|
|
|
for mounting its root file system over a network.
|
|
|
|
.Nx
|
|
|
|
can use any local mass storage device for which it has a driver,
|
|
|
|
after bootstrap, even if that device is not supported by the system's
|
|
|
|
firmware for booting.
|
|
|
|
.Pp
|
|
|
|
.Sy N.B.
|
|
|
|
.Tn DHCP
|
|
|
|
is essentially a series of extensions to
|
|
|
|
.Tn BOOTP ;
|
|
|
|
the
|
|
|
|
.Nx
|
|
|
|
.Xr dhcpd 8
|
|
|
|
is capable of responding to both kinds of protocol requests.
|
|
|
|
.Pp
|
|
|
|
In the majority of configurations, network boot servers and clients
|
|
|
|
are attached to the same
|
|
|
|
.Tn LAN
|
|
|
|
so that broadcast queries from the clients can be heard by the servers.
|
|
|
|
Unless specially configured, routers block broadcasts from propagating from
|
|
|
|
.Tn LAN
|
|
|
|
to
|
|
|
|
.Tn LAN ;
|
|
|
|
some routers can be configured to
|
|
|
|
.Qq forward
|
|
|
|
broadcast
|
|
|
|
.Tn BOOTP
|
|
|
|
packets to another
|
|
|
|
.Tn LAN
|
|
|
|
attached to that router, which permits a server on that remote
|
|
|
|
.Tn LAN
|
|
|
|
to respond to the client's broadcast query.
|
1994-10-18 09:48:51 +03:00
|
|
|
.Sh OPERATION
|
|
|
|
When booting a system over the network, there are three
|
|
|
|
phases of interaction between client and server:
|
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
.Bl -enum -compact
|
|
|
|
.It
|
|
|
|
The system firmware
|
2003-05-15 06:03:45 +04:00
|
|
|
.Pq or stage-1 bootstrap
|
|
|
|
loads a boot program.
|
2003-05-22 10:45:55 +04:00
|
|
|
.It
|
|
|
|
The boot program loads a
|
|
|
|
.Nx
|
|
|
|
kernel.
|
|
|
|
.It
|
|
|
|
The
|
|
|
|
.Nx
|
|
|
|
kernel performs an
|
2001-06-24 05:04:49 +04:00
|
|
|
.Tn NFS
|
2003-05-22 10:45:55 +04:00
|
|
|
mount of the root file system.
|
1994-10-18 09:48:51 +03:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Each of these phases are described in further detail below.
|
2003-05-22 10:45:55 +04:00
|
|
|
.Ss 1. loading a boot program
|
|
|
|
In phase 1, the system firmware loads a boot program.
|
|
|
|
Firmware designs vary widely,
|
|
|
|
so this phase is inherently machine-specific.
|
|
|
|
Some examples:
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
.Tn DEC
|
|
|
|
Alpha systems use
|
|
|
|
.Tn BOOTP
|
1994-10-18 09:48:51 +03:00
|
|
|
to determine the client's
|
2003-05-22 10:45:55 +04:00
|
|
|
.Tn \&IP
|
1994-10-18 09:48:51 +03:00
|
|
|
address and then use
|
|
|
|
.Tn TFTP
|
2003-05-22 10:45:55 +04:00
|
|
|
load a secondary bootstrap program from the server and filename
|
|
|
|
specified in the
|
|
|
|
.Tn BOOTP
|
|
|
|
reply.
|
|
|
|
.Tn DEC
|
|
|
|
Alpha systems can also use
|
|
|
|
.Tn MOP
|
|
|
|
to load a program to run the system.
|
|
|
|
.Pp
|
|
|
|
.Tn Sun
|
|
|
|
systems use
|
|
|
|
.Tn RARP
|
|
|
|
to determine the client's
|
|
|
|
.Tn \&IP
|
|
|
|
address, transform that address to a hexadecimal string to form
|
|
|
|
the filename of the secondary boot program, and then use
|
|
|
|
.Tn TFTP
|
|
|
|
to download the boot program from the server that sent the
|
1994-10-18 09:48:51 +03:00
|
|
|
.Tn RARP
|
2003-05-15 06:03:45 +04:00
|
|
|
reply.
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
|
|
|
.Tn \&HP
|
|
|
|
300-series systems use the
|
|
|
|
.Tn \&HP
|
|
|
|
.Tn RMP
|
1995-09-02 21:12:32 +04:00
|
|
|
to download a boot program.
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
Typical personal computers may load a network boot program either
|
|
|
|
from diskette or from a
|
|
|
|
.Tn PROM
|
|
|
|
on a Network Interface Card
|
|
|
|
.Pq Tn NIC .
|
|
|
|
Some
|
|
|
|
.Tn BIOS Ns No \&es
|
|
|
|
support booting from a network interface.
|
|
|
|
.Ss 2. loading a kernel
|
|
|
|
In phase 2, the secondary boot program loads a kernel.
|
|
|
|
Operation in this phase depends on the design of the boot program
|
2003-05-15 06:03:45 +04:00
|
|
|
.Po
|
2003-05-22 10:45:55 +04:00
|
|
|
the design described here is the one used by
|
|
|
|
.Tn Sun
|
|
|
|
and
|
2003-05-15 06:03:45 +04:00
|
|
|
.Nx Ns Tn /hp300
|
|
|
|
.Pc .
|
1994-10-18 09:48:51 +03:00
|
|
|
The boot program:
|
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
.Bl -enum -compact
|
|
|
|
.It
|
|
|
|
gets the client
|
|
|
|
.Tn \&IP
|
|
|
|
address using
|
1994-10-18 09:48:51 +03:00
|
|
|
.Tn RARP .
|
2003-05-22 10:45:55 +04:00
|
|
|
.It
|
1994-10-18 09:48:51 +03:00
|
|
|
gets the client name and server
|
2003-05-22 10:45:55 +04:00
|
|
|
.Tn \&IP
|
1994-10-18 09:48:51 +03:00
|
|
|
address by broadcasting an
|
|
|
|
.Tn RPC / BOOTPARAMS / WHOAMI
|
2003-05-22 10:45:55 +04:00
|
|
|
request with the client
|
|
|
|
.Tn \&IP
|
|
|
|
address.
|
|
|
|
.It
|
1994-10-18 09:48:51 +03:00
|
|
|
gets the server path for this client's
|
|
|
|
root using an
|
|
|
|
.Tn RPC / BOOTPARAMS / GETFILE
|
|
|
|
request with the client name.
|
2003-05-22 10:45:55 +04:00
|
|
|
.It
|
1994-10-18 09:48:51 +03:00
|
|
|
gets the root file handle by calling
|
|
|
|
.Xr mountd 8
|
2003-05-22 10:45:55 +04:00
|
|
|
with the server path for the client root file system.
|
|
|
|
.It
|
1994-10-18 09:48:51 +03:00
|
|
|
gets the kernel file handle by calling
|
|
|
|
.Tn NFS
|
2003-05-22 10:45:55 +04:00
|
|
|
.Fn lookup
|
|
|
|
on the root file handle.
|
|
|
|
.It
|
1994-10-18 09:48:51 +03:00
|
|
|
loads the kernel using
|
|
|
|
.Tn NFS
|
|
|
|
read calls on the kernel file handle.
|
2003-05-22 10:45:55 +04:00
|
|
|
.It
|
1994-10-18 09:48:51 +03:00
|
|
|
transfers control to the kernel entry point.
|
|
|
|
.El
|
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
A
|
|
|
|
.Tn BOOTP
|
|
|
|
and/or
|
|
|
|
.Tn DHCP
|
|
|
|
secondary bootstrap program will do the following:
|
|
|
|
.Pp
|
|
|
|
.Bl -enum -compact
|
|
|
|
.It
|
|
|
|
query for the client's bootstrap parameters.
|
|
|
|
The response must include the client's
|
|
|
|
.Tn \&IP
|
|
|
|
address, and a
|
|
|
|
.Tn TFTP
|
|
|
|
server to load the
|
|
|
|
.Nx
|
|
|
|
kernel from.
|
|
|
|
.It
|
|
|
|
loads the
|
|
|
|
.Nx
|
|
|
|
kernel from the
|
|
|
|
.Tn TFTP
|
|
|
|
server.
|
|
|
|
.It
|
|
|
|
transfers control to the kernel entry point.
|
|
|
|
.El
|
|
|
|
.Ss 3. NFS mounting the root file system
|
|
|
|
In phase 3, the kernel performs an
|
2001-06-24 05:04:49 +04:00
|
|
|
.Tn NFS
|
2003-05-22 10:45:55 +04:00
|
|
|
mount of the root file system.
|
1994-10-18 09:48:51 +03:00
|
|
|
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.
|
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
In general, the GENERIC kernel
|
1998-01-26 10:23:20 +03:00
|
|
|
.Xr config 8
|
2003-05-22 10:45:55 +04:00
|
|
|
file for any particular architecture will specify compile-time
|
|
|
|
options to use the same protocol used by the secondary boot program
|
|
|
|
for that architecture.
|
|
|
|
A
|
|
|
|
.Nx
|
|
|
|
kernel can be compiled to use any of
|
2003-05-15 06:03:45 +04:00
|
|
|
.Tn BOOTP ,
|
|
|
|
.Tn DHCP ,
|
|
|
|
or
|
2003-05-22 10:45:55 +04:00
|
|
|
.Tn Sun RPC BOOTPARAMS ;
|
|
|
|
see
|
1998-01-26 10:23:20 +03:00
|
|
|
.Xr options 4 .
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
|
|
|
The procedure typically used by the kernel is as follows:
|
|
|
|
.Pp
|
|
|
|
.Bl -enum -compact
|
|
|
|
.It
|
|
|
|
The kernel finds a boot server using the same procedures
|
|
|
|
as described above to determine the client's
|
|
|
|
.Tn \&IP
|
|
|
|
address, an
|
|
|
|
.Tn NFS
|
|
|
|
server, etc.
|
|
|
|
.It
|
1994-10-18 09:48:51 +03:00
|
|
|
The kernel gets the
|
|
|
|
.Tn NFS
|
2003-05-22 10:45:55 +04:00
|
|
|
file handle for root using the same procedure as described above.
|
|
|
|
.It
|
1994-10-18 09:48:51 +03:00
|
|
|
The kernel calls the
|
|
|
|
.Tn NFS
|
2003-05-22 10:45:55 +04:00
|
|
|
.Fn getattr
|
|
|
|
function to get the last-modified time of the root
|
1994-10-18 09:48:51 +03:00
|
|
|
directory, and uses it to check the system clock.
|
|
|
|
.El
|
2003-05-22 10:45:55 +04:00
|
|
|
.Sh SERVER CONFIGURATION
|
|
|
|
Before a client can bootstrap over the network,
|
|
|
|
its server must be configured.
|
|
|
|
Each daemon that implements these protocols must be set up so
|
|
|
|
that it can answer queries from the clients.
|
|
|
|
Some of these daemons are invoked as packets come in, by
|
|
|
|
.Xr inetd 8 ,
|
|
|
|
and some must run independently, started from
|
|
|
|
.Pa /etc/rc ;
|
|
|
|
see
|
|
|
|
.Xr rc.conf 5 .
|
|
|
|
.Pp
|
|
|
|
.Bl -column "Protocol" "rpc.bootparamd" "inetd.conf(5)" -offset indent
|
|
|
|
.It Sy Protocol Ta Sy Program Ta Sy Startup
|
|
|
|
.It RARP Ta rarpd Ta Xr rc.conf 5
|
|
|
|
.It DHCP Ta dhcpd Ta Xr rc.conf 5
|
|
|
|
.It BOOTP Ta bootpd Ta Xr inetd.conf 5
|
|
|
|
.It TFTP Ta tfptd Ta Xr inetd.conf 5
|
|
|
|
.It Sun RPC Ta rpcbind Ta Xr rc.conf 5
|
|
|
|
.It Sun RPC Ta rpc.bootparamd Ta Xr rc.conf 5
|
|
|
|
.It Sun NFS Ta mountd Ta Xr rc.conf 5
|
|
|
|
.It Sun NFS Ta nfsiod Ta Xr rc.conf 5
|
|
|
|
.It \&HP RMP Ta rbootd Ta Xr rc.conf 5
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
.Sy N.B.
|
|
|
|
.Tn DHCP
|
|
|
|
is essentially a series of extensions to
|
|
|
|
.Tn BOOTP ;
|
|
|
|
the
|
|
|
|
.Nx
|
|
|
|
.Xr dhcpd 8
|
|
|
|
is capable of responding to both kinds of protocol requests.
|
|
|
|
Since they both bind to the same
|
|
|
|
.Tn UDP
|
|
|
|
port, only one may be run on a given server.
|
|
|
|
.Pp
|
|
|
|
In the following examples, the client's hostname is
|
|
|
|
.Sy myclient ;
|
|
|
|
the server is
|
|
|
|
.Sy myserver ,
|
|
|
|
and the addresses are all fictional.
|
|
|
|
In these examples
|
|
|
|
the hostnames may be Fully Qualified Domain Names
|
|
|
|
.Pq FQDN, e.g. Qq myclient.mydomain.com
|
|
|
|
provided that they are used consistently.
|
|
|
|
.Ss RARP
|
|
|
|
For clients that use
|
|
|
|
.Tn RARP
|
|
|
|
to obtain their
|
|
|
|
.Tn \&IP
|
|
|
|
address,
|
|
|
|
an entry must be added for each client to
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pa /etc/ethers
|
2003-05-22 10:45:55 +04:00
|
|
|
with the client's
|
|
|
|
.Tn Ethernet
|
|
|
|
.Tn MAC
|
|
|
|
address and Internet hostname:
|
|
|
|
.Pp
|
1994-10-18 09:48:51 +03:00
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
8:0:20:7:c5:c7 myclient
|
|
|
|
.Ed
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
1994-10-18 09:48:51 +03:00
|
|
|
This will be used by
|
2003-05-22 10:45:55 +04:00
|
|
|
.Xr rarpd 8
|
|
|
|
to reply to queries from the clients.
|
|
|
|
There must be one entry per client system.
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
A client system's
|
2003-05-22 11:06:53 +04:00
|
|
|
.Tn Ethernet
|
2003-05-22 10:45:55 +04:00
|
|
|
.Tn MAC
|
|
|
|
address is often printed on the system case, or on a chip on its
|
|
|
|
motherboard, or on the
|
|
|
|
.Tn NIC .
|
|
|
|
If not,
|
|
|
|
.Qq sniffing
|
|
|
|
the network with
|
|
|
|
.Xr tcpdump 8
|
|
|
|
when the client is powered-on should reveal its
|
2003-05-22 11:06:53 +04:00
|
|
|
.Tn Ethernet
|
2003-05-22 10:45:55 +04:00
|
|
|
.Tn MAC
|
|
|
|
address.
|
|
|
|
.Pp
|
|
|
|
Each client system that uses
|
|
|
|
.Tn RARP
|
|
|
|
must have its own, unique
|
|
|
|
.Tn \&IP
|
|
|
|
address assigned to it.
|
|
|
|
Assign an
|
|
|
|
.Tn \&IP
|
|
|
|
address for myclient in your
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pa /etc/hosts
|
2003-05-22 10:45:55 +04:00
|
|
|
file, or in the master file for your
|
2003-05-15 06:03:45 +04:00
|
|
|
.Tn DNS
|
2003-05-22 10:45:55 +04:00
|
|
|
zone.
|
|
|
|
For
|
|
|
|
.Pa /etc/hosts
|
2003-05-22 11:06:53 +04:00
|
|
|
the entry should look like:
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
1994-10-18 09:48:51 +03:00
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
192.197.96.12 myclient
|
|
|
|
.Ed
|
2003-05-22 10:45:55 +04:00
|
|
|
.Ss DHCP/BOOTP
|
|
|
|
The
|
|
|
|
.Nx
|
|
|
|
.Tn DHCP
|
|
|
|
server
|
|
|
|
.Xr dhcpd 8
|
|
|
|
was developed by the Internet Software Consortium
|
|
|
|
.Pq ISC ;
|
|
|
|
.Pa http://www.isc.org/
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
.Tn DHCP
|
|
|
|
can provide a wide range of information to a requesting client;
|
|
|
|
the key data for bootstrapping a diskless client are:
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
.Bl -enum -compact
|
|
|
|
.It
|
|
|
|
an
|
|
|
|
.Tn \&IP
|
|
|
|
address
|
|
|
|
.It
|
|
|
|
a subnet mask
|
|
|
|
.It
|
|
|
|
a
|
|
|
|
.Tn TFTP
|
|
|
|
server address for loading the secondary bootstrap and the
|
|
|
|
.Nx
|
|
|
|
kernel
|
|
|
|
.It
|
|
|
|
a filename of the secondary bootstrap
|
|
|
|
.It
|
|
|
|
an
|
|
|
|
.Tn NFS
|
|
|
|
server address for the client's file system
|
|
|
|
.It
|
|
|
|
the client's root file system path, to be
|
|
|
|
.Tn NFS
|
|
|
|
mounted.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
An example for
|
|
|
|
.Pa /etc/dhcpd.conf
|
|
|
|
.Pp
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
host myclient {
|
|
|
|
hardware ethernet 8:0:20:7:c5:c7;
|
|
|
|
fixed-address myclient; # client's assigned IP address
|
|
|
|
filename "myclient.netboot"; # secondary bootstrap
|
2003-05-25 23:53:07 +04:00
|
|
|
next-server myserver; # NFS server
|
|
|
|
option swap-server myserver;
|
|
|
|
option root-path "/export/myclient/root";
|
2003-05-22 10:45:55 +04:00
|
|
|
}
|
1995-09-02 21:12:32 +04:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
That
|
|
|
|
.Sy host
|
|
|
|
declaration goes inside a
|
|
|
|
.Sy subnet
|
|
|
|
declaration, which gives parameters for all hosts on the subnet
|
|
|
|
that will be using
|
|
|
|
.Tn DHCP ,
|
|
|
|
such as the
|
|
|
|
.Qq routers
|
|
|
|
.Pq the default route ,
|
|
|
|
.Qq subnet-mask ,
|
|
|
|
.Qq broadcast-address ,
|
|
|
|
.Qq domain-name-servers ,
|
|
|
|
etc.
|
|
|
|
See
|
|
|
|
.Xr dhcpd.conf 5
|
|
|
|
for details.
|
|
|
|
In that example,
|
|
|
|
.Sy myclient
|
|
|
|
has an assigned IP address.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Tn DHCP
|
|
|
|
parameters required for network bootstrapping a system will vary
|
|
|
|
from platform to platform, as dictated by each system's firmware.
|
2003-05-25 23:53:07 +04:00
|
|
|
In particular, because the
|
|
|
|
.Tn DHCP
|
|
|
|
is extensible, some hardware vendors have specified
|
|
|
|
.Tn DHCP
|
|
|
|
options to return information to requesting clients that are specific
|
|
|
|
to that platform.
|
2003-05-22 10:45:55 +04:00
|
|
|
Please see your platform's
|
|
|
|
.Xr boot 8
|
|
|
|
for details.
|
|
|
|
.Ss TFTP
|
|
|
|
If booting a
|
|
|
|
.Tn Sun
|
|
|
|
system, or other system that expects to use
|
|
|
|
.Tn TFTP ,
|
|
|
|
ensure that
|
|
|
|
.Xr inetd 8
|
|
|
|
is configured to run
|
|
|
|
.Xr tftpd 8 .
|
|
|
|
The
|
|
|
|
.Xr tftpd 8
|
|
|
|
server should be set up to serve the directory
|
|
|
|
.Pa /tftpboot .
|
1995-09-02 21:12:32 +04:00
|
|
|
.Pp
|
2003-05-15 06:03:45 +04:00
|
|
|
If booting a
|
|
|
|
.Tn SPARC
|
2003-05-22 10:45:55 +04:00
|
|
|
system, install a copy of the appropriate diskless secondary boot
|
2003-05-15 06:03:45 +04:00
|
|
|
loader
|
|
|
|
.Po
|
|
|
|
such as
|
2001-06-24 05:04:49 +04:00
|
|
|
.Pa /usr/mdec/boot
|
|
|
|
or
|
2003-05-15 06:03:45 +04:00
|
|
|
.Pa ofwboot.net
|
|
|
|
.Pc
|
1997-06-16 11:50:35 +04:00
|
|
|
in the
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pa /tftpboot
|
|
|
|
directory.
|
|
|
|
Make a link such that the boot program is
|
2003-05-22 10:45:55 +04:00
|
|
|
accessible by a filename composed of the client's
|
|
|
|
.Tn \&IP
|
|
|
|
address in hexadecimal, a dot, and the architecture name
|
2003-05-15 06:03:45 +04:00
|
|
|
.Pq all upper case .
|
1994-10-18 09:48:51 +03:00
|
|
|
For example:
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
1994-10-18 09:48:51 +03:00
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
# cd /tftpboot
|
1997-06-16 11:50:35 +04:00
|
|
|
# ln -s boot C0C5600C.SUN4
|
1994-10-18 09:48:51 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
2003-05-15 06:03:45 +04:00
|
|
|
For a
|
2003-05-22 10:45:55 +04:00
|
|
|
.Tn Sun-3
|
|
|
|
or
|
2003-05-15 06:03:45 +04:00
|
|
|
.Tn UltraSPARC
|
2003-05-22 10:45:55 +04:00
|
|
|
system, the filename would be just C0C5600C
|
2003-05-15 06:03:45 +04:00
|
|
|
.Po
|
2003-05-22 10:45:55 +04:00
|
|
|
these systems' firmware does not append the architecture name
|
2003-05-15 06:03:45 +04:00
|
|
|
.Pc .
|
2003-05-22 10:45:55 +04:00
|
|
|
The name used is architecture dependent, it simply has to match
|
|
|
|
what the booting client's system firmware wishes to it to be.
|
|
|
|
.Pp
|
2003-05-22 11:06:53 +04:00
|
|
|
If the client's system firmware fails to fetch the expected file,
|
1994-10-18 09:48:51 +03:00
|
|
|
.Xr tcpdump 8
|
2003-05-22 10:45:55 +04:00
|
|
|
can be used to discover which filename the client is being requested.
|
|
|
|
Also, examination of
|
|
|
|
.Xr tftpd 8
|
|
|
|
log entries
|
|
|
|
.Po
|
|
|
|
typically in
|
|
|
|
.Pa /var/log/messages
|
|
|
|
.Pc
|
|
|
|
should show whether the server is hearing the client system, and
|
|
|
|
what filename the client is asking for.
|
|
|
|
.Ss HP RMP
|
|
|
|
If booting an
|
|
|
|
.Tn HP
|
|
|
|
300-series system, ensure that
|
|
|
|
.Pa /etc/rbootd.conf
|
|
|
|
is configured properly to transfer the boot program to the client.
|
|
|
|
An entry might look like this:
|
|
|
|
.Pp
|
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
08:00:09:01:23:E6 SYS_UBOOT # myclient
|
|
|
|
.Ed
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
The secondary bootstrap program for an
|
|
|
|
.Tn \&HP
|
|
|
|
300-series system
|
1996-08-24 23:39:43 +04:00
|
|
|
.Pa SYS_UBOOT
|
2003-05-15 06:03:45 +04:00
|
|
|
.Po
|
|
|
|
which may be called
|
1996-08-24 23:39:43 +04:00
|
|
|
.Pa uboot.lif
|
2003-05-15 06:03:45 +04:00
|
|
|
before installation
|
|
|
|
.Pc
|
2003-05-22 10:45:55 +04:00
|
|
|
must be installed in the directory
|
1995-09-02 21:12:32 +04:00
|
|
|
.Pa /usr/mdec/rbootd .
|
2001-06-24 05:04:49 +04:00
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
See the
|
|
|
|
.Xr rbootd 8
|
|
|
|
manual page for more information.
|
|
|
|
.Ss Sun RPC BOOTPARAMS
|
|
|
|
Add
|
|
|
|
.Sy myclient
|
|
|
|
to the bootparams database in
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pa /etc/bootparams :
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
1994-10-18 09:48:51 +03:00
|
|
|
.Bd -literal -offset indent -compact
|
2003-05-22 10:45:55 +04:00
|
|
|
myclient root=myserver:/export/myclient/root \\
|
|
|
|
swap=myserver:/export/myclient/root/swap \\
|
|
|
|
dump=myserver:/export/myclient/root/swap
|
1994-10-18 09:48:51 +03:00
|
|
|
.Ed
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
2001-06-24 05:04:49 +04:00
|
|
|
and ensure that
|
|
|
|
.Xr rpc.bootparamd 8
|
2003-05-22 10:45:55 +04:00
|
|
|
and
|
|
|
|
.Xr rpcbind 8
|
|
|
|
are running.
|
|
|
|
Both
|
|
|
|
.Sy myclient
|
|
|
|
and
|
|
|
|
.Sy myserver
|
|
|
|
must have
|
|
|
|
.Tn \&IP
|
|
|
|
addresses in the
|
|
|
|
.Tn DNS
|
|
|
|
or
|
|
|
|
.Pa /etc/hosts .
|
|
|
|
.Ss Diskless Client File Systems
|
|
|
|
Build the swap file for
|
|
|
|
.Sy myclient
|
|
|
|
on the
|
|
|
|
.Tn NFS
|
|
|
|
server:
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pp
|
|
|
|
.Bd -literal -offset indent -compact
|
1998-09-08 14:08:30 +04:00
|
|
|
# cd /export/myclient/root
|
1994-10-18 09:48:51 +03:00
|
|
|
# dd if=/dev/zero of=swap bs=16k count=1024
|
|
|
|
.Ed
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
2003-05-15 06:03:45 +04:00
|
|
|
This creates a 16 megabyte swap file.
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
Populate
|
|
|
|
.Sy myclient Ns No 's
|
|
|
|
root file system on the
|
|
|
|
.Tn NFS
|
|
|
|
server.
|
|
|
|
How this is done depends on the client architecture and the version
|
|
|
|
of the
|
1998-02-06 08:54:12 +03:00
|
|
|
.Nx
|
|
|
|
distribution.
|
1994-10-18 09:48:51 +03:00
|
|
|
It can be as simple as copying and modifying the server's root
|
2003-05-22 10:45:55 +04:00
|
|
|
file system, or unpack a complete
|
|
|
|
.Nx
|
|
|
|
binary distribution for the appropriate platform.
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
If the
|
|
|
|
.Tn NFS
|
|
|
|
server is going to support multiple different architectures
|
|
|
|
.Po
|
|
|
|
e.g.
|
|
|
|
.Tn Alpha ,
|
|
|
|
.Tn PowerPC ,
|
|
|
|
.Tn SPARC ,
|
|
|
|
.Tn MIPS
|
|
|
|
.Pc ,
|
|
|
|
then it is important to think carefully about how to lay out the
|
|
|
|
.Tn NFS
|
|
|
|
server's exported file systems, to share what can be shared
|
|
|
|
.Pq e.g. text files, configuration files, user home directories ,
|
|
|
|
and separate that which is distinct to each architecture
|
|
|
|
.Pq e.g. binary executables, libraries .
|
|
|
|
.Ss NFS
|
|
|
|
Export the client-populated file systems on the
|
|
|
|
.Tn NFS
|
|
|
|
server in
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pa /etc/exports :
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
1994-10-18 09:48:51 +03:00
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
/usr -ro myclient
|
1995-08-09 01:37:40 +04:00
|
|
|
# for SunOS:
|
|
|
|
# /export/myclient -rw=myclient,root=myclient
|
|
|
|
# for NetBSD:
|
1996-02-18 04:10:55 +03:00
|
|
|
/export/myclient -maproot=root -alldirs myclient
|
1994-10-18 09:48:51 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
If the server and client are of the same architecture, then the client
|
|
|
|
can share the server's
|
|
|
|
.Pa /usr
|
2003-05-22 10:45:55 +04:00
|
|
|
file system
|
|
|
|
.Pq as is done above .
|
1994-10-18 09:48:51 +03:00
|
|
|
If not, you must build a properly fleshed out
|
|
|
|
.Pa /usr
|
2003-05-22 10:45:55 +04:00
|
|
|
partition for the client in some other part of the server's
|
|
|
|
file system, to serve to the client.
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
If your server is a
|
|
|
|
.Tn SPARC ,
|
|
|
|
and your client a
|
|
|
|
.Tn Sun-3 ,
|
1994-10-18 09:48:51 +03:00
|
|
|
you might create and fill
|
|
|
|
.Pa /export/usr.sun3
|
|
|
|
and then use the following
|
|
|
|
.Pa /etc/exports
|
|
|
|
lines:
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
1994-10-18 09:48:51 +03:00
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
/export/usr.sun3 -ro myclient
|
|
|
|
/export/myclient -rw=myclient,root=myclient
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2001-06-24 05:04:49 +04:00
|
|
|
Of course, in either case you will have to have an
|
|
|
|
.Tn NFS
|
|
|
|
server running on the server side.
|
2003-05-22 10:45:55 +04:00
|
|
|
.Sh CLIENT CONFIGURATION
|
1994-10-18 09:48:51 +03:00
|
|
|
Copy and customize at least the following files in
|
|
|
|
.Pa /export/myclient/root :
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
1994-10-18 09:48:51 +03:00
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
# cd /export/myclient/root/etc
|
2001-06-24 05:04:49 +04:00
|
|
|
# vi fstab
|
1994-10-18 09:48:51 +03:00
|
|
|
# cp /etc/hosts hosts
|
2002-02-13 11:17:26 +03:00
|
|
|
# echo 'hostname="myclient"' \*[Gt]\*[Gt] rc.conf
|
|
|
|
# echo "inet 192.197.96.12" \*[Gt] ifconfig.le0
|
1994-10-18 09:48:51 +03:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Note that "le0" above should be replaced with the name of
|
2003-05-22 10:45:55 +04:00
|
|
|
the network interface that the client will use for booting;
|
|
|
|
the network interface name is device dependent in
|
|
|
|
.Nx .
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pp
|
1997-06-16 11:50:35 +04:00
|
|
|
Correct the critical mount points and the swap file in the client's
|
1994-10-18 09:48:51 +03:00
|
|
|
.Pa /etc/fstab
|
2003-05-22 10:45:55 +04:00
|
|
|
.Po
|
|
|
|
which will be
|
|
|
|
.Pa /export/myclient/root/etc/fstab
|
|
|
|
.Pc
|
2001-06-24 05:04:49 +04:00
|
|
|
i.e.
|
2003-05-22 10:45:55 +04:00
|
|
|
.Pp
|
1994-10-18 09:48:51 +03:00
|
|
|
.Bd -literal -offset indent -compact
|
2003-05-22 10:45:55 +04:00
|
|
|
myserver:/export/myclient/root / nfs rw 0 0
|
|
|
|
myserver:/usr /usr nfs rw 0 0
|
|
|
|
/swap none swap sw 0 0
|
1994-10-18 09:48:51 +03:00
|
|
|
.Ed
|
1997-06-16 11:32:15 +04:00
|
|
|
.Pp
|
2003-05-22 10:45:55 +04:00
|
|
|
Note, you
|
|
|
|
.Em must
|
|
|
|
specify the swap file in
|
1997-06-16 11:32:15 +04:00
|
|
|
.Pa /etc/fstab
|
|
|
|
or it will not be used!
|
2003-05-22 10:45:55 +04:00
|
|
|
See
|
|
|
|
.Xr swapctl 8 .
|
1994-10-18 09:48:51 +03:00
|
|
|
.Sh FILES
|
1995-09-02 21:12:32 +04:00
|
|
|
.Bl -tag -width /usr/mdec/rbootd -compact
|
2003-05-22 10:45:55 +04:00
|
|
|
.It Pa /etc/hosts
|
|
|
|
table of associated
|
|
|
|
.Tn \&IP
|
|
|
|
addresses and
|
|
|
|
.Tn \&IP
|
|
|
|
host names; see
|
|
|
|
.Xr hosts 5
|
1994-10-18 09:48:51 +03:00
|
|
|
.It Pa /etc/ethers
|
2003-05-22 10:45:55 +04:00
|
|
|
table of associated
|
2003-05-15 06:03:45 +04:00
|
|
|
.Tn Ethernet
|
2003-05-22 10:45:55 +04:00
|
|
|
.Tn MAC
|
|
|
|
addresses and
|
|
|
|
.Tn \&IP
|
|
|
|
host names used by
|
|
|
|
.Xr rarpd 8 ;
|
|
|
|
see
|
|
|
|
.Xr ethers 5
|
1994-10-18 09:48:51 +03:00
|
|
|
.It Pa /etc/bootparams
|
2003-05-22 10:45:55 +04:00
|
|
|
client root pathname and swap pathname; see
|
|
|
|
.Xr bootparams 5
|
1994-10-18 09:48:51 +03:00
|
|
|
.It Pa /etc/exports
|
2001-06-24 05:04:49 +04:00
|
|
|
exported
|
|
|
|
.Tn NFS
|
2003-05-22 10:45:55 +04:00
|
|
|
mount points; see
|
|
|
|
.Xr exports 5
|
1995-09-02 21:12:32 +04:00
|
|
|
.It Pa /etc/rbootd.conf
|
2003-05-22 10:45:55 +04:00
|
|
|
configuration file for
|
|
|
|
.Tn \&HP RMP ;
|
|
|
|
see
|
|
|
|
.Xr rbootd 8
|
1995-09-02 21:12:32 +04:00
|
|
|
.It Pa /usr/mdec/rbootd
|
2003-05-22 10:45:55 +04:00
|
|
|
location of boot programs offered by
|
|
|
|
.Xr rbootd 8
|
|
|
|
.It Pa /tftpboot
|
|
|
|
location of boot programs offered by
|
|
|
|
.Xr tftpd 8
|
1994-10-18 09:48:51 +03:00
|
|
|
.El
|
1999-04-06 08:54:19 +04:00
|
|
|
.Sh SEE ALSO
|
1994-10-18 09:48:51 +03:00
|
|
|
.Xr bootparams 5 ,
|
2003-05-22 10:45:55 +04:00
|
|
|
.Xr dhcpd.conf 5 ,
|
2001-06-24 05:04:49 +04:00
|
|
|
.Xr ethers 5 ,
|
1994-10-18 09:48:51 +03:00
|
|
|
.Xr exports 5 ,
|
2003-05-22 10:45:55 +04:00
|
|
|
.Xr fstab 5 ,
|
|
|
|
.Xr hosts 5 ,
|
2003-05-22 11:06:53 +04:00
|
|
|
.Xr networks 5 ,
|
|
|
|
.Xr boot 8 ,
|
|
|
|
.Xr dhcpd 8 ,
|
2003-05-22 10:45:55 +04:00
|
|
|
.Xr mopd 8 ,
|
2001-06-24 05:04:49 +04:00
|
|
|
.Xr mountd 8 ,
|
2003-05-22 11:06:53 +04:00
|
|
|
.Xr nfsd 8 ,
|
2001-06-24 05:04:49 +04:00
|
|
|
.Xr rarpd 8 ,
|
1995-09-02 21:12:32 +04:00
|
|
|
.Xr rbootd 8 ,
|
2001-06-24 05:04:49 +04:00
|
|
|
.Xr reboot 8 ,
|
|
|
|
.Xr rpc.bootparamd 8 ,
|
|
|
|
.Xr tftpd 8
|
2003-05-22 10:45:55 +04:00
|
|
|
.Rs
|
|
|
|
.%R RFC
|
|
|
|
.%N 903
|
|
|
|
.%D June 1984
|
|
|
|
.%T "Reverse Address Resolution Protocol"
|
|
|
|
.Re
|
|
|
|
.Rs
|
|
|
|
.%R RFC
|
|
|
|
.%N 906
|
|
|
|
.%D June 1984
|
|
|
|
.%T "Bootstrap Loading using TFTP"
|
|
|
|
.Re
|
|
|
|
.Rs
|
|
|
|
.%R RFC
|
|
|
|
.%N 951
|
|
|
|
.%D September 1985
|
|
|
|
.%T "Bootstrap Protocol"
|
|
|
|
.Re
|
|
|
|
.Rs
|
|
|
|
.%R RFC
|
|
|
|
.%N 1350
|
|
|
|
.%D July 1992
|
|
|
|
.%T "The TFTP Protocol (Revision 2)"
|
|
|
|
.Re
|
|
|
|
.Rs
|
|
|
|
.%R RFC
|
|
|
|
.%N 2131
|
|
|
|
.%D March 1997
|
|
|
|
.%T "Dynamic Host Configuration Protocol"
|
|
|
|
.Re
|
|
|
|
.Rs
|
|
|
|
.%R RFC
|
|
|
|
.%N 2132
|
|
|
|
.%D March 1997
|
|
|
|
.%T "DHCP Options and BOOTP Vendor Extensions"
|
|
|
|
.Re
|
|
|
|
.Pp
|
|
|
|
.Pa http://www.rfc-editor.org/
|