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

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 ad6f90ab was ad6f90ab, checked in by Douglas R. Reno <renodr@…>, 7 years ago

Update nfs-utils to use /sbin instead of /usr/sbin
This corrects an oversight discovered by Bruce in the systemd units
And allows things to be kept consistent between books.
Approved by DJ and bdubbs in IRC.

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

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