source: networking/netprogs/nfs-utils.xml@ 9291127

elogind
Last change on this file since 9291127 was 9291127, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

Merge to HEAD 21751.

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

  • Property mode set to 100644
File size: 22.3 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 "ce1921b8f15db54c3a6c840795312242">
10 <!ENTITY nfs-utils-size "659 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 &lfs84_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="nodump"><userinput>cat &gt;&gt; /etc/exports &lt;&lt; EOF
237<replaceable>/home 192.168.0.0/24</replaceable>(rw,subtree_check,anonuid=99,anongid=99)
238EOF</userinput></screen>
239
240 <note><para>Be sure to replace the directory, network address. and prefix above
241 to match your network. The only space in the line above should be between
242 the directory and the network address.</para></note>
243
244 <indexterm zone="nfs-utils nfs-utils-server-config">
245 <primary sortas="e-etc-exportfs">/etc/exportfs</primary>
246 </indexterm>
247
248 <sect4 id="nfs-utils-server-init">
249 <title><phrase revision="sysv">Boot Script</phrase>
250 <phrase revision="systemd">Systemd Units</phrase></title>
251
252 <para>Install the
253 <phrase revision="sysv"><filename>/etc/rc.d/init.d/nfs-server</filename>
254 init script</phrase>
255 <phrase revision="systemd">NFSv4 server units</phrase>
256 included in the <xref linkend="bootscripts" revision="sysv"/>
257 <xref linkend="systemd-units" revision="systemd"/> package
258 to start the server at boot.</para>
259
260<screen role="root" revision="systemd"><userinput>make install-nfsv4-server</userinput></screen>
261
262 <para revision="systemd">
263 If you have disabled NFSv4 support, run the following command as the
264 <systemitem class="username">root</systemitem> user to omit the NFSv4
265 specific systemd units:
266 </para>
267
268<!-- both -->
269<screen role="root"><userinput>make install-nfs-server</userinput></screen>
270
271 <indexterm zone="nfs-utils nfs-utils-server-init" revision="sysv">
272 <primary sortas="f-nfs-server">nfs-server</primary>
273 </indexterm>
274
275 <para revision="sysv">Now create the
276 <filename>/etc/sysconfig/nfs-server</filename> configuration file:
277 </para>
278
279<screen role="root" revision="sysv"><userinput>cat &gt; /etc/sysconfig/nfs-server &lt;&lt; "EOF"
280<literal>PORT="2049"
281PROCESSES="8"
282KILLDELAY="10"</literal>
283EOF</userinput></screen>
284
285 <note revision="sysv">
286 <para>The above parameters may be optionally placed in
287 <filename>/etc/sysconfig/rc.site</filename>.
288 </para>
289 </note>
290
291 <indexterm zone="nfs-utils nfs-utils-server-init" revision="sysv">
292 <primary
293 sortas="e-etc-sysconfig-nfs-server">/etc/sysconfig/nfs-server</primary>
294 </indexterm>
295
296 <para revision="systemd">
297 You can edit the <filename>/etc/default/nfs-utils</filename>
298 file to change the startup options for NFS daemons. Defaults
299 should be fine for most use cases.
300 </para>
301
302 <indexterm zone="nfs-utils nfs-utils-server-init" revision="systemd">
303 <primary sortas="e-etc-default-nfs-utils">/etc/default/nfs-utils</primary>
304 </indexterm>
305
306
307
308 </sect4>
309
310 </sect3>
311
312 <sect3 id='nfs-utils-client-config'>
313 <title>Client Configuration</title>
314
315 <para><filename>/etc/fstab</filename> contains the directories that
316 are to be mounted on the client. Alternately the partitions can be
317 mounted by using the <command>mount</command> command with the proper
318 options. To mount the <filename class="directory">/home</filename>
319 and <filename class="directory">/usr</filename> partitions, add the
320 following to the <filename>/etc/fstab</filename>:</para>
321
322<screen role="root"><userinput><replaceable>&lt;server-name&gt;</replaceable>:/home /home nfs rw,_netdev 0 0
323<replaceable>&lt;server-name&gt;</replaceable>:/usr /usr nfs ro,_netdev 0 0</userinput></screen>
324
325 <para>The options which can be used are specified in <command>man 5 nfs</command>.
326 If both the client and server are running recent versions of linux, most of the
327 options will be negotiated (but see the Note above on nfsver=3). You can specify
328 either <literal>rw</literal> or
329 <literal>ro</literal>, <literal>_netdev</literal> if the filesystem is to be
330 automatically mounted at boot, or <literal>noauto</literal> (and perhaps
331 <literal>user</literal>) for other filesystems.</para>
332
333 <para>If the fileserver is not running a recent version of linux, you may need to
334 specifiy other options.</para>
335
336 <para>If you are using systemd, you may need to enable autofs v4 in your kernel,
337 and add the option <literal>comment=systemd.automount</literal>. Some machines
338 need this, because systemd tries to mount the external fs&apos;s before the network
339 is up, others do not need it. An alternative is for <systemitem
340 class="username">root</systemitem> to run <command>mount -a</command>.</para>
341
342 <indexterm zone="nfs-utils nfs-utils-client-config">
343 <primary sortas="e-etc-fstab">/etc/fstab</primary>
344 </indexterm>
345
346 <sect4 id="nfs-utils-client-init">
347 <title><phrase revision="sysv">Boot Script</phrase>
348 <phrase revision="systemd">Systemd Units</phrase></title>
349
350 <note>
351 <para>
352 The following <phrase revision="sysv">boot script is</phrase>
353 <phrase revision="systemd">systemd units are</phrase> not required
354 if the nfs-server <phrase revision="sysv">script is</phrase>
355 <phrase revision="systemd">units are</phrase> installed.
356 </para>
357 </note>
358
359 <para>Install the
360 <phrase revision="sysv">
361 <filename>/etc/rc.d/init.d/nfs-client</filename> init script</phrase>
362 <phrase revision="systemd">units</phrase> included in the
363 <xref linkend="bootscripts" revision="sysv"/>
364 <xref linkend="systemd-units" revision="systemd"/> package to start
365 the client services at boot.</para>
366
367<screen role="root"><userinput>make install-nfs-client</userinput></screen>
368
369 <indexterm zone="nfs-utils nfs-utils-client-config">
370 <primary sortas="f-nfs-client">nfs-client</primary>
371 </indexterm>
372
373 <para revision="sysv">To automatically mount <systemitem
374 class="filesystem">nfs</systemitem> filesystems, clients will also need
375 to install the <filename>netfs</filename> bootscript as described in
376 <xref linkend="postlfs-config-netfs"/>.</para>
377
378 <indexterm zone="nfs-utils nfs-utils-client-config" revision="sysv">
379 <primary sortas="f-netfs">netfs</primary>
380 </indexterm>
381
382 </sect4>
383
384 </sect3>
385
386 </sect2>
387
388 <sect2 role="content">
389 <title>Contents</title>
390 <segmentedlist>
391 <segtitle>Installed Programs</segtitle>
392 <segtitle>Installed Libraries</segtitle>
393 <segtitle>Installed Directories</segtitle>
394
395 <seglistitem>
396 <seg>exportfs, mountstats, mount.nfs, mount.nfs4 (link to mount.nfs),
397 nfsiostat, nfsstat, osd_login, rpc.mountd, rpc.nfsd, rpc.statd, rpcdebug,
398 showmount, sm-notify, start-statd, umount.nfs (link to mount.nfs),
399 and umount.nfs4 (link to mount.nfs)</seg>
400 <seg>None</seg>
401 <seg>/var/lib/nfs</seg>
402 </seglistitem>
403 </segmentedlist>
404
405 <variablelist>
406 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
407 <?dbfo list-presentation="list"?>
408 <?dbhtml list-presentation="table"?>
409
410 <varlistentry id="exportfs">
411 <term><command>exportfs</command></term>
412 <listitem>
413 <para>maintains a list of NFS exported file systems.</para>
414 <indexterm zone="nfs-utils exportfs">
415 <primary sortas="b-exportfs">exportfs</primary>
416 </indexterm>
417 </listitem>
418 </varlistentry>
419
420 <varlistentry id="mountstats">
421 <term><command>mountstats</command></term>
422 <listitem>
423 <para>displays NFS client per-mount statistics.</para>
424 <indexterm zone="nfs-utils mountstats">
425 <primary sortas="b-mountstats">mountstats</primary>
426 </indexterm>
427 </listitem>
428 </varlistentry>
429
430 <varlistentry id="mount.nfs">
431 <term><command>mount.nfs</command></term>
432 <listitem>
433 <para>is used to mount a network share using NFS</para>
434 <indexterm zone="nfs-utils mount.nfs">
435 <primary sortas="b-mount.nfs">mount.nfs</primary>
436 </indexterm>
437 </listitem>
438 </varlistentry>
439
440 <varlistentry id="mount.nfs4">
441 <term><command>mount.nfs4</command></term>
442 <listitem>
443 <para>is used to mount a network share using NFSv4</para>
444 <indexterm zone="nfs-utils mount.nfs4">
445 <primary sortas="b-mount.nfs4">mount.nfs4</primary>
446 </indexterm>
447 </listitem>
448 </varlistentry>
449
450 <varlistentry id="nfsiostat-nfs-utils">
451 <term><command>nfsiostat</command></term>
452 <listitem>
453 <para>reports input/output statistics for network filesystems.</para>
454 <indexterm zone="nfs-utils nfsiostat-nfs-utils">
455 <primary sortas="b-nfsiostat-nfs-utils">nfsiostat</primary>
456 </indexterm>
457 </listitem>
458 </varlistentry>
459
460 <varlistentry id="nfsstat">
461 <term><command>nfsstat</command></term>
462 <listitem>
463 <para>displays statistics kept about NFS client and server activity.</para>
464 <indexterm zone="nfs-utils nfsstat">
465 <primary sortas="b-nfsstat">nfsstat</primary>
466 </indexterm>
467 </listitem>
468 </varlistentry>
469
470 <varlistentry id="osd_login">
471 <term><command>osd_login</command></term>
472 <listitem>
473 <para>is a script that is a part of the autologin feature
474 mandated by the pnfs-objects standard.</para>
475 <indexterm zone="nfs-utils osd_login">
476 <primary sortas="b-osd_login">osd_login</primary>
477 </indexterm>
478 </listitem>
479 </varlistentry>
480
481
482 <varlistentry id="rpc.mountd">
483 <term><command>rpc.mountd</command></term>
484 <listitem>
485 <para>implements the NFS mount protocol on an NFS server.</para>
486 <indexterm zone="nfs-utils rpc.mountd">
487 <primary sortas="b-rpc.mountd">rpc.mountd</primary>
488 </indexterm>
489 </listitem>
490 </varlistentry>
491
492 <varlistentry id="rpc.nfsd">
493 <term><command>rpc.nfsd</command></term>
494 <listitem>
495 <para>implements the user level part of the NFS
496 service on the server.</para>
497 <indexterm zone="nfs-utils rpc.nfsd">
498 <primary sortas="b-rpc.nfsd">rpc.nfsd</primary>
499 </indexterm>
500 </listitem>
501 </varlistentry>
502
503 <varlistentry id="rpc.statd">
504 <term><command>rpc.statd</command></term>
505 <listitem>
506 <para>is used by the NFS file locking service. Run on both sides,
507 client as well as server, when you want file locking enabled.</para>
508 <indexterm zone="nfs-utils rpc.statd">
509 <primary sortas="b-rpc.statd">rpc.statd</primary>
510 </indexterm>
511 </listitem>
512 </varlistentry>
513
514 <varlistentry id="rpcdebug">
515 <term><command>rpcdebug</command></term>
516 <listitem>
517 <para>sets or clears the kernel's NFS client and server debug
518 flags.</para>
519 <indexterm zone="nfs-utils rpcdebug">
520 <primary sortas="b-rpcdebug">rpcdebug</primary>
521 </indexterm>
522 </listitem>
523 </varlistentry>
524
525 <varlistentry id="showmount">
526 <term><command>showmount</command></term>
527 <listitem>
528 <para>displays mount information for an NFS server.</para>
529 <indexterm zone="nfs-utils showmount">
530 <primary sortas="b-showmount">showmount</primary>
531 </indexterm>
532 </listitem>
533 </varlistentry>
534
535 <varlistentry id="sm-notify">
536 <term><command>sm-notify</command></term>
537 <listitem>
538 <para>is used to send Network Status Monitor reboot messages.</para>
539 <indexterm zone="nfs-utils sm-notify">
540 <primary sortas="b-sm-notify">sm-notify</primary>
541 </indexterm>
542 </listitem>
543 </varlistentry>
544
545 <varlistentry id="start-statd">
546 <term><command>start-statd</command></term>
547 <listitem>
548 <para>is a script called by nfsmount when mounting a filesystem with
549 locking enabled, if statd does not appear to be running. It can be
550 customised with whatever flags are appropriate for the site.</para>
551 <indexterm zone="nfs-utils start-statd">
552 <primary sortas="b-start-statd">start-statd</primary>
553 </indexterm>
554 </listitem>
555 </varlistentry>
556
557 <varlistentry id="umount.nfs">
558 <term><command>umount.nfs</command></term>
559 <listitem>
560 <para>is used to unmount a network share using NFS</para>
561 <indexterm zone="nfs-utils umount.nfs">
562 <primary sortas="b-umount.nfs">umount.nfs</primary>
563 </indexterm>
564 </listitem>
565 </varlistentry>
566
567 <varlistentry id="umount.nfs4">
568 <term><command>umount.nfs4</command></term>
569 <listitem>
570 <para>is used to unmount a network share using NFSv4</para>
571 <indexterm zone="nfs-utils umount.nfs4">
572 <primary sortas="b-umount.nfs4">umount.nfs4</primary>
573 </indexterm>
574 </listitem>
575 </varlistentry>
576
577 </variablelist>
578
579 </sect2>
580
581</sect1>
Note: See TracBrowser for help on using the repository browser.