home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BURKS 2
/
BURKS_AUG97.ISO
/
BURKS
/
LINUX
/
HOWTO
/
mini
/
nfsrootc.txt
< prev
next >
Wrap
Text File
|
1997-07-07
|
16KB
|
350 lines
NFS-Root-Client Mini-Howto
Ofer Maor, ofer@hadar.co.il
v3, 5 December 1996
The purpose of this Mini-Howto is to explain how to create client root
directories on a server that is using NFS Root mounted clients.
You can find the latest version of this Howto (HTML or Text) at
URL: http://www.hadar.co.il/ofer/nfs-root-client/
1. Copyright
(c) 1996 Ofer Maor <ofer@hadar.co.il>
Unless otherwise stated, Linux HOWTO documents are copyrighted by
their respective authors. Linux HOWTO documents may be reproduced and
distributed in whole or in part, in any medium physical or electronic,
as long as this copyright notice is retained on all copies. Commercial
redistribution is allowed and encouraged; however, the author would
like to be notified of any such distributions.
All translations, derivative works, or aggregate works incorporating
any Linux HOWTO documents must be covered under this copyright notice.
That is, you may not produce a derivative work from a HOWTO and impose
additional restrictions on its distribution. Exceptions to these rules
may be granted under certain conditions; please contact the Linux
HOWTO coordinator at the address given below.
In short, we wish to promote dissemination of this information through
as many channels as possible. However, we do wish to retain copyright
on the HOWTO documents, and would like to be notified of any plans to
redistribute the HOWTOs.
If you have questions, please contact Ofer Maor <ofer@hadar.co.il>, the
author of this mini-HOWTO, or Greg Hankins, the Linux HOWTO coordinator,
at gregh@sunsite.unc.edu via email.
If you have anything to add to this Mini-Howto, Please mail the author
(Ofer Maor <ofer@hadar.co.il>), with the information. Any new relevant
information would be appreciated.
1.1. Thanks
I would like to express my thanks to the author of the NFS-Root Howto,
Andreas Kostyrca (andreas@medman.ag.or.at). His Mini-Howto helped me
with the first steps in creating a NFS Root Mounted client. My
Mini-Howto does not, in any way, try to replace his work, but to
enhance it using my experiences in this process.
I would also like to thank Mark Kushinsky (mark026@ibm.net) for
polishing the english and spelling of this Howto, thus making it much
more readable.
2. Preface
This Mini-Howto was written in order to help people who want to use
NFS Root mounting to create their client's directories. Please note
that there are many ways to accomplish this, depending on your needs
and intent. If the clients are individual, and each client has its own
users and administrator, it will be necessary to make significant
parts of the client dirs not shared with other clients. On the other
hand if the client is intended for multiple users, and are all
administrated by the same person (for instance, a computer class),
make as many files as possible shareable in order to make
administration more manageable. This Howto will focus on the second
issue.
2.1. General Overview
When building a client's root directory, and trying to limit ourselves
to the minimum client size, we mainly focus on which files can we
share, or mount from the server. In this Howto I will recommend the
configuration of a client based on my experience. But before we begin
please note:
* This Mini-Howto does not explain how to do the actual NFS Root
mounting. Reffer to the NFS-Root Mini-Howto if you need more
information about that issue.
* I based most of my client's configuration on mounts and symbolic
links. A lot of those symbolic links can be replaced by hardlinks.
One should choose according to his personal preference. Putting a
hardlink over a mount and a symbolic link has its advantages, but
might cause confusion. A file will not be erased until all its
hardlinks are removed. Thus, In order to prevent a case in which you
upgrade a certain file, and the hardlinks still refer to the older
version, you will have to be very careful and keep track of every
link you put.
* While mounting the information from the server, two concepts can be
used. The first (most common) concept, is to mount the whole server
root directory under a local directory, and then just change the
path or link the relevant directories there. I personally dislike
mounting root partitions of a server on clients. Thus, this Howto
suggests a way to mount the relevant directories of the server to
the relevant places on the system.
* This Howto is based on my experience building client directories on
a Slackware 3.1 based distribution. Things may be different
(especially on the rc.* files), for other users, however the
concepts should still remain the same.
3. Creating the client's root directory
3.1. Creating the directory tree
First of all, you need to create the directory structure itself. I
created all the clients under /clients/hostname and I will use it for
my examples listed below. This, however, can be changed to anything
else. The first stage, then, is to create the relevant directories in
the root directory. You should create the following directories:
bin, dev, etc, home, lib, mnt, proc, sbin, server, tmp, usr, var
and any other directories you might want to have on your system.
The local, proc, and dev directories will be used separately on each
machine while the rest of the directories will be either party or
completely shared with the rest of the clients.
3.2. Creating the minimal file system needed for boot
3.2.1. Creating the dev dir.
Although the dev dir can be shared, it is better to create a separate
one for each client. You can create your client's dev directory with
the appropriate MAKEDEV scripts, however in most cases it is simpler
just to copy it from the server:
cp -a /dev /clients/hostname
You should keep in mind that /dev/mouse, /dev/cdrom and /dev/modem are
symbolic links to actually devices, and therefore you should be sure
that they are linked correctly to fit the client's hardware.
3.2.2. Copying the necessary binaries.
Although we mount everything from the server, there is a minimum that
we need to copy to each client. First of all, we need "init", our
system will not be able to run anything before init'ing (as the author
found out in the hard way ;-). So first, you should copy /sbin/init to
your client's sbin dir and then so that rc.S will run, you should copy
/bin/sh to the client's bin directory. Also, in order to mount
everything you need to copy /sbin/mount to the client's sbin directory.
This is the minimum, assuming the first line in your rc.S is mount -av.
However, I recommend copying a few more files: update, ls, rm, cp and
umount, so that you will have the basic tools in case the client has
problems mounting. If you choose to leave your swap on line before
mount, you should also copy the swapon binary.
Since most of these binaries are by default dynamically linked, you
will also need to copy a fair part of /lib:
cp -a /lib/ld.* /lib/libc.* /lib/libcursses.* /client/hostname/lib
Hardlinking the binaries themselves, instead of copying them, should
be considered. Please read my comments on this in part 2.1 of this
Howto.
Please notice, all of the information above assumes that the kernel
has been given the network parameters while booting up. If you plan to
use rarp or bootp, you will probably need the relevant binaries for
these as well.
Generally, you will need the minimum of files that will enable you to
configure the network and run rc.S up to the point where it mounts the
rest of the file system.
3.2.3. The var directory
The var directory, in most cases, should be separate for each client.
However, a lot of the data can be shared. Create under the server
directory a directory called var. We will mount the server's var
directory there. To create the local var directory, simply type:
cp -a /var /clients/hostname/
Now, you have a choice as to what you want to sep