]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/mountd/mountd.man
mountd: fix is_subdirectory to understand '/'
[nfs-utils.git] / utils / mountd / mountd.man
1 .\"@(#)rpc.mountd.8"
2 .\"
3 .\" Copyright (C) 1999 Olaf Kirch <okir@monad.swb.de>
4 .\" Modified by Paul Clements, 2004.
5 .\"
6 .TH rpc.mountd 8 "31 Dec 2009"
7 .SH NAME
8 rpc.mountd \- NFS mount daemon
9 .SH SYNOPSIS
10 .BI "/usr/sbin/rpc.mountd [" options "]"
11 .SH DESCRIPTION
12 The
13 .B rpc.mountd
14 daemon implements the server side of the NFS MOUNT protocol,
15 an NFS side protocol used by NFS version 2 [RFC1094] and NFS version 3 [RFC1813].
16 .PP
17 An NFS server maintains a table of local physical file systems
18 that are accessible to NFS clients.
19 Each file system in this table is referred to as an
20 .IR "exported file system" ,
21 or
22 .IR export ,
23 for short.
24 .PP
25 Each file system in the export table has an access control list.
26 .B rpc.mountd
27 uses these access control lists to determine
28 whether an NFS client is permitted to access a given file system.
29 For details on how to manage your NFS server's export table, see the
30 .BR exports (5)
31 and
32 .BR exportfs (8)
33 man pages.
34 .SS Mounting exported NFS File Systems
35 The NFS MOUNT protocol has several procedures.
36 The most important of these are
37 MNT (mount an export) and
38 UMNT (unmount an export).
39 .PP
40 A MNT request has two arguments: an explicit argument that
41 contains the pathname of the root directory of the export to be mounted,
42 and an implicit argument that is the sender's IP address.
43 .PP
44 When receiving a MNT request from an NFS client,
45 .B rpc.mountd
46 checks both the pathname and the sender's IP address against its export table.
47 If the sender is permitted to access the requested export,
48 .B rpc.mountd
49 returns an NFS file handle for the export's root directory to the client.
50 The client can then use the root file handle and NFS LOOKUP requests
51 to navigate the directory structure of the export.
52 .SS The rmtab File
53 The
54 .B rpc.mountd
55 daemon registers every successful MNT request by adding an entry to the
56 .I /var/lib/nfs/rmtab
57 file.
58 When receivng a UMNT request from an NFS client,
59 .B rpc.mountd
60 simply removes the matching entry from
61 .IR /var/lib/nfs/rmtab ,
62 as long as the access control list for that export allows that sender
63 to access the export.
64 .PP
65 Clients can discover the list of file systems an NFS server is
66 currently exporting, or the list of other clients that have mounted
67 its exports, by using the
68 .BR showmount (8)
69 command.
70 .BR showmount (8)
71 uses other procedures in the NFS MOUNT protocol to report information
72 about the server's exported file systems.
73 .PP
74 Note, however, that there is little to guarantee that the contents of
75 .I /var/lib/nfs/rmtab
76 are accurate.
77 A client may continue accessing an export even after invoking UMNT.
78 If the client reboots without sending a UMNT request, stale entries
79 remain for that client in
80 .IR /var/lib/nfs/rmtab .
81 .SH OPTIONS
82 .TP
83 .B \-d kind " or " \-\-debug kind
84 Turn on debugging. Valid kinds are: all, auth, call, general and parse.
85 .TP
86 .B \-F " or " \-\-foreground
87 Run in foreground (do not daemonize)
88 .TP
89 .B \-f " or " \-\-exports-file
90 This option specifies the exports file, listing the clients that this
91 server is prepared to serve and parameters to apply to each
92 such mount (see
93 .BR exports (5)).
94 By default, export information is read from
95 .IR /etc/exports .
96 .TP
97 .B \-h " or " \-\-help
98 Display usage message.
99 .TP
100 .B \-o num " or " \-\-descriptors num
101 Set the limit of the number of open file descriptors to num. The
102 default is to leave the limit unchanged.
103 .TP
104 .B \-N " or " \-\-no-nfs-version
105 This option can be used to request that
106 .B rpc.mountd
107 do not offer certain versions of NFS. The current version of
108 .B rpc.mountd
109 can support both NFS version 2, 3 and 4. If the
110 either one of these version should not be offered,
111 .B rpc.mountd
112 must be invoked with the option
113 .B "\-\-no-nfs-version <vers>" .
114 .TP
115 .B \-n " or " \-\-no-tcp
116 Don't advertise TCP for mount.
117 .TP
118 .B \-P
119 Ignored (compatibility with unfsd??).
120 .TP
121 .B \-p " or " \-\-port num
122 Specifies the port number used for RPC listener sockets.
123 If this option is not specified,
124 .B rpc.mountd
125 will try to consult
126 .IR /etc/services ,
127 if gets port succeed, set the same port for all listener socket,
128 otherwise chooses a random ephemeral port for each listener socket.
129 .IP
130 This option can be used to fix the port value of
131 .BR rpc.mountd 's
132 listeners when NFS MOUNT requests must traverse a firewall
133 between clients and servers.
134 .TP
135 .B \-H " or " \-\-ha-callout prog
136 Specify a high availability callout program.
137 This program receives callouts for all MOUNT and UNMOUNT requests.
138 This allows
139 .B rpc.mountd
140 to be used in a High Availability NFS (HA-NFS) environment.
141 .IP
142 The callout program is run with 4 arguments.
143 The first is
144 .B mount
145 or
146 .B unmount
147 depending on the reason for the callout.
148 The second will be the name of the client performing the mount.
149 The third will be the path that the client is mounting.
150 The last is the number of concurrent mounts that we believe the client
151 has of that path.
152 .IP
153 This callout is not needed with 2.6 and later kernels.
154 Instead, mount the nfsd filesystem on
155 .IR /proc/fs/nfsd .
156 .TP
157 .BI "\-s," "" " \-\-state\-directory\-path "  directory
158 Specify a directory in which to place statd state information.
159 If this option is not specified the default of
160 .I /var/lib/nfs
161 is used.
162 .TP
163 .BI "\-r," "" " \-\-reverse\-lookup"
164 .B rpc.mountd
165 tracks IP addresses in the
166 .I rmtab
167 file.  When a DUMP request is made (by
168 someone running
169 .BR "showmount -a" ,
170 for instance), it returns IP addresses instead
171 of hostnames by default. This option causes
172 .B rpc.mountd
173 to perform a reverse lookup on each IP address and return that hostname instead.
174 Enabling this can have a substantial negative effect on performance
175 in some situations.
176 .TP
177 .BR "\-t N" " or " "\-\-num\-threads=N"
178 This option specifies the number of worker threads that rpc.mountd
179 spawns.  The default is 1 thread, which is probably enough.  More
180 threads are usually only needed for NFS servers which need to handle
181 mount storms of hundreds of NFS mounts in a few seconds, or when
182 your DNS server is slow or unreliable.
183 .TP
184 .B \-V " or " \-\-nfs-version
185 This option can be used to request that
186 .B rpc.mountd
187 offer certain versions of NFS. The current version of
188 .B rpc.mountd
189 can support both NFS version 2 and the newer version 3.
190 .TP
191 .B \-v " or " \-\-version
192 Print the version of
193 .B rpc.mountd
194 and exit.
195 .TP
196 .B \-g " or " \-\-manage-gids
197 Accept requests from the kernel to map user id numbers into  lists of
198 group id numbers for use in access control.  An NFS request will
199 normally (except when using Kerberos or other cryptographic
200 authentication) contains a user-id and a list of group-ids.  Due to a
201 limitation in the NFS protocol, at most 16 groups ids can be listed.
202 If you use the
203 .B \-g
204 flag, then the list of group ids received from the client will be
205 replaced by a list of group ids determined by an appropriate lookup on
206 the server. Note that the 'primary' group id is not affected so a
207 .B newgroup
208 command on the client will still be effective.  This function requires
209 a Linux Kernel with version at least 2.6.21.
210 .SH TCP_WRAPPERS SUPPORT
211 You can protect your
212 .B rpc.mountd
213 listeners using the
214 .B tcp_wrapper
215 library or
216 .BR iptables (8).
217 .PP
218 Note that the
219 .B tcp_wrapper
220 library supports only IPv4 networking.
221 .PP
222 Add the hostnames of NFS peers that are allowed to access
223 .B rpc.mountd
224 to
225 .IR /etc/hosts.allow .
226 Use the daemon name
227 .B mountd
228 even if the
229 .B rpc.mountd
230 binary has a different name.
231 .PP
232 Hostnames used in either access file will be ignored when
233 they can not be resolved into IP addresses.
234 For further information see the
235 .BR tcpd (8)
236 and
237 .BR hosts_access (5)
238 man pages.
239 .SS IPv6 and TI-RPC support
240 TI-RPC is a pre-requisite for supporting NFS on IPv6.
241 If TI-RPC support is built into
242 .BR rpc.mountd ,
243 it attempts to start listeners on network transports marked 'visible' in
244 .IR /etc/netconfig .
245 As long as at least one network transport listener starts successfully,
246 .B rpc.mountd
247 will operate.
248 .SH FILES
249 .TP 2.5i
250 .I /etc/exports
251 input file for
252 .BR exportfs ,
253 listing exports, export options, and access control lists
254 .TP 2.5i
255 .I /var/lib/nfs/rmtab
256 table of clients accessing server's exports
257 .SH SEE ALSO
258 .BR exportfs (8),
259 .BR exports (5),
260 .BR showmount (8),
261 .BR rpc.nfsd (8),
262 .BR rpc.rquotad (8),
263 .BR nfs (5),
264 .BR tcpd (8),
265 .BR hosts_access (5),
266 .BR iptables (8),
267 .BR netconfig (5)
268 .sp
269 RFC 1094 - "NFS: Network File System Protocol Specification"
270 .br
271 RFC 1813 - "NFS Version 3 Protocol Specification"
272 .SH AUTHOR
273 Olaf Kirch, H. J. Lu, G. Allan Morris III, and a host of others.