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

  1.   NFS-Root Mini-Howto
  2.   Andreas Kostyrka, andreas@ag.or.at
  3.   v7, 3 February 1997
  4.  
  5.   This Mini-HOWTO tries explains how to setup a ``disc-less'' Linux
  6.   workstation, which mounts it's root filesystems via NFS.  The newest
  7.   version of this Mini-Howto can always be found in
  8.   ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/mini/NFS-Root or on any
  9.   sunsite mirror NEAR YOU.
  10.  
  11.   1.  Copyright
  12.  
  13.   (c) 1996 Andreas Kostyrka (andreas@ag.or.at or h9207884@falbala.wu-
  14.   wien.ac.at)
  15.  
  16.   Unless otherwise stated, Linux HOWTO documents are copyrighted by
  17.   their respective authors. Linux HOWTO documents may be reproduced and
  18.   distributed in whole or in part, in any medium physical or electronic,
  19.   as long as this copyright notice is retained on all copies. Commercial
  20.   redistribution is allowed and encouraged; however, the author would
  21.   like to be notified of any such distributions.
  22.  
  23.   All translations, derivative works, or aggregate works incorporating
  24.   any Linux HOWTO documents must be covered under this copyright notice.
  25.   That is, you may not produce a derivative work from a HOWTO and impose
  26.   additional restrictions on its distribution. Exceptions to these rules
  27.   may be granted under certain conditions; please contact the Linux
  28.   HOWTO coordinator at the address given below.
  29.  
  30.   In short, we wish to promote dissemination of this information through
  31.   as many channels as possible. However, we do wish to retain copyright
  32.   on the HOWTO documents, and would like to be notified of any plans to
  33.   redistribute the HOWTOs.
  34.  
  35.   If you have questions, please contact Andreas Kostyrka
  36.   <mailto:andreas@ag.or.at>, the author of this mini-HOWTO, or Greg
  37.   Hankins, the Linux HOWTO coordinator, at
  38.   <mailto:gregh@sunsite.unc.edu> via email, or at +1 404 853 9989.
  39.  
  40.   1.1.  Contributors
  41.  
  42.   ╖  Avery Pennarun <apenwarr@foxnet.net> (how to boot without LILO)
  43.  
  44.   ╖   Ofer Maor <ofer@hadar.co.il> (providing a better mini howto about
  45.      setting up discless workstations.)
  46.  
  47.   ╖  Christian Leutloff <leutloff@sundancer.tng.oche.de> (providing
  48.      infos about netboot.)
  49.  
  50.   2.  General Overview
  51.  
  52.   Generally speaking there are the following problems for the
  53.   workstation:
  54.  
  55.   ╖  It must find out it's own IP-address, and if needed also the rest
  56.      of the Ethernet configuration.
  57.  
  58.   ╖  It must know the NFS-server and the mount path to it's root
  59.      filesystem.
  60.  
  61.   The current implementation of NFSROOT in the Linux kernel (as of
  62.   1.3.7x) allows for the following ``solutions'':
  63.  
  64.   ╖  The IP-address may be discovered by RARP, or the full ethernet
  65.      configuration may be passed to the kernel via kernel parameters by
  66.      LILO or LOADLIN.
  67.  
  68.   ╖  The NFS-path to mount can be passed via kernel parameters. If this
  69.      is not done, the kernel assumes the RARP-server also as NFS-server,
  70.      and uses compiled in default for the path part. (current default
  71.      value in the kernel: /tftpboot/<IP-address of the machine>.)
  72.  
  73.   ╖  The client configuration may be discovered by BOOTP.
  74.  
  75.   Before starting to setup a discless enviroment, you should decide if
  76.   you will be booting via LILO or LOADLIN. The advantage of doing so is
  77.   flexibility, the disadvantage is speed. Booting a Linux kernel without
  78.   LILO is faster. This may or may not be a consideration.
  79.  
  80.   3.  Setup on the server
  81.  
  82.   3.1.  Compiling the kernels
  83.  
  84.   RARP support in the kernel of the server will probably be a good idea.
  85.   You must have it if you will boot without kernel parameters. On the
  86.   other hand it doesn't help you, if the client isn't on the same subnet
  87.   than the server.
  88.  
  89.   The kernel for the workstation needs the following as a minimum set
  90.   compiled in:
  91.  
  92.   ╖  NFS-filesystem compiled in. (It doesn't need to have ext2-support
  93.      compiled in, a module suffices.)
  94.  
  95.   ╖  ``Root on NFS'' must be enabled.
  96.  
  97.   ╖  The Ethernet driver for the network card of the workstation must be
  98.      compiled in.
  99.  
  100.   ╖  Depending upon your needs you may have to include RARP or BOOTBP
  101.      support for NFS-Root. (By this I mean the questions that are asked
  102.      after the NFS question in make config.)
  103.  
  104.   If the workstation will be booted without kernel parameters, you need
  105.   also to set the root device to 0:255. Do this by creating a dummy
  106.   device file with mknod /dev/nfsroot b 0 255. After having created such
  107.   a device file, you can set root device of the kernel image with rdev
  108.   <kernel-image> /dev/nfsroot.
  109.  
  110.   3.2.  Creation of the root filesystem
  111.  
  112.   3.2.1.  Copying the filesystem
  113.  
  114.    Warning: while these instruction might work for you, they are by no
  115.   means sensefull in a production enviroment. For a better way to setup
  116.   a root filesystem for the clients, see the NFS-Root-Client mini howto
  117.   by Ofer Maor <ofer@hadar.co.il>.
  118.  
  119.   After having decided where to place the root tree, create it with
  120.   (e.g.) mkdir -p <directory> and tar cClf / - | tar xpCf <directory> -.
  121.  
  122.   If you boot your kernel without LILO, then the rootdir has to be
  123.   /tftpboot/<IP-address>. If you don't like it, you can change it in the
  124.   top Makefile in the kernel sources, look for a line like: NFS_ROOT =
  125.   -DNFS_ROOT=" If you change this, you have to recompile the kernel.
  126.  
  127.   3.2.2.  Changes to the root filesystem
  128.  
  129.   Now trim the unneeded files, and check the /etc/rc.d scripts. Some
  130.   important points:
  131.  
  132.   ╖  One important thing is eth0 setup. The workstation comes up with a,
  133.      at least partially, setup eth0. Setting up the IP-address of the
  134.      workstation to the the IP-Address of the server is not considered a
  135.      clever thing to do. (As it happened to the author on one of his
  136.      early attempts.)
  137.  
  138.   ╖  Another point is the /etc/fstab of the workstation. It should be
  139.      setup for nfs filesystems.
  140.  
  141.   ╖  WARNING: Don't confuse the server root filesystem and the
  142.      workstation root filesystem. (I've already patched up a rc.inet1 on
  143.      the server, and wondered why the workstation still didn't work.)
  144.  
  145.   3.2.3.  Exporting the filesystem
  146.  
  147.   Export the root dir to the work station. See exports(5). You most
  148.   likely will have to restart the nfsd/mountd after this change.  Under
  149.   RedHat this can easily be done by typing /etc/rc.d/init.d/nfs stop ;
  150.   /etc/rc.d/init.d/nfs start .
  151.  
  152.   3.2.4.  RARP setup
  153.  
  154.   Setup the RARP somewhere on the net. If you boot without a nfsroot
  155.   parameter, the RARP server has to be the NFS server. Usually this will
  156.   be the NFS server. To do this, you will need to run a kernel with RARP
  157.   support.
  158.  
  159.   To do this, execute (and install it somewhere in /etc/rc.d of the
  160.   server!):
  161.  
  162.   /sbin/rarp -s <ip-addr> <hardware-addr>
  163.  
  164.   where
  165.  
  166.      ip-addr
  167.         is the IP address of the workstation, and
  168.  
  169.      hardware-addr
  170.         is the Ethernet address of the network card of the workstation.
  171.  
  172.   example: /sbin/rarp -s 131.131.90.200 00:00:c0:47:10:12
  173.  
  174.   You can also use a symbolic name instead of the IP-address, as long
  175.   the server is able to find out the IP-address. (/etc/hosts or DNS
  176.   lookups)
  177.  
  178.   3.2.5.  BOOTP setup
  179.  
  180.   For BOOTP setup you need to edit /etc/bootptab. Please consult the
  181.   bootpd(8) and bootptab(5) man pages.
  182.  
  183.   3.2.6.  Finding out hardware addresses
  184.  
  185.   I don't know the hardware address! How can I find it out?
  186.  
  187.   ╖  Boot the kernel disk you made, and watch for the line where the
  188.      network card is recognized. It usually contains 6 hex bytes, that
  189.      should be the address of the card.
  190.  
  191.   ╖  Boot the workstation with some OS with TCP/IP networking enabled.
  192.      Then ping the workstation from the server. Look in the ARP-cache by
  193.      executing: /sbin/arp -a
  194.  
  195.   4.  Booting the workstation
  196.  
  197.   4.1.  Using a boot rom
  198.  
  199.   As I have not used such a beast myself yet, I can give you only the
  200.   following tips (courtesy of Christian Leutloff
  201.   <leutloff@sundancer.tng.oche.de>):
  202.  
  203.   ╖  You can't use ``normal'' bootroms.
  204.  
  205.   ╖  There is a netboot packet by Gero Kuhlmann, that provides for
  206.      bootroms for Linux, and further information. netboot is available
  207.      from the local Linux mirror, or as a Debian package (netboot-0.4).
  208.  
  209.   ╖  Read the documentation coming with your boot rom carefully.
  210.  
  211.   ╖  You probably will have to enable the tftpd on the server, but this
  212.      depends upon your boot rom's way of loading the kernel.
  213.  
  214.   ╖  Any informations on boot