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

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 a15d5e1 was a15d5e1, checked in by DJ Lucas <dj@…>, 7 years ago

Add rpcsvc-proto-1.2 and libnsl-1.1.0. Add dependencies to Postfix and NFS-Utils. Fixes #9285.

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

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