source: networking/netprogs/nfs-utils.xml@ 8c83efc

10.0 10.1 11.0 11.1 11.2 8.4 9.0 9.1 bdubbs/svn elogind lazarus plabs/python-mods qt5new trunk upgradedb xry111/intltool xry111/soup3 xry111/test-20220226
Last change on this file since 8c83efc was 8c83efc, checked in by Ken Moffat <ken@…>, 4 years ago

NFS-Utils now requires rpcsvc-proto.

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

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