1.\"
2.\" Copyright (c) 1997-2014 Erez Zadok
3.\" Copyright (c) 1990 Jan-Simon Pendry
4.\" Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5.\" Copyright (c) 1990 The Regents of the University of California.
6.\" All rights reserved.
7.\"
8.\" This code is derived from software contributed to Berkeley by
9.\" Jan-Simon Pendry at Imperial College, London.
10.\"
11.\" Redistribution and use in source and binary forms, with or without
12.\" modification, are permitted provided that the following conditions
13.\" are met:
14.\" 1. Redistributions of source code must retain the above copyright
15.\"    notice, this list of conditions and the following disclaimer.
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\"    notice, this list of conditions and the following disclaimer in the
18.\"    documentation and/or other materials provided with the distribution.
19.\" 3. Neither the name of the University nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\"
36.\" File: am-utils/fixmount/fixmount.8
37.\" $FreeBSD$
38.\"
39.Dd February 26, 2016
40.Dt FIXMOUNT 8
41.Os
42.Sh NAME
43.Nm fixmount
44.Nd fix remote mount entries
45.Sh SYNOPSIS
46.Nm
47.Op Fl adervq
48.Op Fl h Ar name
49.Ar host ...
50.Sh DESCRIPTION
51.Bf -symbolic
52This command is obsolete.
53Users are advised to use
54.Xr autofs 5
55instead.
56.Ef
57.Pp
58The
59.Nm
60utility
61is a variant of
62.Xr showmount 8
63that can delete bogus mount entries in remote
64.Xr mountd 8
65daemons.
66The actions specified by the options are performed for each
67.Ar host
68in turn.
69.Sh OPTIONS
70.Bl -tag -width indent
71.It Fl a , d , e
72These options work as in
73.Xr showmount 8
74except that only entries pertaining to the local host are printed.
75.It Fl r
76Removes those remote mount entries on
77.Ar host
78that do not correspond to current mounts, i.e., which are left-over
79from a crash or are the result of improper mount protocol.
80The actuality of mounts is verified using the entries in
81.Pa /etc/mtab .
82.It Fl v
83Verify remote mounts.
84Similar to
85.Fl r
86except that only a notification message is printed for each bogus entry
87found.
88The remote mount table is not changed.
89.It Fl A
90Issues a command to the remote mountd declaring that
91.Em all
92of its file systems have been unmounted.
93This should be used with caution, as it removes all
94remote mount entries pertaining to the local system, whether or not any
95file systems are still mounted locally.
96.It Fl q
97Be quiet.
98Suppresses error messages due to timeouts and
99.Dq Li "Program not registered" ,
100i.e., due to remote hosts not supporting RPC or not running
101.Xr mountd 8 .
102.It Fl h Ar name
103Pretend the local hostname is
104.Ar name .
105This is useful after the local hostname has been changed and rmtab entries
106using the old name remain on a remote machine.
107Unfortunately, most mountd's will not be able to successfully handle removal
108of such entries, so this option is useful in combination with
109.Fl v
110only.
111.Pp
112This option also saves time as comparisons of remotely recorded and local
113hostnames by address are avoided.
114.El
115.Sh FILES
116.Bl -tag -width ".Pa /etc/rmtab"
117.It Pa /etc/mtab
118List of current mounts.
119.It Pa /etc/rmtab
120Backup file for remote mount entries on
121.Tn NFS
122server.
123.El
124.Sh SEE ALSO
125.Xr mtab 5 ,
126.Xr rmtab 5 ,
127.Xr mountd 8 ,
128.Xr showmount 8
129.Pp
130.Dq am-utils
131.Xr info 1
132entry.
133.Rs
134.%A Erez Zadok
135.%B "Linux NFS and Automounter Administration"
136.%O ISBN 0-7821-2739-8
137.%I Sybex
138.%D 2001
139.Re
140.Pp
141.Pa http://www.am-utils.org/
142.Rs
143.%T Amd \- The 4.4 BSD Automounter
144.Re
145.Sh HISTORY
146The
147.Nm
148utility appeared in
149.Fx 3.0 .
150.Sh AUTHORS
151.An Jan-Simon Pendry Aq [email protected] ,
152Department of Computing, Imperial College, London, UK.
153.Pp
154.An Erez Zadok Aq [email protected] ,
155Department of Computer Science, Columbia University, New York, USA.
156.Pp
157.An Other authors and contributors to
158.Nm am-utils
159are listed in the
160.Pa AUTHORS
161file distributed with
162.Nm am-utils .
163.Sh AUTHORS
164.An Andreas Stolcke Aq [email protected]
165.Pp
166.An Erez Zadok Aq [email protected] ,
167Computer Science Department, Stony Brook University, Stony Brook, New York, USA.
168.Pp
169Other authors and contributors to am-utils are listed in the
170.Pa AUTHORS
171file distributed with am-utils.
172.Sh BUGS
173No attempt is made to verify the information in
174.Pa /etc/mtab
175itself.
176.Pp
177Since swap file mounts are not recorded in
178.Pa /etc/mtab ,
179a heuristic specific to SunOS is used to determine whether such a mount
180is actual (replacing the string
181.Dq Li swap
182with
183.Dq Li root
184and verifying the resulting path).
185.Pp
186Symbolic links on the server will cause the path in the remote entry to differ
187from the one in
188.Pa /etc/mtab .
189To catch those cases, a file system is also deemed mounted if its
190.Em local
191mount point is identical to the remote entry.
192I.e., on a SunOS diskless client,
193.Pa server:/export/share/sunos.4.1.1
194is actually
195.Pa /usr/share .
196Since the local mount point is
197.Pa /usr/share
198as well this will be handled correctly.
199.Pp
200There is no way to clear a stale entry in a remote
201.Xr mountd 8
202after the
203local hostname (or whatever reverse name resolution returns for it)
204has been changed.
205To take care of these cases,
206the remote
207.Pa /etc/rmtab
208file has to be edited and
209.Xr mountd 8
210restarted.
211.Pp
212The RPC timeouts for
213.Xr mountd 8
214calls can only be changed by recompiling.
215The defaults are 2 seconds for client handle creation and 5 seconds for
216RPC calls.
217