source: networking/netprogs/nfs-utils.xml@ 2d6354a7

perl-modules
Last change on this file since 2d6354a7 was cdd5a33b, checked in by Bruce Dubbs <bdubbs@…>, 6 years ago

Initial lfs83 tags

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@20299 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 22.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY nfs-utils-download-http "&sourceforge-dl;/nfs/nfs-utils-&nfs-utils-version;.tar.xz">
8 <!ENTITY nfs-utils-download-ftp " ">
9 <!ENTITY nfs-utils-md5sum "5f952810747674ef4737e4956c297808">
10 <!ENTITY nfs-utils-size "644 KB">
11 <!ENTITY nfs-utils-buildsize "18 MB">
12 <!ENTITY nfs-utils-time "0.2 SBU">
13]>
14
15<sect1 id="nfs-utils" xreflabel="nfs-utils-&nfs-utils-version;">
16 <?dbhtml filename="nfs-utils.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>NFS-Utils-&nfs-utils-version;</title>
24
25 <indexterm zone="nfs-utils">
26 <primary sortas="a-Nfs-utils">NFS Utilities</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to NFS Utilities</title>
31
32 <para>The <application>NFS Utilities</application> package contains the
33 userspace server and client tools necessary to use the kernel's NFS
34 abilities. NFS is a protocol that allows sharing file systems over the
35 network.</para>
36
37 &lfs83_checked;
38
39 <bridgehead renderas="sect3">Package Information</bridgehead>
40 <itemizedlist spacing='compact'>
41 <listitem>
42 <para>Download (HTTP): <ulink url="&nfs-utils-download-http;"/></para>
43 </listitem>
44 <listitem>
45 <para>Download (FTP): <ulink url="&nfs-utils-download-ftp;"/></para>
46 </listitem>
47 <listitem>
48 <para>Download MD5 sum: &nfs-utils-md5sum;</para>
49 </listitem>
50 <listitem>
51 <para>Download size: &nfs-utils-size;</para>
52 </listitem>
53 <listitem>
54 <para>Estimated disk space required: &nfs-utils-buildsize;</para>
55 </listitem>
56 <listitem>
57 <para>Estimated build time: &nfs-utils-time;</para>
58 </listitem>
59 </itemizedlist>
60
61 <bridgehead renderas="sect3">NFS Utilities Dependencies</bridgehead>
62
63 <bridgehead renderas="sect4">Required</bridgehead>
64 <para role="required">
65 <xref linkend="libtirpc"/>
66 </para>
67
68 <bridgehead renderas="sect4">Optional</bridgehead>
69 <para role="optional">
70 <xref linkend="lvm2"/> (libdevmapper for NFSv4 support),
71 <phrase revision="systemd"><xref linkend="libnfsidmap"/></phrase>
72 <phrase revision="sysv"><ulink
73 url="http://www.citi.umich.edu/projects/nfsv4/linux/">libnfsidmap</ulink></phrase>
74 (for NFSv4 support),
75 <xref linkend="libnsl"/> (for NIS client support),
76 <xref linkend="sqlite"/>,
77 <xref linkend="mitkrb"/> or
78 <ulink url="http://www.citi.umich.edu/projects/nfsv4/linux/">libgssapi</ulink>, and
79 <ulink url="http://www.citi.umich.edu/projects/nfsv4/linux/">librpcsecgss</ulink> (for GSS and RPC security support) and
80
81 <xref linkend="libcap-pam"/>
82 </para>
83
84 <bridgehead renderas="sect4">Required (runtime)</bridgehead>
85 <para role="required">
86 <xref role="runtime" linkend="rpcbind"/>
87 </para>
88
89<!-- NSS configuration isn't directly related to NFS, but left here in case
90 <bridgehead renderas="sect4">Optional (runtime for NIS clients)</bridgehead>
91 <para role="optional">
92 <ulink url="https://github.com/thkukuk/libnss_compat">libnss_compat</ulink>,
93 <ulink url="https://github.com/thkukuk/libnss_nis">libnss_nis</ulink>, and
94 <ulink url="https://github.com/thkukuk/libnss_nisplus">libnss_nisplus</ulink>
95 </para>
96-->
97
98 <para condition="html" role="usernotes">User Notes:
99 <ulink url="&blfs-wiki;/nfs-utils"/></para>
100
101 </sect2>
102
103 <sect2 role="kernel" id='nfs-utils-kernel'>
104 <title>Kernel Configuration</title>
105
106 <para>Enable the following options in the kernel configuration
107 (choose client and/or server support as appropriate) and recompile the
108 kernel if necessary:</para>
109
110<screen><literal>File systems ---&gt;
111 [*] Network File Systems ---&gt; [CONFIG_NETWORK_FILESYSTEMS]
112 &lt;*/M&gt; NFS client support [CONFIG_NFS_FS]
113 &lt;*/M&gt; NFS server support [CONFIG_NFSD]</literal></screen>
114
115 <para>Select the appropriate sub-options that appear when the above options
116 are selected.</para>
117
118 <note>
119 <para>
120 In BLFS we assume that nfs v3 will be used. If the
121 <emphasis>server</emphasis> offers nfs v4 (for linux, CONFIG_NFSD_V4)
122 then auto-negotiation for v3 will fail and you will need to add
123 <literal>nfsver=3</literal> to the mount options. This also applies
124 if that option is enabled in the <emphasis>client's</emphasis> kernel,
125 for example in a distro trying to mount from a BLFS v3 server.
126 </para>
127 <para>
128 Even if neither end of the connection supports nfs v4, adding
129 <literal>nfsver=3</literal> is still beneficial because it prevents an
130 error message "NFS: bad mount option value specified: minorversion=1"
131 being logged on every mount.
132 </para>
133 </note>
134
135 <indexterm zone="nfs-utils nfs-utils-kernel">
136 <primary sortas="d-nfs-utils">NFS Utilities</primary>
137 </indexterm>
138
139 </sect2>
140
141 <sect2 role="installation" id='nfs-utils-install'
142 xreflabel='NFS Utilities Installation'>
143 <title>Installation of NFS Utilities</title>
144
145 <para>Before you compile the program, ensure that the <systemitem
146 class="username">nobody</systemitem> user and <systemitem
147 class="groupname">nogroup</systemitem> group have been created as done in
148 the current LFS book. You can add them by running the following commands
149 as the <systemitem class="username">root</systemitem> user:</para>
150
151<screen role="nodump"><userinput>groupadd -g 99 nogroup &amp;&amp;
152useradd -c "Unprivileged Nobody" -d /dev/null -g nogroup \
153 -s /bin/false -u 99 nobody</userinput></screen>
154
155 <note>
156 <para>The classic uid and gid values are 65534 which is also -2 when
157 interpreted as a signed 16-bit number. These values impact other files
158 on some filesystems that do not have support for sparse files. The
159 <systemitem class="username">nobody</systemitem> and <systemitem
160 class="groupname">nogroup</systemitem> values are relatively arbitrary.
161 The impact on a server is nil if the <filename>exports</filename> file
162 is configured correctly. If it is misconfigured, an
163 <command>ls -l</command> or <command>ps</command> listing will show a
164 uid or gid number of 65534 instead of a name. The client uses <systemitem
165 class="username">nobody</systemitem> only as the user running
166 <command>rpc.statd</command>.</para>
167 </note>
168
169 <para>First, fix a build problem caused by gcc-8:</para>
170
171<screen><userinput>sed -i '/strict-prototypes/d' configure.ac &amp;&amp;
172autoreconf -fiv</userinput></screen>
173
174 <para>Install <application>NFS Utilities</application> by running
175 the following commands:</para>
176
177<!--
178<screen><userinput>sed -i '/fcntl.h/a#include &lt;stdint.h&gt;' support/nsm/rpc.c &amp;&amp;-->
179<screen><userinput>./configure --prefix=/usr \
180 --sysconfdir=/etc \
181 --sbindir=/sbin \
182 --without-tcp-wrappers \
183 --disable-nfsv4 \
184 --disable-gss &amp;&amp;
185make</userinput></screen>
186
187 <!-- Test breakage: see
188 http://lists.linuxfromscratch.org/pipermail/blfs-book/2017-December/071861.html -->
189 <para>This package does not come with a working test suite."</para>
190
191 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
192
193<!-- dev note: make statduser=$(whoami) DESTDIR=<DESTDIR> install -->
194
195<screen role='root'><userinput>make install &amp;&amp;
196mv -v /sbin/start-statd /usr/sbin &amp;&amp;
197chmod u+w,go+r /sbin/mount.nfs &amp;&amp;
198chown nobody.nogroup /var/lib/nfs</userinput></screen>
199
200 <!-- commented, in case the tests get fixed
201 <para>The tests for this package require that the package be installed and
202 configured as specified below. In addition, the the daemon from <xref
203 linkend="rpcbind"/> needs to be running and the tests need to be run as the
204 <systemitem class="username">root</systemitem> user.</para>
205
206 <para>To test the results, issue, as root: <command>make check</command>.</para>-->
207
208 </sect2>
209
210 <sect2 role="commands">
211 <title>Command Explanations</title>
212<!--
213 <para><command>sed ... support/nsm/rpc.c</command>: This sed it required
214 to fix a build issue with glibc-2.26 and later.</para>
215-->
216 <para><parameter>--without-tcp-wrappers</parameter>: This option is
217 needed because TCP Wrappers is not in BLFS.</para>
218
219 <para><parameter>--disable-nfsv4</parameter>: This allows the package to be
220 built when libnfsidmap has not been installed.</para>
221
222 <para><parameter>--disable-gss</parameter>: Disables support for
223 RPCSEC GSS (RPC Security).</para>
224
225 <para><command>chown nobody.nogroup /var/lib/nfs</command>: The
226 rpc.statd program uses the ownership of this directory to set
227 it's UID and GID. This command sets those to unprivileged entries.
228 </para>
229
230 </sect2>
231
232 <sect2 role="configuration">
233 <title>Configuring NFS Utilities</title>
234
235 <sect3 id='nfs-utils-server-config'>
236 <title>Server Configuration</title>
237
238 <para><filename>/etc/exports</filename> contains the exported directories
239 on NFS servers. Refer to the <filename>exports.5</filename> manual page
240 for the syntax of this file. Also refer to the "NFS HowTo" available at
241 <ulink url="http://nfs.sourceforge.net/nfs-howto/"/> for information on
242 how to configure the servers and clients in a secure manner. For example,
243 for sharing the <filename class="directory">/home</filename> directory
244 over the local network, the following line may be added:</para>
245
246<screen role="root"><userinput>/home <replaceable>192.168.0.0/24</replaceable>(rw,subtree_check,anonuid=99,anongid=99)</userinput></screen>
247
248 <note><para>Be sure to replace the directory, network address. and prefix above
249 to match your network. The only space in the line above should be between
250 the directory and the network address.</para></note>
251
252 <indexterm zone="nfs-utils nfs-utils-server-config">
253 <primary sortas="e-etc-exportfs">/etc/exportfs</primary>
254 </indexterm>
255
256 <sect4 id="nfs-utils-server-init">
257 <title><phrase revision="sysv">Boot Script</phrase>
258 <phrase revision="systemd">Systemd Units</phrase></title>
259
260 <para>Install the
261 <phrase revision="sysv"><filename>/etc/rc.d/init.d/nfs-server</filename>
262 init script</phrase>
263 <phrase revision="systemd">NFSv4 server units</phrase>
264 included in the <xref linkend="bootscripts" revision="sysv"/>
265 <xref linkend="systemd-units" revision="systemd"/> package
266 to start the server at boot.</para>
267
268<screen role="root" revision="systemd"><userinput>make install-nfsv4-server</userinput></screen>
269
270 <para revision="systemd">
271 If you have disabled NFSv4 support, run the following command as the
272 <systemitem class="username">root</systemitem> user to omit the NFSv4
273 specific systemd units:
274 </para>
275
276<!-- both -->
277<screen role="root"><userinput>make install-nfs-server</userinput></screen>
278
279 <indexterm zone="nfs-utils nfs-utils-server-init" revision="sysv">
280 <primary sortas="f-nfs-server">nfs-server</primary>
281 </indexterm>
282
283 <para revision="sysv">Now create the
284 <filename>/etc/sysconfig/nfs-server</filename> configuration file:
285 </para>
286
287<screen role="root" revision="sysv"><userinput>cat &gt; /etc/sysconfig/nfs-server &lt;&lt; "EOF"
288<literal>PORT="2049"
289PROCESSES="8"
290KILLDELAY="10"</literal>
291EOF</userinput></screen>
292
293 <note revision="sysv">
294 <para>The above parameters may be optionally placed in
295 <filename>/etc/sysconfig/rc.site</filename>.
296 </para>
297 </note>
298
299 <indexterm zone="nfs-utils nfs-utils-server-init" revision="sysv">
300 <primary
301 sortas="e-etc-sysconfig-nfs-server">/etc/sysconfig/nfs-server</primary>
302 </indexterm>
303
304 <para revision="systemd">
305 You can edit the <filename>/etc/default/nfs-utils</filename>
306 file to change the startup options for NFS daemons. Defaults
307 should be fine for most use cases.
308 </para>
309
310 <indexterm zone="nfs-utils nfs-utils-server-init" revision="systemd">
311 <primary sortas="e-etc-default-nfs-utils">/etc/default/nfs-utils</primary>
312 </indexterm>
313
314
315
316 </sect4>
317
318 </sect3>
319
320 <sect3 id='nfs-utils-client-config'>
321 <title>Client Configuration</title>
322
323 <para><filename>/etc/fstab</filename> contains the directories that
324 are to be mounted on the client. Alternately the partitions can be
325 mounted by using the <command>mount</command> command with the proper
326 options. To mount the <filename class="directory">/home</filename>
327 and <filename class="directory">/usr</filename> partitions, add the
328 following to the <filename>/etc/fstab</filename>:</para>
329
330<screen role="root"><userinput><replaceable>&lt;server-name&gt;</replaceable>:/home /home nfs rw,_netdev 0 0
331<replaceable>&lt;server-name&gt;</replaceable>:/usr /usr nfs ro,_netdev 0 0</userinput></screen>
332
333 <para>The options which can be used are specified in <command>man 5 nfs</command>.
334 If both the client and server are running recent versions of linux, most of the
335 options will be negotiated (but see the Note above on nfsver=3). You can specify
336 either <literal>rw</literal> or
337 <literal>ro</literal>, <literal>_netdev</literal> if the filesystem is to be
338 automatically mounted at boot, or <literal>noauto</literal> (and perhaps
339 <literal>user</literal>) for other filesystems.</para>
340
341 <para>If the fileserver is not running a recent version of linux, you may need to
342 specifiy other options.</para>
343
344 <para>If you are using systemd, you may need to enable autofs v4 in your kernel,
345 and add the option <literal>comment=systemd.automount</literal>. Some machines
346 need this, because systemd tries to mount the external fs&apos;s before the network
347 is up, others do not need it. An alternative is for <systemitem
348 class="username">root</systemitem> to run <command>mount -a</command>.</para>
349
350 <indexterm zone="nfs-utils nfs-utils-client-config">
351 <primary sortas="e-etc-fstab">/etc/fstab</primary>
352 </indexterm>
353
354 <sect4 id="nfs-utils-client-init">
355 <title><phrase revision="sysv">Boot Script</phrase>
356 <phrase revision="systemd">Systemd Units</phrase></title>
357
358 <note>
359 <para>
360 The following <phrase revision="sysv">boot script is</phrase>
361 <phrase revision="systemd">systemd units are</phrase> not required
362 if the nfs-server <phrase revision="sysv">script is</phrase>
363 <phrase revision="systemd">units are</phrase> installed.
364 </para>
365 </note>
366
367 <para>Install the
368 <phrase revision="sysv">
369 <filename>/etc/rc.d/init.d/nfs-client</filename> init script</phrase>
370 <phrase revision="systemd">units</phrase> included in the
371 <xref linkend="bootscripts" revision="sysv"/>
372 <xref linkend="systemd-units" revision="systemd"/> package to start
373 the client services at boot.</para>
374
375<screen role="root"><userinput>make install-nfs-client</userinput></screen>
376
377 <indexterm zone="nfs-utils nfs-utils-client-config">
378 <primary sortas="f-nfs-client">nfs-client</primary>
379 </indexterm>
380
381 <para revision="sysv">To automatically mount <systemitem
382 class="filesystem">nfs</systemitem> filesystems, clients will also need
383 to install the <filename>netfs</filename> bootscript as described in
384 <xref linkend="postlfs-config-netfs"/>.</para>
385
386 <indexterm zone="nfs-utils nfs-utils-client-config" revision="sysv">
387 <primary sortas="f-netfs">netfs</primary>
388 </indexterm>
389
390 </sect4>
391
392 </sect3>
393
394 </sect2>
395
396 <sect2 role="content">
397 <title>Contents</title>
398 <segmentedlist>
399 <segtitle>Installed Programs</segtitle>
400 <segtitle>Installed Libraries</segtitle>
401 <segtitle>Installed Directories</segtitle>
402
403 <seglistitem>
404 <seg>exportfs, mountstats, mount.nfs, mount.nfs4 (link to mount.nfs),
405 nfsiostat, nfsstat, osd_login, rpc.mountd, rpc.nfsd, rpc.statd, rpcdebug,
406 showmount, sm-notify, start-statd, umount.nfs (link to mount.nfs),
407 and umount.nfs4 (link to mount.nfs)</seg>
408 <seg>None</seg>
409 <seg>/var/lib/nfs</seg>
410 </seglistitem>
411 </segmentedlist>
412
413 <variablelist>
414 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
415 <?dbfo list-presentation="list"?>
416 <?dbhtml list-presentation="table"?>
417
418 <varlistentry id="exportfs">
419 <term><command>exportfs</command></term>
420 <listitem>
421 <para>maintains a list of NFS exported file systems.</para>
422 <indexterm zone="nfs-utils exportfs">
423 <primary sortas="b-exportfs">exportfs</primary>
424 </indexterm>
425 </listitem>
426 </varlistentry>
427
428 <varlistentry id="mountstats">
429 <term><command>mountstats</command></term>
430 <listitem>
431 <para>displays NFS client per-mount statistics.</para>
432 <indexterm zone="nfs-utils mountstats">
433 <primary sortas="b-mountstats">mountstats</primary>
434 </indexterm>
435 </listitem>
436 </varlistentry>
437
438 <varlistentry id="mount.nfs">
439 <term><command>mount.nfs</command></term>
440 <listitem>
441 <para>is used to mount a network share using NFS</para>
442 <indexterm zone="nfs-utils mount.nfs">
443 <primary sortas="b-mount.nfs">mount.nfs</primary>
444 </indexterm>
445 </listitem>
446 </varlistentry>
447
448 <varlistentry id="mount.nfs4">
449 <term><command>mount.nfs4</command></term>
450 <listitem>
451 <para>is used to mount a network share using NFSv4</para>
452 <indexterm zone="nfs-utils mount.nfs4">
453 <primary sortas="b-mount.nfs4">mount.nfs4</primary>
454 </indexterm>
455 </listitem>
456 </varlistentry>
457
458 <varlistentry id="nfsiostat-nfs-utils">
459 <term><command>nfsiostat</command></term>
460 <listitem>
461 <para>reports input/output statistics for network filesystems.</para>
462 <indexterm zone="nfs-utils nfsiostat-nfs-utils">
463 <primary sortas="b-nfsiostat-nfs-utils">nfsiostat</primary>
464 </indexterm>
465 </listitem>
466 </varlistentry>
467
468 <varlistentry id="nfsstat">
469 <term><command>nfsstat</command></term>
470 <listitem>
471 <para>displays statistics kept about NFS client and server activity.</para>
472 <indexterm zone="nfs-utils nfsstat">
473 <primary sortas="b-nfsstat">nfsstat</primary>
474 </indexterm>
475 </listitem>
476 </varlistentry>
477
478 <varlistentry id="osd_login">
479 <term><command>osd_login</command></term>
480 <listitem>
481 <para>is a script that is a part of the autologin feature
482 mandated by the pnfs-objects standard.</para>
483 <indexterm zone="nfs-utils osd_login">
484 <primary sortas="b-osd_login">osd_login</primary>
485 </indexterm>
486 </listitem>
487 </varlistentry>
488
489
490 <varlistentry id="rpc.mountd">
491 <term><command>rpc.mountd</command></term>
492 <listitem>
493 <para>implements the NFS mount protocol on an NFS server.</para>
494 <indexterm zone="nfs-utils rpc.mountd">
495 <primary sortas="b-rpc.mountd">rpc.mountd</primary>
496 </indexterm>
497 </listitem>
498 </varlistentry>
499
500 <varlistentry id="rpc.nfsd">
501 <term><command>rpc.nfsd</command></term>
502 <listitem>
503 <para>implements the user level part of the NFS
504 service on the server.</para>
505 <indexterm zone="nfs-utils rpc.nfsd">
506 <primary sortas="b-rpc.nfsd">rpc.nfsd</primary>
507 </indexterm>
508 </listitem>
509 </varlistentry>
510
511 <varlistentry id="rpc.statd">
512 <term><command>rpc.statd</command></term>
513 <listitem>
514 <para>is used by the NFS file locking service. Run on both sides,
515 client as well as server, when you want file locking enabled.</para>
516 <indexterm zone="nfs-utils rpc.statd">
517 <primary sortas="b-rpc.statd">rpc.statd</primary>
518 </indexterm>
519 </listitem>
520 </varlistentry>
521
522 <varlistentry id="rpcdebug">
523 <term><command>rpcdebug</command></term>
524 <listitem>
525 <para>sets or clears the kernel's NFS client and server debug
526 flags.</para>
527 <indexterm zone="nfs-utils rpcdebug">
528 <primary sortas="b-rpcdebug">rpcdebug</primary>
529 </indexterm>
530 </listitem>
531 </varlistentry>
532
533 <varlistentry id="showmount">
534 <term><command>showmount</command></term>
535 <listitem>
536 <para>displays mount information for an NFS server.</para>
537 <indexterm zone="nfs-utils showmount">
538 <primary sortas="b-showmount">showmount</primary>
539 </indexterm>
540 </listitem>
541 </varlistentry>
542
543 <varlistentry id="sm-notify">
544 <term><command>sm-notify</command></term>
545 <listitem>
546 <para>is used to send Network Status Monitor reboot messages.</para>
547 <indexterm zone="nfs-utils sm-notify">
548 <primary sortas="b-sm-notify">sm-notify</primary>
549 </indexterm>
550 </listitem>
551 </varlistentry>
552
553 <varlistentry id="start-statd">
554 <term><command>start-statd</command></term>
555 <listitem>
556 <para>is a script called by nfsmount when mounting a filesystem with
557 locking enabled, if statd does not appear to be running. It can be
558 customised with whatever flags are appropriate for the site.</para>
559 <indexterm zone="nfs-utils start-statd">
560 <primary sortas="b-start-statd">start-statd</primary>
561 </indexterm>
562 </listitem>
563 </varlistentry>
564
565 <varlistentry id="umount.nfs">
566 <term><command>umount.nfs</command></term>
567 <listitem>
568 <para>is used to unmount a network share using NFS</para>
569 <indexterm zone="nfs-utils umount.nfs">
570 <primary sortas="b-umount.nfs">umount.nfs</primary>
571 </indexterm>
572 </listitem>
573 </varlistentry>
574
575 <varlistentry id="umount.nfs4">
576 <term><command>umount.nfs4</command></term>
577 <listitem>
578 <para>is used to unmount a network share using NFSv4</para>
579 <indexterm zone="nfs-utils umount.nfs4">
580 <primary sortas="b-umount.nfs4">umount.nfs4</primary>
581 </indexterm>
582 </listitem>
583 </varlistentry>
584
585 </variablelist>
586
587 </sect2>
588
589</sect1>
Note: See TracBrowser for help on using the repository browser.