Introduction
The fundamental idea is as follows: the PC will get its IP address
from the boot server via the bootp protocol, using 0.0.0.0 as the
initial IP address and according to its hardware address (network
card address) the bootp server will reply proper IP address (
configured in the /etc/boottab file.). Then, the image of the
kernel is sent to the client through tftp server. From now on, we have
two options, either to assign root device as a local hard drive or
export the whole file system through NFS server. The concept is the
same, each machine has its own private data (in local hardisk or in
the NFS server) and share the utilities ( X Window, C++ compiler, and etc.)
from the NFS server (configured in the /etc/exports file).
This project can be extended in the future in the way that: if you want
to run Linux in the SGI machine, you need this kind of
network environment.
Then you can export the kernel and utilities compiled for MIPS.
Bootstrap and Trivial File Transfer Protocols
- BOOTP
- Server: You can run booptd deamon as a stand alone server
or through inetd deamon. In the first case, only type
bootpd -s. In second case, modify /etc/inetd.conf &
/etc/services files to make sure the corresponding deamon isn't
marked. Most important, configure the file,/etc/bootptab, to
let the client with hardware address can find its IP address and
hostname. There are also several useful utility you can test your
bootp server.
- bootpgw: when the request is through different segments,you can use this program as a gateway to forward the request only.
- bootptest: you can test the server in the client first to see if the server is configured correctly.
- bootpef:BOOTP Extension File compiler. You can use to check your syntax in the /etc/bootptab file.
- Client:Get the netboot package
(the package is available from your favorite linux mirror site
in the /pub/Linux/system/Linux-boot directory or
download from here.)
In this package, you can compile the boot image for the client,
which will contain the bootp and tftp clients. You can either burn
the image into your network EPROM or use dd command to
write to the floppy. You also need to convert the kernel image
to the network bootable image (nbi) using the utility in this
package. This package supports Linux and DOS running the client
through BOOTP.
- TFTP
- Server:Edit the files /etc/services & /etc/inetd.conf.Search
tftp string,take the remark off if they are remarked.
- Client:Same as bootp client
Network File System
NFS allows us to share filesystems among computers in an almost transparent manner. NFS was originally implemented as a surrogate filesystem for diskless clients, but has now evolved into a file sharing panacea. NFS consists of several components namely
- Mounting protocol and server
- File locking protocol and server
- Deamons coordinating file services
Basic Operation:
The server "exports" a filesystem when it makes the filesystem available for use by other machines. The client must explicitly mount a filesystem before using it. Upon receiving an initial client mount request, the server checks to see if the client has p
roper authorization and if so, sends the client a "magic cookie" which the client uses for subsequent requests. The daemons involved are
- mountd
Responds to mount requests. /etc/exports file contains a list of files that the server is exporting to the client along with the permissions. The Client can also modify its /etc/fstab file to mount remote files using NFS
- nfsd
Once a client's mount requests have been validated, it is allowed to request various filesystem operations. These requests are executed by nfsd. It is advisable to have multple copies of nfsd running concurrently for improved performance (optimal valu
e = 4)
- rpcbind
rpcbind is a server that converts RPC program numbers into universal addresses. It must be running on the host to be able to make RPC calls on a server on that machine. When an RPC service is started, it tells rpcbind the address at which it is
listening, and the RPC program numbers it is prepared to serve. When a client wishes to make an RPC call to a given program number, it first contacts rpcbind on the server machine to determine the address where RPC requests should be sent.
Diskless Clients:
These machines depend on the NFS server for all filesystem operations.They have
no hard drive of their own and mount their entire filesystem through NFS. They
are totally dependent on the NFS server for their secondary storage and cannot
operate independently. The NFS support is built into the kernel so that they
know that they have to mount all their directories including / through
NFS. The /etc/fstab file identifies the directories that have to be
mounted and their mount points.
Workstation model:
These machines have their own hard drives. They mount directories such as /,
/etc, /var etc. from their own hard drives. User directories are usually
mounted through NFS so that users can access their files irrespective of the
machine into which they log in. /etc/fstab file can be used to mount
these directories. Alternately, mount command can be used to manually
mount required directories. These workstations can work on their own even in
the event of a NFS server crash (of course they would not be of much use!!!!!).
Trouble Shouting
There are several detail issues needs to be taken care of:
- After Linux is installed( Redhat, Slakware, or others), there will
be a bunch of deamons combined with with init program.
Check all these deamons (using ps aux) and disable those
you don't want it or you don't know why they are running. Otherwise,
the request will take lots of time to get the reply without any
reasons.
- The kernel for the clients needs to include NFS-root option. Make
sure the right bootImage is tftped.
- The file system exported for the clients should be runnable.
That means you can not just copy/uncompress the packages. You
need to install and setup these packages just like you are
installing a new system.
- RedHat doesn't follow the usual Linux boot-up procedure. Thus
when exporting the root file system, we stuck at its network setup
and kept getting "NFS: notice ..." error message. After changing
to Slakware distribution, the scripts are much easier to modified
to let the root file system run through NFS server.
Related Documents
HOWTO:
There are several HOWTOs you may want to take a look at.
Example files:
Here are the example files we run in this project.
|