xref: /original-bsd/sbin/mount/mount.8 (revision de3f5c4e)
1.\" Copyright (c) 1980, 1989, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"     @(#)mount.8	6.16 (Berkeley) 05/04/91
7.\"
8.Dd
9.Dt MOUNT 8
10.Os BSD 4
11.Sh NAME
12.Nm mount ,
13.Nm umount
14.Nd mount and dismount file systems
15.Sh SYNOPSIS
16.Nm mount
17.Op Fl afrwu
18.Op Fl t Ar nfs | ufs | external_type
19.Nm mount
20.Op Fl frwu
21.Ar special| node
22.Nm mount
23.Op Fl frwu
24.Op Fl t Ar nfs | ufs | external_type
25.Op | Ar external_type
26.Op Fl o Ar options
27.Ar special node
28.Nm umount
29.Op Fl af
30.Op Fl t Ar nfs | ufs | external_type
31.Nm umount
32.Op Fl f
33.Ar special | node
34.Sh DESCRIPTION
35The
36.Nm mount
37command
38calls the
39.Xr mount 2
40system call to prepare and graft a
41.Ar special
42device or the remote node
43(rhost:path)
44on to the file system tree at the point
45.Ar node.
46If either
47.Ar special
48or
49.Ar node
50are not provided, the appropriate
51information is taken from the
52.Xr fstab 5
53file.
54.Pp
55The system maintains a list of currently mounted file systems.
56If no arguments are given to
57.Nm mount,
58this list is printed.
59.Pp
60Options available for the
61.Nm mount
62command:
63.Bl -tag -width indent
64.It Fl F
65The standard mount options are parsed and
66passed to external program via the
67.Fl F
68option
69as a decimal number.
70(See example below.)
71.It Fl f
72Causes everything to be done except for the actual system call; if it's
73not obvious, this ``fakes'' mounting the file system.
74This option is useful in conjunction with the
75.Fl v
76flag to
77determine what the
78.Nm mount
79command is trying to do.
80.It Fl o
81Options are specified with a
82.Fl o
83flag
84followed by a comma separated string of options.
85The following options apply to any file system that is being mounted:
86.Bl -tag -width indent
87.It noexec
88Do not allow execution of any binaries on the mounted file system.
89This options is useful for a server that has file systems containing
90binaries for architectures other than its own.
91.It nosuid
92Do not allow set-user-identifier or set-group-identifier bits to take effect.
93.It nodev
94Do not interpret character or block special devices on the file system.
95This options is useful for a server that has file systems containing
96special devices for architectures other than its own.
97.It synchronous
98All I/O to the file system should be done synchronously.
99.El
100.It Fl r
101The file system object is to be mounted read-only.
102.It Fl t Ar "nfs \\*(Ba ufs \\*(Ba external type"
103The argument following the
104.Fl t
105is used to indicate the file system type.
106The type
107.Ar ufs
108is the default.
109For example, the
110.Nm mount
111command:
112.Bd -literal -offset indent
113mount -a -t nonfs,mfs
114.Ed
115.Pp
116mounts all filesystems except those of type
117.Tn NFS
118and
119.Tn MFS .
120.Pp
121If the type is not one of the internally known types,
122mount will attempt to execute a program in
123.Pa /sbin/mount_ Ns Em XXX
124where
125.Em XXX
126is replaced by the type name.
127.It Fl u
128The
129.Fl u
130flag indicates that the status of an already mounted file
131system should be changed.
132Any of the options discussed above (the
133.Fl o
134option)
135may be changed;
136also a file system can be changed from read-only to read-write.
137The set of options is determined by first extracting the options
138for the file system from the
139.Xr fstab
140table,
141then applying any options specified by the
142.Fl o
143argument,
144and finally applying the
145.Fl r
146or
147.Fl w
148option.
149.It Fl v
150Verbose mode.
151.It Fl w
152The file system object is to be read and write.
153.It Fl
154Any additional options specific to the program can
155be passed as a comma separated list;
156these options are distinguished by starting with a
157.Fl
158(dash).
159.El
160.Pp
161Those options that take a value are specified
162using the syntax -option=value.
163For example, the mount command:
164.Bd -literal -offset indent
165mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
166.Ed
167.Pp
168causes mount to attempt to execute:
169.Bd -literal -offset indent
170/sbin/mount_mfs -F 8 -N -s 4000 /dev/dk0b /tmp
171.Ed
172.Pp
173The following list can be used to override
174the defaults for an nfs mount:
175.Bl -tag -width indent
176.It hard
177.Tn I/O
178system calls will retry until the server responds (default)
179.It soft
180.Tn I/O
181system calls will fail and return errno after
182.Em retrans
183request
184retransmissions
185.It spongy
186Soft semantics for the stat, lookup, fsstat, readlink and readdir
187filesystem operations and hard semantics for the others.
188This option is meant to be similar to hard,
189except that processes will not be hung forever when
190they trip over mount points to dead servers.
191.It bg
192If the first mount request times out, do retries in background
193.It intr
194.Tn I/O
195system calls can be interrupted.
196.It noconn
197Do not connect the socket.
198Used for
199.Tn UDP
200servers that send replies from a
201socket other than the nfs server socket.
202.It tcp
203Use
204.Tn TCP
205transport instead of
206.Tn UDP .
207.It rsize=#
208Set read size to
209.Ar #
210bytes.
211.It wsize=#
212Set write size to
213.Ar #
214bytes.
215.It retry=#
216Set mount retry count to
217.Ar # .
218.It retrans=#
219Set retransmission count for nfs rpc's to
220.Ar # .
221.It timeo=#
222Set initial nfs timeout to
223.Ar #
224in 0.1 sec intervals.
225.El
226.Pp
227.Nm Umount
228removes the
229.Ar special
230device
231grafted
232at point
233.Ar node
234from file system tree.
235.Pp
236Options for the
237.Nm umount
238command:
239.Bl -tag -width indent
240.It Fl f
241The file system is forcibly unmounted.
242Active special devices continue to work,
243but all other files return errors if further accesses are attempted.
244The root file system cannot be forcibly unmounted.
245.It Fl a
246All of the file systems described in
247.Xr fstab
248are unmounted.
249.It Fl t
250Is used to indicate the actions should only be taken on
251filesystems of the specified type.
252More than one type may be specified in a comma separated list.
253The list of filesystem types can be prefixed with ``no'' to
254specify the filesystem types on which no action should be taken.
255(See example above for the
256.Nm mount
257command.)
258.El
259.Sh FILES
260.Bl -tag -width /etc/fstab -compact
261.It Pa /etc/fstab
262file system table
263.El
264.Sh SEE ALSO
265.Xr mount 2 ,
266.Xr unmount 2 ,
267.Xr fstab 5
268.Sh BUGS
269It is possible for a corrupted file system to cause a crash.
270.Sh HISTORY
271A
272.Nm
273command appeared in
274.At v6 .
275