home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LINUX / HOWTO / mini / nfsrootc.txt < prev    next >
Text File  |  1997-07-07  |  16KB  |  350 lines

  1.  
  2.   NFS-Root-Client Mini-Howto
  3.   Ofer Maor, ofer@hadar.co.il
  4.   v3, 5 December 1996 
  5.  
  6.   The purpose of this Mini-Howto is to explain how to create client root
  7.   directories on a server that is using NFS Root mounted clients. 
  8.   You can find the latest version of this Howto (HTML or Text) at 
  9.   URL: http://www.hadar.co.il/ofer/nfs-root-client/
  10.  
  11.   1. Copyright
  12.  
  13.   (c) 1996 Ofer Maor <ofer@hadar.co.il>
  14.  
  15.   Unless otherwise stated, Linux HOWTO documents are copyrighted by
  16.   their respective authors. Linux HOWTO documents may be reproduced and
  17.   distributed in whole or in part, in any medium physical or electronic,
  18.   as long as this copyright notice is retained on all copies. Commercial
  19.   redistribution is allowed and encouraged; however, the author would
  20.   like to be notified of any such distributions.
  21.  
  22.   All translations, derivative works, or aggregate works incorporating
  23.   any Linux HOWTO documents must be covered under this copyright notice.
  24.   That is, you may not produce a derivative work from a HOWTO and impose
  25.   additional restrictions on its distribution. Exceptions to these rules
  26.   may be granted under certain conditions; please contact the Linux
  27.   HOWTO coordinator at the address given below.
  28.  
  29.   In short, we wish to promote dissemination of this information through
  30.   as many channels as possible. However, we do wish to retain copyright
  31.   on the HOWTO documents, and would like to be notified of any plans to 
  32.   redistribute the HOWTOs.
  33.  
  34.   If you have questions, please contact Ofer Maor <ofer@hadar.co.il>, the
  35.   author of this mini-HOWTO, or Greg Hankins, the Linux HOWTO coordinator, 
  36.   at gregh@sunsite.unc.edu via email.
  37.  
  38.   If you have anything to add to this Mini-Howto, Please mail the author 
  39.   (Ofer Maor <ofer@hadar.co.il>), with the information. Any new relevant
  40.   information would be appreciated. 
  41.  
  42.   1.1. Thanks
  43.  
  44.   I would like to express my thanks to the author of the NFS-Root Howto, 
  45.   Andreas Kostyrca (andreas@medman.ag.or.at). His Mini-Howto helped me 
  46.   with the first steps in creating a NFS Root Mounted client. My 
  47.   Mini-Howto does not, in any way, try to replace his work, but to
  48.   enhance it using my experiences in this process.  
  49.  
  50.   I would also like to thank Mark Kushinsky (mark026@ibm.net) for
  51.   polishing the english and spelling of this Howto, thus making it much
  52.   more readable. 
  53.  
  54.  
  55.   2. Preface
  56.  
  57.   This Mini-Howto was written in order to help people who want to use
  58.   NFS Root mounting to create their client's directories. Please note
  59.   that there are many ways to accomplish this, depending on your needs
  60.   and intent. If the clients are individual, and each client has its own
  61.   users and administrator, it will be necessary to make significant
  62.   parts of the client dirs not shared with other clients. On the other
  63.   hand if the client is intended for multiple users, and are all
  64.   administrated by the same person (for instance, a computer class),
  65.   make as many files as possible shareable in order to make
  66.   administration more manageable. This Howto will focus on the second
  67.   issue.
  68.  
  69.   2.1. General Overview
  70.  
  71.   When building a client's root directory, and trying to limit ourselves
  72.   to the minimum client size, we mainly focus on which files can we 
  73.   share, or mount from the server. In this Howto I will recommend the
  74.   configuration of a client based on my experience. But before we begin
  75.   please note:
  76.  
  77.   * This Mini-Howto does not explain how to do the actual NFS Root
  78.     mounting. Reffer to the NFS-Root Mini-Howto if you need more
  79.     information about that issue.
  80.  
  81.   * I based most of my client's configuration on  mounts and symbolic
  82.     links. A lot of those symbolic links can be replaced by hardlinks. 
  83.     One should choose according to his personal preference. Putting a 
  84.     hardlink over a mount and a symbolic link has its advantages, but 
  85.     might cause confusion. A file will not be erased until all its
  86.     hardlinks are removed. Thus, In order to prevent a case in which you
  87.     upgrade a certain file, and the hardlinks still refer to the older
  88.     version, you will have to be very careful and keep track of every
  89.     link you put.
  90.  
  91.   * While mounting the information from the server, two concepts can be
  92.     used. The first (most common) concept, is to mount the whole server
  93.     root directory under a local directory, and then just change the
  94.     path or link the relevant directories there. I personally dislike
  95.     mounting root partitions of a server on clients. Thus, this Howto
  96.     suggests a way to mount the relevant directories of the server to
  97.     the relevant places on the system.
  98.   
  99.   * This Howto is based on my experience building client directories on
  100.     a Slackware 3.1 based distribution. Things may be different 
  101.     (especially on the rc.* files), for other users, however the
  102.     concepts should still remain the same.
  103.  
  104.  
  105.   3. Creating the client's root directory 
  106.  
  107.   3.1. Creating the directory tree
  108.  
  109.   First of all, you need to create the directory structure itself. I
  110.   created all the clients under /clients/hostname and I will use it for
  111.   my examples listed below. This, however, can be changed to anything
  112.   else. The first stage, then, is to create the relevant directories in
  113.   the root directory. You should create the following directories:
  114.  
  115.     bin, dev, etc, home, lib, mnt, proc, sbin, server, tmp, usr, var
  116.  
  117.   and any other directories you might want to have on your system.
  118.  
  119.   The local, proc, and dev directories will be used separately on each
  120.   machine while the rest of the directories will be either party or
  121.   completely shared with the rest of the clients.
  122.  
  123.   3.2. Creating the minimal file system needed for boot
  124.  
  125.   3.2.1. Creating the dev dir.
  126.  
  127.   Although the dev dir can be shared, it is  better to create a separate
  128.   one for each client. You can create your client's dev directory with
  129.   the appropriate MAKEDEV scripts, however in most cases it is simpler
  130.   just to copy it from the server:
  131.  
  132.     cp -a /dev /clients/hostname
  133.  
  134.   You should keep in mind that /dev/mouse, /dev/cdrom and /dev/modem are
  135.   symbolic links to actually devices, and therefore you should be sure
  136.   that they are linked correctly to fit the client's hardware.
  137.  
  138.   3.2.2. Copying the necessary binaries.
  139.  
  140.   Although we mount everything from the server, there is a minimum that
  141.   we need to copy to each client. First of all, we need "init", our
  142.   system will not be able to run anything before init'ing (as the author
  143.   found out in the hard way ;-). So first, you should copy /sbin/init to
  144.   your client's sbin dir and then so that rc.S will run, you should copy
  145.   /bin/sh to the client's bin directory. Also, in order to mount
  146.   everything you need to copy /sbin/mount to the client's sbin directory. 
  147.   This is the minimum, assuming the first line in your rc.S is mount -av.
  148.   However, I recommend copying a few more files: update, ls, rm, cp and
  149.   umount, so that you will have the basic tools in case the client has 
  150.   problems mounting. If you choose to leave your swap on line before 
  151.   mount, you should also copy the swapon binary.
  152.  
  153.   Since most of these binaries are by default dynamically linked, you
  154.   will also need to copy a fair part of /lib:
  155.  
  156.     cp -a /lib/ld.* /lib/libc.* /lib/libcursses.* /client/hostname/lib
  157.  
  158.   Hardlinking the binaries themselves, instead of copying them, should
  159.   be considered. Please read my comments on this in part 2.1 of this
  160.   Howto.
  161.  
  162.   Please notice, all of the information above assumes that the kernel
  163.   has been given the network parameters while booting up. If you plan to
  164.   use rarp or bootp, you will probably need the relevant binaries for
  165.   these as well. 
  166.  
  167.   Generally, you will need the minimum of files that will enable you to
  168.   configure the network and run rc.S up to the point where it mounts the
  169.   rest of the file system.
  170.  
  171.   3.2.3. The var directory
  172.  
  173.   The var directory, in most cases, should be separate for each client.
  174.   However, a lot of the data can be shared. Create under the server
  175.   directory a directory called var. We will mount the server's var
  176.   directory there. To create the local var directory, simply type:
  177.  
  178.     cp -a /var /clients/hostname/
  179.  
  180.   Now, you have a choice as to what you want to sep