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

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since e319d3b was c08f499, checked in by Ken Moffat <ken@…>, 6 years ago

nfs-utils: remove second optional libnfsidmap dependency from the sysv book.

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

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