NFS-Root-Client-mini-HOWTO(1).pdf

(26 KB) Pobierz
NFS-Root-Client Mini-HOWTO
NFS−Root−Client Mini−HOWTO
Ofer Maor
v4.1, 02 Feb, 1999
Revision History
Revision 4.1
Feb 02, 1999
Revised by: mo
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.
NFS−Root−Client Mini−HOWTO
Table of Contents
1. Copyright. ........................................................................................................................................................1
1.1. Thanks. ..............................................................................................................................................1
2. Preface. .............................................................................................................................................................2
2.1. General Overview. ............................................................................................................................2
3. Creating the client's root directory. ..............................................................................................................3
3.1. Creating the directory tree. ...............................................................................................................3
3.2. Creating the minimal file system needed for boot. ...........................................................................3
3.2.1. Creating the dev dir.. ........................................................................................................3
3.2.2. Copying the necessary binaries. .......................................................................................3
3.2.3. The var directory. ..............................................................................................................4
3.2.4. The rest of the directories. ................................................................................................4
3.3. Building the etc directory and configuring the clients. .....................................................................4
3.3.1. Building a clients wide etc directory. ...............................................................................5
3.3.2. Creating a client's etc directory.. .......................................................................................5
3.3.3. Creating a client's etc directory.. .......................................................................................6
3.4. Booting Up. .......................................................................................................................................7
4. Creating more clients. .....................................................................................................................................8
i
193219935.001.png
1. Copyright
(c) 1996 Ofer Maor ( < oferm@hcs.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 ( < oferm@hcs.co.il > ), the author of this
mini−HOWTO, or Greg Hankins, the Linux HOWTO coordinator, at < gregh@sunsite.unc.edu > via
email, or at +1 404 853 9989.
If you have anything to add to this Mini−Howto, please mail the author (Ofer Maor,
< oferm@hcs.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.
1. Copyright
1
193219935.002.png
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 computerclass),
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 we can share, or mount from the server. In this Howto I will recommend the
configuration of a client based on my experience. But beforewe begin please note:
· This Mini−Howto does not explain how to do the actual NFS Root mounting. Refer 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.
2. Preface
2
193219935.003.png
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 partly 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:
bash# 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 :
bash# 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
3. Creating the client's root directory
3
193219935.004.png
Zgłoś jeśli naruszono regulamin