NFS-Root(1).pdf

(36 KB) Pobierz
NFS-Root mini-HOWTO
NFS−Root mini−HOWTO
NFS−Root mini−HOWTO
Table of Contents
NFS−Root mini−HOWTO .................................................................................................................................1
not maintained. .........................................................................................................................................1
1. Copyright. ............................................................................................................................................1
2. General Overview. ...............................................................................................................................1
3. Setup on the server. ..............................................................................................................................1
4. Booting the workstation. ......................................................................................................................1
5. Known problems. .................................................................................................................................1
6. Other resources. ...................................................................................................................................1
1. Copyright. ............................................................................................................................................1
1.1 Contributors. ......................................................................................................................................2
2. General Overview. ...............................................................................................................................2
3. Setup on the server. ..............................................................................................................................3
3.1 Compiling the kernels. .......................................................................................................................3
3.2 Creation of the root filesystem. ..........................................................................................................4
Copying the filesystem. .....................................................................................................................4
Changes to the root filesystem. .........................................................................................................4
Exporting the filesystem. ...................................................................................................................4
RARP setup. ......................................................................................................................................5
BOOTP setup. ...................................................................................................................................6
DHCP setup. ......................................................................................................................................6
Finding out hardware addresses. .......................................................................................................6
4. Booting the workstation. ......................................................................................................................6
4.1 Using a boot ROM. ............................................................................................................................6
4.2 Using a raw kernel disk.. ....................................................................................................................6
4.3 Using a bootloader & RARP. ............................................................................................................6
4.4 Using a bootloader without RARP. ...................................................................................................7
4.5 Sample kernel command lines. ..........................................................................................................7
5. Known problems. .................................................................................................................................7
5.1 /sbin/init doesn't start.. .......................................................................................................................7
5.2 /dev troubles. .....................................................................................................................................8
6. Other resources. ...................................................................................................................................8
i
193232858.001.png
NFS−Root mini−HOWTO
not maintained
V9, 20 September 2002
This mini−HOWTO tries explains how to set up a ``diskless'' Linux workstation, which mounts its root
filesystems via NFS. The newest version of this mini−HOWTO can always be found at
http://www.tldp.org/HOWTO/mini/NFS−Root.html or a Linux Documentation Project mirror NEAR YOU.
·
·
4.1 Using a boot ROM
·
·
(c) 1996 Andreas Kostyrka (e9207884@student.tuwien.ac.at or andreas@ag.or.at)
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.
NFS−Root mini−HOWTO
1
193232858.002.png
NFS−Root mini−HOWTO
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 < mailto:andreas@ag.or.at >, the author of
this mini−HOWTO, or the Linux HOWTO coordinator, at
< mailto:linux−howto@sunsite.unc.edu > via email.
1.1 Contributors
· Ofer Maor <ofer @ hadar.co.il> (a better mini−HOWTO about setting up diskless
workstations)
Avery Pennarun <apenwarr @ foxnet.net> (how to boot without LILO )
·
· Greg Roelofs <newt @ pobox.com> (2.2/2.4 updates, DHCP info, NFS−export info)
Christian Leutloff <leutloff @ sundancer.tng.oche.de> (info about netboot)
·
An NFS−mounted root filesystem is typically most useful in two situations:
·
A system administrator may wish to aggregate storage for multiple workstations in order to simplify
maintenance, improve security and reliability, and/or make more economical use of limited storage
capacity. In this scenario, a single, large server may host a dozen or more workstations; all of the
systems can be regularly backed up from a central location, and individual clients are less prone to
damage by unsophisticated users or attack by malicious parties with physical access. (Of course, if the
server itself is compromised, then so are all of the clients.)
·
An embedded system may not have a disk, an IDE interface, or even a PCI bus. Even if it does, during
development it may be too unstable to use the disk, and a ramdisk may be too small to include all of
the necessary utilities or too large (as a part of the kernel image) to allow for rapid turnaround during
testing and development. An NFS root allows quick kernel downloads, helps ensure filesystem
integrity (since the server is basically impervious to crashes by the client), and provides virtually
infinite storage.
(In this document we'll use the terms client and workstation interchangeably.)
However, there are two small problems from the client's perspective:
·
It must find out its own IP address and possibly also the rest of the ethernet configuration (gateway,
netmask, name servers, etc.).
·
It must know or discover both the IP address of the NFS server and the mount path (on the server) to
the exported root filesystem.
The current implementation of NFSROOT in the Linux kernel (as of 2.4.x) allows for several approaches,
including:
1.1 Contributors
2
193232858.003.png
NFS−Root mini−HOWTO
·
The complete ethernet configuration, including the NFS −path to be mounted, may be passed as
parameters to the kernel via LILO , LOADLIN , or a hard−coded string within
linux/arch/i386/kernel/setup.c (or its equivalent for other architectures).
· The IP address may be discovered by RARP , with the NFS −path derived from the RARP server and
the just−granted IP address (loosely speaking, `` mount −t nfs
< RARP−server >:/tftpboot/< IP−address−of−client >/dev/nfs '').
The IP address may be discovered by RARP and the NFS −path passed via kernel parameters.
·
· The client configuration may be discovered by DHCP .
The client configuration may be discovered by BOOTP .
·
Since the most common dynamic−address protocol these days is DHCP, its addition as an option in kernels
2.2.19 and 2.4.x (3 < x <= 14) is particularly welcome.
Before starting to set up a diskless environment, you should decide if you will be booting via LILO ,
LOADLIN , or a custom, embedded bootloader. The advantage of using something like LILO is flexibility;
the disadvantage is speed−−booting a Linux kernel without LILO is faster. This may or may not be a
consideration.
3.1 Compiling the kernels
On the server side, if you don't plan to use the old, user−mode NFS daemon, you'll need to compile NFS
server support into the kernel (``NFS server support,'' a.k.a. knfsd or CONFIG_NFSD ). If you plan to use the
older RARP protocol to assign the client an IP address, RARP support in the kernel of the server is probably a
good idea. (You must have it if you will boot via RARP without kernel parameters.) On the other hand, it
doesn't help you if the client isn't on the same subnet as the server.
The kernel for the workstation needs the following settings, as a minimum:
· Root file system on NFS ( CONFIG_ROOT_NFS ).
NFS filesystem support ( CONFIG_NFS_FS ). Note that there is no need for ext2 support.
· Ethernet (10 or 100Mbit) ( CONFIG_NET_ETHERNET ).
· The ethernet driver for the workstation's network card (or onboard ethernet chip, if it's built into the
motherboard or chipset).
·
Where there is an option to compile something in as a module, do not do so; modules only work after the
kernel is booted, and these things are needed during boot.
For dynamically assigned IP numbers, you'll also need to select one or more of these kernel options:
· RARP support ( CONFIG_IP_PNP_RARP )
IP: kernel level autoconfiguration ( CONFIG_IP_PNP )
· BOOTP support ( CONFIG_IP_PNP_BOOTP )
· DHCP support ( CONFIG_IP_PNP_DHCP )
·
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 mknod /dev/nfsroot b 0 255 . After having created such a
device file, you can set root device of the kernel image with rdev < kernel−image > /dev/nfsroot .
3. Setup on the server
3
193232858.004.png
Zgłoś jeśli naruszono regulamin