home *** CD-ROM | disk | FTP | other *** search
- <!doctype linuxdoc system>
-
- <article>
-
- <!-- Title information -->
-
- <title>NFS-Root Mini-Howto
- <author>Andreas Kostyrka, <tt/andreas@medman.ag.or.at/
- <date>V5, 14 March 1996
- <abstract>
- This Mini-HOWTO tries explains how to setup a ``disc-less'' Linux
- workstation, which mounts it's root filesystems via NFS.
- The newest version of this Mini-Howto can always be found in
- <tt>ftp://ftp.ag.or.at/people/andreas/</tt>.
- </abstract>
-
- <toc>
-
- <sect> Copyright
- <p>
- (c) 1996 Andreas Kostyrka (andreas@medman.ag.or.at or andreas@ag.or.at) <p>
- 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 Andreas Kostyrka
- <<tt/mailto:andreas@ag.or.at/>, the author of this mini-HOWTO, or
- Greg Hankins, the Linux HOWTO coordinator, at
- <<tt/mailto:gregh@sunsite.unc.edu/> via email, or at +1 404 853
- 9989.
-
- <sect1>Contributors
- <p>
- <itemize>
- <item>
- Avery Pennarun <<tt/apenwarr@foxnet.net/> (how to boot without <bf/LILO/)
- </itemize>
-
- <sect>General Overview
- <p>
- Generally speaking there are the following problems for the
- workstation:
- <itemize>
- <item>It must find out it's own IP-address, and if needed also the
- rest of the Ethernet configuration.
- <item>
- It must know the <em/NFS/-server and the mount path to it's root
- filesystem.
- </itemize>
- <p>
- The current implementation of <em/NFSROOT/ in the Linux kernel (as of
- 1.3.7x) allows for
- the following ``solutions'':
- <itemize>
- <item>The IP-address may be discovered by <em/RARP/, or the full
- ethernet configuration may be passed to the kernel via kernel
- parameters by <bf/LILO/ or <bf/LOADLIN/.
- <item>The <em/NFS/-path to mount can be passed via kernel
- parameters. If this is not done, the kernel assumes the
- <em/RARP/-server also as <em/NFS/-server, and uses compiled in default
- for the path part. (current default value in the kernel:
- <tt>/tftpboot/<<em/IP-address of the machine/></tt>.)
- </itemize>
-
- Before starting to setup a discless enviroment, you should decide if
- you will be booting via <bf/LILO/ or <bf/LOADLIN/. The advantage of
- doing so is flexibility, the disadvantage is speed. Booting a Linux
- kernel without <bf/LILO/ is faster. This may or may not be a
- consideration.
-
- <sect>
- Setup on the server
- <sect1>Compiling the kernels
- <p>
- <em/RARP/ support in the kernel of the server will probably be a good
- idea. You must have it if you will boot without kernel parameters. On
- the other hand it doesn't help you, if the client isn't on the same
- subnet than the server.
- <p>
- The kernel for the workstation needs the following as a minimum set
- compiled in:
- <itemize>
- <item> <em/NFS/-filesystem compiled in. (It doesn't need to have
- <em/ext2/-support compiled in, a module suffices.)
- <item> ``Root on NFS'' must be enabled.
- <item> The Ethernet driver for the network card of the workstation
- must be compiled in.
- </itemize>
- <p>
- If the workstation will be booted without kernel parameters, you need
- also to set the root device to 0:255. Do this by creating a dummy
- device file with <tt>mknod /dev/nfsroot b 0 255</tt>. After having
- created such a device file, you can set root device of the kernel
- image with <tt>rdev <<em/kernel-image/> /dev/nfsroot</tt>.
- <sect1>
- Creation of the root filesystem
- <sect2>
- Copying the filesystem
- <p>
- After having decided where to place the root tree, create it with
- (e.g.) <tt>mkdir -p <<em/directory/></tt> and
- <tt>tar cClf / - | tar xpCf <<em/directory/> -</tt>.
- <p>
- If you boot your kernel without LILO, then the rootdir has to be
- <tt>/tftpboot/<<em/IP-address/></tt>. If you don't like it, you
- can change it in the top Makefile in the kernel sources, look for a line like:
- <tt>NFS_ROOT = -DNFS_ROOT="\"/tftpboot/%s\""</tt>
- If you change this, you have to recompile the kernel.
- <p>
- <sect2>
- Changes to the root filesystem
- <p>
- Now trim the unneeded files, and check the /etc/rc.d scripts. Some
- important points:
- <itemize>
-
- <item> One important thing is eth0 setup. The workstation comes up
- with a, at least partially, setup eth0. Setting up the
- IP-address of the workstation to the the IP-Address of the server
- is not considered a clever thing to do. (As it happened to the author
- on one of his early attempts.)
-
- <item>
- Another point is the /etc/fstab of the workstation. It should
- be setup for nfs filesystems.
-
- <item> <bf/WARNING/: Don't confuse the server root filesystem and the
- workstation root filesystem. (I've already patched up a
- rc.inet1 on the server, and wondered why the workstation still
- didn't work.)
- </itemize>
-
- <sect2>
- Exporting the filesystem
- <p>
- Export the root dir to the work station. See <tt/exports(5)/. You
- most likely will have to restart the nfsd/mountd after this change.
-
- <sect2>
- RARP setup
- <p>
- Setup the <em/RARP/ somewhere on the net. If you boot without a
- nfsroot parameter, the <em/RARP/ server has to be the <em/NFS/
- server. Usually this will be the <em/NFS/ server. To do this, you
- will need to run a kernel with <em/RARP/ support.
- <p>
- To do this, execute (and install it somewhere in <tt>/etc/rc.d</tt> of
- the server!):
- <p>
- <tt>/sbin/rarp -s <<em/ip-addr/> <<em/hardware-addr/></tt>
- <p> where
- <descrip>
- <tag/ip-addr/ is the IP address of the workstation, and
- <tag/hardware-addr/ is the Ethernet address of the network card of
- the workstation.
- </descrip>
- <p>
- example: <tt>/sbin/rarp -s 131.131.90.200 00:00:c0:47:10:12</tt>
- <p>
- You can also use a symbolic name instead of the IP-address, as
- long the server is able to find out the IP-address. (/etc/hosts
- or <em/DNS/ lookups)
-
- <sect2>
- Finding out hardware addresses
- <p>
- I don't know the hardware address! How can I find it out?
- <itemize>
- <item> Boot the kernel disk you made, and watch for the line where
- the network card is recognized. It usually contains 6 hex
- bytes, that should be the address of the card.
- <item> Boot the workstation with some OS with TCP/IP networking
- enabled. Then ping the workstation from the server. Look in
- the ARP-cache by executing:
- <tt>/sbin/arp -a</tt>
- </itemize>
-
- <sect>
- Booting the workstation
- <p>
- <sect1>
- Using a raw kernel disc
- <p>
- If you have exported the root filesystem with the correct name for the
- default naming and your <em/NFS/ server is also the <em/RARP/ server
- (which implies that the boxes are on the same subnet.), than you can
- just boot the kernel by <tt/cat/ing it to a disc. (You have to set the
- root device in the kernel to 0:255.)
- <sect1>
- Using a bootloader & <em/RARP/
- <p>
- Give the kernel all needed parameters when booting, and add
- <tt>nfsroot=<<em/server-ip-addr/>:<<em>/path/to/mount</em>></tt>
- where <em/server-ip-addr/ is the IP-address of your NFS-server, and
- <em>/path/to/mount</em> is the path to the root directory.
-
- Tips:
- <itemize>
- <item> When using <bf/LILO/ consider using the ``<tt/lock/'' feature: Simply
- type in once all the correct parameters and add
- ``<tt/lock/''. Next time when booting let LILO timeout.
- <item> When generating a workstation specific boot disk, you can
- also use the <tt/append=/ feature in <tt/lilo.conf/.
- </itemize>
- <sect1>
- Using a bootloader without <em/RARP/
- <p>
- In addition to <tt/nfsroot/ give a
- <tt>nfsaddrs=<<em/wst-IP/>:<<em/srv-IP/>:<<em/gw-IP/>:<<em/netm-IP/>:<<em/hostname/></tt>
- commandline argument for the kernel. The kernel will setup <tt/eth0/
- with the given parameters:
- <descrip>
- <tag/wst-IP/ machine's IP-Address
- <tag/srv-IP/ NFS-server IP-Address
- <tag/gw-IP/ gateway
- <tag/netm-IP/ netmask
- <tag/hostname/ machine name
- </descrip>
- <sect>
- Other topics
- <p>
- <itemize>
- <item> There is BOOTP client:
- <tt>ftp://sunsite.unc.edu/system/Network/admin/bootpc.v045.tgz</tt>
- <p>
- With the new bzImage+initrd patches (which to my knowledge made it
- into 1.3.73), it could be made to work for diskless stations quite
- nicely.
- </itemize>
- </article>
-