source: networking/netprogs/nfs-utils.xml@ 4bf60a36

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.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 4bf60a36 was 4bf60a36, checked in by Bruce Dubbs <bdubbs@…>, 7 years ago

Some tags

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

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