source: networking/netprogs/nfs-utils.xml@ 3e9d756

10.0 10.1 11.0 11.1 11.2 9.1 lazarus plabs/python-mods qt5new trunk upgradedb xry111/intltool xry111/soup3 xry111/test-20220226
Last change on this file since 3e9d756 was 3e9d756, checked in by Bruce Dubbs <bdubbs@…>, 3 years ago

Update to pcre-8.44
First lfs91 tags.

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

  • Property mode set to 100644
File size: 22.7 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-root "&kernel-dl;/linux/utils/nfs-utils" >
8 <!ENTITY nfs-utils-download-http "&nfs-utils-root;/&nfs-utils-version;/nfs-utils-&nfs-utils-version;.tar.xz">
9 <!ENTITY nfs-utils-download-ftp " ">
10 <!ENTITY nfs-utils-md5sum "06020c76f531ed97f3145514901e0e7c">
11 <!ENTITY nfs-utils-size "670 KB">
12 <!ENTITY nfs-utils-buildsize "20 MB">
13 <!ENTITY nfs-utils-time "0.2 SBU">
14]>
15
16<sect1 id="nfs-utils" xreflabel="nfs-utils-&nfs-utils-version;">
17 <?dbhtml filename="nfs-utils.html"?>
18
19 <sect1info>
20 <othername>$LastChangedBy$</othername>
21 <date>$Date$</date>
22 </sect1info>
23
24 <title>NFS-Utils-&nfs-utils-version;</title>
25
26 <indexterm zone="nfs-utils">
27 <primary sortas="a-Nfs-utils">NFS Utilities</primary>
28 </indexterm>
29
30 <sect2 role="package">
31 <title>Introduction to NFS Utilities</title>
32
33 <para>The <application>NFS Utilities</application> package contains the
34 userspace server and client tools necessary to use the kernel's NFS
35 abilities. NFS is a protocol that allows sharing file systems over the
36 network.</para>
37
38 &lfs91_checked;
39
40 <bridgehead renderas="sect3">Package Information</bridgehead>
41 <itemizedlist spacing='compact'>
42 <listitem>
43 <para>Download (HTTP): <ulink url="&nfs-utils-download-http;"/></para>
44 </listitem>
45 <listitem>
46 <para>Download (FTP): <ulink url="&nfs-utils-download-ftp;"/></para>
47 </listitem>
48 <listitem>
49 <para>Download MD5 sum: &nfs-utils-md5sum;</para>
50 </listitem>
51 <listitem>
52 <para>Download size: &nfs-utils-size;</para>
53 </listitem>
54 <listitem>
55 <para>Estimated disk space required: &nfs-utils-buildsize;</para>
56 </listitem>
57 <listitem>
58 <para>Estimated build time: &nfs-utils-time;</para>
59 </listitem>
60 </itemizedlist>
61
62 <bridgehead renderas="sect3">NFS Utilities Dependencies</bridgehead>
63
64 <bridgehead renderas="sect4">Required</bridgehead>
65 <para role="required">
66 <xref linkend="libtirpc"/>,
67 <xref linkend="rpcsvc-proto"/>
68 </para>
69
70 <bridgehead renderas="sect4">Optional</bridgehead>
71 <para role="optional">
72 <xref linkend="lvm2"/> (libdevmapper for NFSv4 support),
73 <xref linkend="libnfsidmap"/> (for NFSv4 support),
74 <xref linkend="libnsl"/> (for NIS client support),
75 <xref linkend="sqlite"/>,
76 <xref linkend="mitkrb"/> or
77 <ulink url="http://www.citi.umich.edu/projects/nfsv4/linux/">libgssapi</ulink>, and
78 <ulink url="http://www.citi.umich.edu/projects/nfsv4/linux/">librpcsecgss</ulink> (for GSS and RPC security support) and
79
80 <xref linkend="libcap-pam"/>
81 </para>
82
83 <bridgehead renderas="sect4">Required (runtime)</bridgehead>
84 <para role="required">
85 <xref role="runtime" linkend="rpcbind"/>
86 </para>
87
88<!-- NSS configuration isn't directly related to NFS, but left here in case
89 <bridgehead renderas="sect4">Optional (runtime for NIS clients)</bridgehead>
90 <para role="optional">
91 <ulink url="https://github.com/thkukuk/libnss_compat">libnss_compat</ulink>,
92 <ulink url="https://github.com/thkukuk/libnss_nis">libnss_nis</ulink>, and
93 <ulink url="https://github.com/thkukuk/libnss_nisplus">libnss_nisplus</ulink>
94 </para>
95-->
96
97 <para condition="html" role="usernotes">User Notes:
98 <ulink url="&blfs-wiki;/nfs-utils"/></para>
99
100 </sect2>
101
102 <sect2 role="kernel" id='nfs-utils-kernel'>
103 <title>Kernel Configuration</title>
104
105 <para>Enable the following options in the kernel configuration
106 (choose client and/or server support as appropriate) and recompile the
107 kernel if necessary:</para>
108
109<screen><literal>File systems ---&gt;
110 [*] Network File Systems ---&gt; [CONFIG_NETWORK_FILESYSTEMS]
111 &lt;*/M&gt; NFS client support [CONFIG_NFS_FS]
112 &lt;*/M&gt; NFS server support [CONFIG_NFSD]</literal></screen>
113
114 <para>Select the appropriate sub-options that appear when the above options
115 are selected.</para>
116
117 <note>
118 <para>
119 In BLFS we assume that nfs v3 will be used. If the
120 <emphasis>server</emphasis> offers nfs v4 (for linux, CONFIG_NFSD_V4)
121 then auto-negotiation for v3 will fail and you will need to add
122 <literal>nfsver=3</literal> to the mount options. This also applies
123 if that option is enabled in the <emphasis>client's</emphasis> kernel,
124 for example in a distro trying to mount from a BLFS v3 server.
125 </para>
126 <para>
127 Even if neither end of the connection supports nfs v4, adding
128 <literal>nfsver=3</literal> is still beneficial because it prevents an
129 error message "NFS: bad mount option value specified: minorversion=1"
130 being logged on every mount.
131 </para>
132 </note>
133
134 <indexterm zone="nfs-utils nfs-utils-kernel">
135 <primary sortas="d-nfs-utils">NFS Utilities</primary>
136 </indexterm>
137
138 </sect2>
139
140 <sect2 role="installation" id='nfs-utils-install'
141 xreflabel='NFS Utilities Installation'>
142 <title>Installation of NFS Utilities</title>
143
144 <para>Before you compile the program, ensure that the <systemitem
145 class="username">nobody</systemitem> user and <systemitem
146 class="groupname">nogroup</systemitem> group have been created as done in
147 the current LFS book. You can add them by running the following commands
148 as the <systemitem class="username">root</systemitem> user:</para>
149
150<screen role="nodump"><userinput>groupadd -g 99 nogroup &amp;&amp;
151useradd -c "Unprivileged Nobody" -d /dev/null -g nogroup \
152 -s /bin/false -u 99 nobody</userinput></screen>
153
154 <note>
155 <para>The classic uid and gid values are 65534 which is also -2 when
156 interpreted as a signed 16-bit number. These values impact other files
157 on some filesystems that do not have support for sparse files. The
158 <systemitem class="username">nobody</systemitem> and <systemitem
159 class="groupname">nogroup</systemitem> values are relatively arbitrary.
160 The impact on a server is nil if the <filename>exports</filename> file
161 is configured correctly. If it is misconfigured, an
162 <command>ls -l</command> or <command>ps</command> listing will show a
163 uid or gid number of 65534 instead of a name. The client uses <systemitem
164 class="username">nobody</systemitem> only as the user running
165 <command>rpc.statd</command>.</para>
166 </note>
167
168 <para>Install <application>NFS Utilities</application> by running
169 the following commands:</para>
170
171<screen><userinput>./configure --prefix=/usr \
172 --sysconfdir=/etc \
173 --sbindir=/sbin \
174 --disable-nfsv4 \
175 --disable-gss &amp;&amp;
176make</userinput></screen>
177
178 <!-- Test breakage: see
179 http://lists.linuxfromscratch.org/pipermail/blfs-book/2017-December/071861.html -->
180 <para>This package does not come with a working test suite.</para>
181
182 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
183
184<!-- dev note: make statduser=$(whoami) DESTDIR=<DESTDIR> install -->
185
186<screen role='root'><userinput>make install &amp;&amp;
187mv -v /sbin/start-statd /usr/sbin &amp;&amp;
188chmod u+w,go+r /sbin/mount.nfs &amp;&amp;
189chown nobody.nogroup /var/lib/nfs</userinput></screen>
190
191 <!-- commented, in case the tests get fixed
192 <para>The tests for this package require that the package be installed and
193 configured as specified below. In addition, the daemon from <xref
194 linkend="rpcbind"/> needs to be running and the tests need to be run as the
195 <systemitem class="username">root</systemitem> user.</para>
196
197 <para>To test the results, issue, as root: <command>make check</command>.</para>-->
198
199 </sect2>
200
201 <sect2 role="commands">
202 <title>Command Explanations</title>
203<!--
204 <para><command>sed ... support/nsm/rpc.c</command>: This sed it required
205 to fix a build issue with glibc-2.26 and later.</para>
206-->
207 <para><parameter>--disable-nfsv4</parameter>: This allows the package to be
208 built when libnfsidmap has not been installed.</para>
209
210 <para><parameter>--disable-gss</parameter>: Disables support for
211 RPCSEC GSS (RPC Security).</para>
212
213 <para><command>chown nobody.nogroup /var/lib/nfs</command>: The
214 rpc.statd program uses the ownership of this directory to set
215 it's UID and GID. This command sets those to unprivileged entries.
216 </para>
217
218 </sect2>
219
220 <sect2 role="configuration">
221 <title>Configuring NFS Utilities</title>
222
223 <sect3 id='nfs-utils-server-config'>
224 <title>Server Configuration</title>
225
226 <para><filename>/etc/exports</filename> contains the exported directories
227 on NFS servers. Refer to the <filename>exports.5</filename> manual page
228 for the syntax of this file. Also refer to the "NFS HowTo" available at
229 <ulink url="http://nfs.sourceforge.net/nfs-howto/"/> for information on
230 how to configure the servers and clients in a secure manner. For example,
231 for sharing the <filename class="directory">/home</filename> directory
232 over the local network, the following line may be added:</para>
233
234<screen role="nodump"><userinput>cat &gt;&gt; /etc/exports &lt;&lt; EOF
235<replaceable>/home 192.168.0.0/24</replaceable>(rw,subtree_check,anonuid=99,anongid=99)
236EOF</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="nodump"><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 nfsconf, nfsiostat, nfsstat, 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="nfsconf">
449 <term><command>nfsconf</command></term>
450 <listitem>
451 <para>can be used to test for and retrieve configuration settings from
452 a range of nfs-utils configuration files.</para>
453 <indexterm zone="nfs-utils nfsconf">
454 <primary sortas="b-nfsconf">nfsconf</primary>
455 </indexterm>
456 </listitem>
457 </varlistentry>
458
459 <varlistentry id="nfsiostat-nfs-utils">
460 <term><command>nfsiostat</command></term>
461 <listitem>
462 <para>reports input/output statistics for network filesystems.</para>
463 <indexterm zone="nfs-utils nfsiostat-nfs-utils">
464 <primary sortas="b-nfsiostat-nfs-utils">nfsiostat</primary>
465 </indexterm>
466 </listitem>
467 </varlistentry>
468
469 <varlistentry id="nfsstat">
470 <term><command>nfsstat</command></term>
471 <listitem>
472 <para>displays statistics kept about NFS client and server activity.</para>
473 <indexterm zone="nfs-utils nfsstat">
474 <primary sortas="b-nfsstat">nfsstat</primary>
475 </indexterm>
476 </listitem>
477 </varlistentry>
478
479<!-- osd_login seems to no longer exist.
480 <varlistentry id="osd_login">
481 <term><command>osd_login</command></term>
482 <listitem>
483 <para>is a script that is a part of the autologin feature
484 mandated by the pnfs-objects standard.</para>
485 <indexterm zone="nfs-utils osd_login">
486 <primary sortas="b-osd_login">osd_login</primary>
487 </indexterm>
488 </listitem>
489 </varlistentry> -->
490
491
492 <varlistentry id="rpc.mountd">
493 <term><command>rpc.mountd</command></term>
494 <listitem>
495 <para>implements the NFS mount protocol on an NFS server.</para>
496 <indexterm zone="nfs-utils rpc.mountd">
497 <primary sortas="b-rpc.mountd">rpc.mountd</primary>
498 </indexterm>
499 </listitem>
500 </varlistentry>
501
502 <varlistentry id="rpc.nfsd">
503 <term><command>rpc.nfsd</command></term>
504 <listitem>
505 <para>implements the user level part of the NFS
506 service on the server.</para>
507 <indexterm zone="nfs-utils rpc.nfsd">
508 <primary sortas="b-rpc.nfsd">rpc.nfsd</primary>
509 </indexterm>
510 </listitem>
511 </varlistentry>
512
513 <varlistentry id="rpc.statd">
514 <term><command>rpc.statd</command></term>
515 <listitem>
516 <para>is used by the NFS file locking service. Run on both sides,
517 client as well as server, when you want file locking enabled.</para>
518 <indexterm zone="nfs-utils rpc.statd">
519 <primary sortas="b-rpc.statd">rpc.statd</primary>
520 </indexterm>
521 </listitem>
522 </varlistentry>
523
524 <varlistentry id="rpcdebug">
525 <term><command>rpcdebug</command></term>
526 <listitem>
527 <para>sets or clears the kernel's NFS client and server debug
528 flags.</para>
529 <indexterm zone="nfs-utils rpcdebug">
530 <primary sortas="b-rpcdebug">rpcdebug</primary>
531 </indexterm>
532 </listitem>
533 </varlistentry>
534
535 <varlistentry id="showmount">
536 <term><command>showmount</command></term>
537 <listitem>
538 <para>displays mount information for an NFS server.</para>
539 <indexterm zone="nfs-utils showmount">
540 <primary sortas="b-showmount">showmount</primary>
541 </indexterm>
542 </listitem>
543 </varlistentry>
544
545 <varlistentry id="sm-notify">
546 <term><command>sm-notify</command></term>
547 <listitem>
548 <para>is used to send Network Status Monitor reboot messages.</para>
549 <indexterm zone="nfs-utils sm-notify">
550 <primary sortas="b-sm-notify">sm-notify</primary>
551 </indexterm>
552 </listitem>
553 </varlistentry>
554
555 <varlistentry id="start-statd">
556 <term><command>start-statd</command></term>
557 <listitem>
558 <para>is a script called by nfsmount when mounting a filesystem with
559 locking enabled, if statd does not appear to be running. It can be
560 customised with whatever flags are appropriate for the site.</para>
561 <indexterm zone="nfs-utils start-statd">
562 <primary sortas="b-start-statd">start-statd</primary>
563 </indexterm>
564 </listitem>
565 </varlistentry>
566
567 <varlistentry id="umount.nfs">
568 <term><command>umount.nfs</command></term>
569 <listitem>
570 <para>is used to unmount a network share using NFS</para>
571 <indexterm zone="nfs-utils umount.nfs">
572 <primary sortas="b-umount.nfs">umount.nfs</primary>
573 </indexterm>
574 </listitem>
575 </varlistentry>
576
577 <varlistentry id="umount.nfs4">
578 <term><command>umount.nfs4</command></term>
579 <listitem>
580 <para>is used to unmount a network share using NFSv4</para>
581 <indexterm zone="nfs-utils umount.nfs4">
582 <primary sortas="b-umount.nfs4">umount.nfs4</primary>
583 </indexterm>
584 </listitem>
585 </varlistentry>
586
587 </variablelist>
588
589 </sect2>
590
591</sect1>
Note: See TracBrowser for help on using the repository browser.