source: networking/netprogs/nfs-utils.xml@ 74c70faa

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 74c70faa was a1b111f8, checked in by Bruce Dubbs <bdubbs@…>, 7 years ago

Clarification about creating xorg.sh.
Ensure /var/lib/nfs ownership is correct.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@18753 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 --without-tcp-wrappers \
160 --disable-nfsv4 \
161 --disable-gss &amp;&amp;
162make</userinput></screen>
163
164 <para>If your <filename class="directory">/usr</filename> directory
165 is NFS mounted, you should install the executables in
166 <filename class="directory">/sbin</filename> by passing
167 an additional parameter <option>--sbindir=/sbin</option> to the
168 above <command>./configure</command> command.</para>
169
170 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
171
172<!-- dev note: make statduser=$(whoami) DESTDIR=<DESTDIR> install -->
173
174<screen role='root'><userinput>make install &amp;&amp;
175chmod u+w,go+r /sbin/mount.nfs &amp;&amp;
176chown nobody.nogroup /var/lib/nfs</userinput></screen>
177
178 <para>The tests for this package require that the package be installed and
179 configured as specified below. In addition, the the daemon from <xref
180 linkend="rpcbind"/> needs to be running and the tests need to be run as the
181 <systemitem class="username">root</systemitem> user.</para>
182
183 <para>To test the results, issue, as root: <command>make check</command>.</para>
184
185 </sect2>
186
187 <sect2 role="commands">
188 <title>Command Explanations</title>
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"
264QUOTAS="no"
265KILLDELAY="10"</literal>
266EOF</userinput></screen>
267
268 <note revision="sysv">
269 <para>The above parameters may be optionally placed in
270 <filename>/etc/sysconfig/rc.site</filename>.
271 </para>
272 </note>
273
274 <indexterm zone="nfs-utils nfs-utils-server-init" revision="sysv">
275 <primary
276 sortas="e-etc-sysconfig-nfs-server">/etc/sysconfig/nfs-server</primary>
277 </indexterm>
278
279 <para revision="systemd">
280 You can edit the <filename>/etc/default/nfs-utils</filename>
281 file to change the startup options for NFS daemons. Defaults
282 should be fine for most use cases.
283 </para>
284
285 <indexterm zone="nfs-utils nfs-utils-server-init" revision="systemd">
286 <primary sortas="e-etc-default-nfs-utils">/etc/default/nfs-utils</primary>
287 </indexterm>
288
289
290
291 </sect4>
292
293 </sect3>
294
295 <sect3 id='nfs-utils-client-config'>
296 <title>Client Configuration</title>
297
298 <para><filename>/etc/fstab</filename> contains the directories that
299 are to be mounted on the client. Alternately the partitions can be
300 mounted by using the <command>mount</command> command with the proper
301 options. To mount the <filename class="directory">/home</filename>
302 and <filename class="directory">/usr</filename> partitions, add the
303 following to the <filename>/etc/fstab</filename>:</para>
304
305<screen role="root"><userinput><replaceable>&lt;server-name&gt;</replaceable>:/home /home nfs rw,_netdev 0 0
306<replaceable>&lt;server-name&gt;</replaceable>:/usr /usr nfs ro,_netdev 0 0</userinput></screen>
307
308 <para>The options which can be used are specified in <command>man 5 nfs</command>.
309 If both the client and server are running recent versions of linux, most of the
310 options will be negotiated. You can specify either <literal>rw</literal> or
311 <literal>ro</literal>, <literal>_netdev</literal> if the filesystem is to be
312 automatically mounted at boot, or <literal>noauto</literal> (and perhaps
313 <literal>user</literal>) for other filesystems.</para>
314
315 <para>If the fileserver is not running a recent version of linux, you may need to
316 specifiy other options.</para>
317
318 <para>If you are using systemd, you may need to enable autofs v4 in your kernel,
319 and add the option <literal>comment=systemd.automount</literal>. Some machines
320 need this, because systemd tries to mount the external fs&apos;s before the network
321 is up, others do not need it. An alternative is for <systemitem
322 class="username">root</systemitem> to run <command>mount -a</command>.</para>
323
324 <indexterm zone="nfs-utils nfs-utils-client-config">
325 <primary sortas="e-etc-fstab">/etc/fstab</primary>
326 </indexterm>
327
328 <sect4 id="nfs-utils-client-init">
329 <title><phrase revision="sysv">Boot Script</phrase>
330 <phrase revision="systemd">Systemd Units</phrase></title>
331
332 <note>
333 <para>
334 The following <phrase revision="sysv">boot script is</phrase>
335 <phrase revision="systemd">systemd units are</phrase> not required
336 if the nfs-server <phrase revision="sysv">script is</phrase>
337 <phrase revision="systemd">units are</phrase> installed.
338 </para>
339 </note>
340
341 <para>Install the
342 <phrase revision="sysv">
343 <filename>/etc/rc.d/init.d/nfs-client</filename> init script</phrase>
344 <phrase revision="systemd">units</phrase> included in the
345 <xref linkend="bootscripts" revision="sysv"/>
346 <xref linkend="systemd-units" revision="systemd"/> package to start
347 the client services at boot.</para>
348
349<screen role="root"><userinput>make install-nfs-client</userinput></screen>
350
351 <indexterm zone="nfs-utils nfs-utils-client-config">
352 <primary sortas="f-nfs-client">nfs-client</primary>
353 </indexterm>
354
355 <para revision="sysv">To automatically mount <systemitem
356 class="filesystem">nfs</systemitem> filesystems, clients will also need
357 to install the <filename>netfs</filename> bootscript as described in
358 <xref linkend="postlfs-config-netfs"/>.</para>
359
360 <indexterm zone="nfs-utils nfs-utils-client-config" revision="sysv">
361 <primary sortas="f-netfs">netfs</primary>
362 </indexterm>
363
364 </sect4>
365
366 </sect3>
367
368 </sect2>
369
370 <sect2 role="content">
371 <title>Contents</title>
372 <segmentedlist>
373 <segtitle>Installed Programs</segtitle>
374 <segtitle>Installed Libraries</segtitle>
375 <segtitle>Installed Directories</segtitle>
376
377 <seglistitem>
378 <seg>exportfs, mountstats, mount.nfs, mount.nfs4 (link to mount.nfs),
379 nfsiostat, nfsstat, osd_login, rpc.mountd, rpc.nfsd, rpc.statd, rpcdebug,
380 showmount, sm-notify, start-statd, umount.nfs (link to mount.nfs),
381 and umount.nfs4 (link to mount.nfs)</seg>
382 <seg>None</seg>
383 <seg>/var/lib/nfs</seg>
384 </seglistitem>
385 </segmentedlist>
386
387 <variablelist>
388 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
389 <?dbfo list-presentation="list"?>
390 <?dbhtml list-presentation="table"?>
391
392 <varlistentry id="exportfs">
393 <term><command>exportfs</command></term>
394 <listitem>
395 <para>maintains a list of NFS exported file systems.</para>
396 <indexterm zone="nfs-utils exportfs">
397 <primary sortas="b-exportfs">exportfs</primary>
398 </indexterm>
399 </listitem>
400 </varlistentry>
401
402 <varlistentry id="mountstats">
403 <term><command>mountstats</command></term>
404 <listitem>
405 <para>displays NFS client per-mount statistics.</para>
406 <indexterm zone="nfs-utils mountstats">
407 <primary sortas="b-mountstats">mountstats</primary>
408 </indexterm>
409 </listitem>
410 </varlistentry>
411
412 <varlistentry id="mount.nfs">
413 <term><command>mount.nfs</command></term>
414 <listitem>
415 <para>is used to mount a network share using NFS</para>
416 <indexterm zone="nfs-utils mount.nfs">
417 <primary sortas="b-mount.nfs">mount.nfs</primary>
418 </indexterm>
419 </listitem>
420 </varlistentry>
421
422 <varlistentry id="mount.nfs4">
423 <term><command>mount.nfs4</command></term>
424 <listitem>
425 <para>is used to mount a network share using NFSv4</para>
426 <indexterm zone="nfs-utils mount.nfs4">
427 <primary sortas="b-mount.nfs4">mount.nfs4</primary>
428 </indexterm>
429 </listitem>
430 </varlistentry>
431
432 <varlistentry id="nfsiostat-nfs-utils">
433 <term><command>nfsiostat</command></term>
434 <listitem>
435 <para>reports input/output statistics for network filesystems.</para>
436 <indexterm zone="nfs-utils nfsiostat-nfs-utils">
437 <primary sortas="b-nfsiostat-nfs-utils">nfsiostat</primary>
438 </indexterm>
439 </listitem>
440 </varlistentry>
441
442 <varlistentry id="nfsstat">
443 <term><command>nfsstat</command></term>
444 <listitem>
445 <para>displays statistics kept about NFS client and server activity.</para>
446 <indexterm zone="nfs-utils nfsstat">
447 <primary sortas="b-nfsstat">nfsstat</primary>
448 </indexterm>
449 </listitem>
450 </varlistentry>
451
452 <varlistentry id="osd_login">
453 <term><command>osd_login</command></term>
454 <listitem>
455 <para>is a script that is a part of the autologin feature
456 mandated by the pnfs-objects standard.</para>
457 <indexterm zone="nfs-utils osd_login">
458 <primary sortas="b-osd_login">osd_login</primary>
459 </indexterm>
460 </listitem>
461 </varlistentry>
462
463
464 <varlistentry id="rpc.mountd">
465 <term><command>rpc.mountd</command></term>
466 <listitem>
467 <para>implements the NFS mount protocol on an NFS server.</para>
468 <indexterm zone="nfs-utils rpc.mountd">
469 <primary sortas="b-rpc.mountd">rpc.mountd</primary>
470 </indexterm>
471 </listitem>
472 </varlistentry>
473
474 <varlistentry id="rpc.nfsd">
475 <term><command>rpc.nfsd</command></term>
476 <listitem>
477 <para>implements the user level part of the NFS
478 service on the server.</para>
479 <indexterm zone="nfs-utils rpc.nfsd">
480 <primary sortas="b-rpc.nfsd">rpc.nfsd</primary>
481 </indexterm>
482 </listitem>
483 </varlistentry>
484
485 <varlistentry id="rpc.statd">
486 <term><command>rpc.statd</command></term>
487 <listitem>
488 <para>is used by the NFS file locking service. Run on both sides,
489 client as well as server, when you want file locking enabled.</para>
490 <indexterm zone="nfs-utils rpc.statd">
491 <primary sortas="b-rpc.statd">rpc.statd</primary>
492 </indexterm>
493 </listitem>
494 </varlistentry>
495
496 <varlistentry id="rpcdebug">
497 <term><command>rpcdebug</command></term>
498 <listitem>
499 <para>sets or clears the kernel's NFS client and server debug
500 flags.</para>
501 <indexterm zone="nfs-utils rpcdebug">
502 <primary sortas="b-rpcdebug">rpcdebug</primary>
503 </indexterm>
504 </listitem>
505 </varlistentry>
506
507 <varlistentry id="showmount">
508 <term><command>showmount</command></term>
509 <listitem>
510 <para>displays mount information for an NFS server.</para>
511 <indexterm zone="nfs-utils showmount">
512 <primary sortas="b-showmount">showmount</primary>
513 </indexterm>
514 </listitem>
515 </varlistentry>
516
517 <varlistentry id="sm-notify">
518 <term><command>sm-notify</command></term>
519 <listitem>
520 <para>is used to send Network Status Monitor reboot messages.</para>
521 <indexterm zone="nfs-utils sm-notify">
522 <primary sortas="b-sm-notify">sm-notify</primary>
523 </indexterm>
524 </listitem>
525 </varlistentry>
526
527 <varlistentry id="start-statd">
528 <term><command>start-statd</command></term>
529 <listitem>
530 <para>is a script called by nfsmount when mounting a filesystem with
531 locking enabled, if statd does not appear to be running. It can be
532 customised with whatever flags are appropriate for the site.</para>
533 <indexterm zone="nfs-utils start-statd">
534 <primary sortas="b-start-statd">start-statd</primary>
535 </indexterm>
536 </listitem>
537 </varlistentry>
538
539 <varlistentry id="umount.nfs">
540 <term><command>umount.nfs</command></term>
541 <listitem>
542 <para>is used to unmount a network share using NFS</para>
543 <indexterm zone="nfs-utils umount.nfs">
544 <primary sortas="b-umount.nfs">umount.nfs</primary>
545 </indexterm>
546 </listitem>
547 </varlistentry>
548
549 <varlistentry id="umount.nfs4">
550 <term><command>umount.nfs4</command></term>
551 <listitem>
552 <para>is used to unmount a network share using NFSv4</para>
553 <indexterm zone="nfs-utils umount.nfs4">
554 <primary sortas="b-umount.nfs4">umount.nfs4</primary>
555 </indexterm>
556 </listitem>
557 </varlistentry>
558
559 </variablelist>
560
561 </sect2>
562
563</sect1>
Note: See TracBrowser for help on using the repository browser.