xref: /original-bsd/sbin/mount/mount.8 (revision e66e06db)
1.\" Copyright (c) 1980, 1989, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"     @(#)mount.8	8.7 (Berkeley) 03/27/94
7.\"
8.Dd
9.Dt MOUNT 8
10.Os BSD 4
11.Sh NAME
12.Nm mount
13.Nd mount file systems
14.Sh SYNOPSIS
15.Nm mount
16.Op Fl adfruvw
17.Op Fl t Ar ufs | lfs | external_type
18.Nm mount
19.Op Fl dfruvw
20.Ar special | node
21.Nm mount
22.Op Fl dfruvw
23.Op Fl o Ar options
24.Op Fl t Ar ufs | lfs | external_type
25.Ar special node
26.Sh DESCRIPTION
27The
28.Nm mount
29command
30calls the
31.Xr mount 2
32system call to prepare and graft a
33.Ar "special device"
34or the remote node (rhost:path) on to the file system tree at the point
35.Ar node .
36If either
37.Ar special
38or
39.Ar node
40are not provided, the appropriate information is taken from the
41.Xr fstab 5
42file.
43.Pp
44The system maintains a list of currently mounted file systems.
45If no arguments are given to
46.Nm mount,
47this list is printed.
48.Pp
49The options are as follows:
50.Bl -tag -width indent
51.It Fl d
52Causes everything to be done except for the actual system call.
53This option is useful in conjunction with the
54.Fl v
55flag to
56determine what the
57.Nm mount
58command is trying to do.
59.It Fl f
60Forces the revocation of write access when trying to downgrade
61a filesystem mount status from read-write to read-only.
62.It Fl o
63Options are specified with a
64.Fl o
65flag followed by a comma separated string of options.
66The following options are available:
67.Bl -tag -width indent
68.It async
69All
70.Tn I/O
71to the file system should be done asynchronously.
72This is a
73.Em dangerous
74flag to set,
75and should not be used unless you are prepared to recreate the file
76system should your system crash.
77.It force
78The same as
79.Fl f ;
80forces the revocation of write access when trying to downgrade
81a filesystem mount status from read-write to read-only.
82.It nodev
83Do not interpret character or block special devices on the file system.
84This option is useful for a server that has file systems containing
85special devices for architectures other than its own.
86.It noexec
87Do not allow execution of any binaries on the mounted file system.
88This option is useful for a server that has file systems containing
89binaries for architectures other than its own.
90.It nosuid
91Do not allow set-user-identifier or set-group-identifier bits to take effect.
92.It rdonly
93The same as
94.Fl r ;
95mount the file system read-only (even the super-user may not write it).
96.It sync
97All
98.Tn I/O
99to the file system should be done synchronously.
100.It update
101The same as
102.Fl u ;
103indicate that the status of an already mounted file system should be changed.
104.It union
105Causes the namespace at the mount point to appear as the union
106of the mounted filesystem root and the existing directory.
107Lookups will be done in the mounted filesystem first.
108If those operations fail due to a non-existent file the underlying
109directory is then accessed.
110All creates are done in the mounted filesystem.
111.El
112.Pp
113Any additional options specific to a filesystem type that is not
114one of the internally known types (see the
115.Fl t
116option) may be passed as a comma separated list; these options are
117distinguished by a leading
118.Dq \&-
119(dash).
120Options that take a value are specified using the syntax -option=value.
121For example, the mount command:
122.Bd -literal -offset indent
123mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
124.Ed
125.Pp
126causes
127.Nm mount
128to execute the equivalent of:
129.Bd -literal -offset indent
130/sbin/mount_mfs -o nosuid -N -s 4000 /dev/dk0b /tmp
131.Ed
132.It Fl r
133The file system is to be mounted read-only.
134Mount the file system read-only (even the super-user may not write it).
135The same as the
136.Dq rdonly
137argument to the
138.Fl o
139option.
140.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type"
141The argument following the
142.Fl t
143is used to indicate the file system type.
144The type
145.Ar ufs
146is the default.
147The \fI-t\fP option can be used
148to indicate that the actions should only be taken on
149filesystems of the specified type.
150More than one type may be specified in a comma separated list.
151The list of filesystem types can be prefixed with
152.Dq no
153to specify the filesystem types for which action should
154.Em not
155be taken.
156For example, the
157.Nm mount
158command:
159.Bd -literal -offset indent
160mount -a -t nonfs,mfs
161.Ed
162.Pp
163mounts all filesystems except those of type
164.Tn NFS
165and
166.Tn MFS .
167.Pp
168If the type is not one of the internally known types,
169mount will attempt to execute a program in
170.Pa /sbin/mount_ Ns Em XXX
171where
172.Em XXX
173is replaced by the type name.
174For example, nfs filesystems are mounted by the program
175.Pa /sbin/mount_nfs .
176.It Fl u
177The
178.Fl u
179flag indicates that the status of an already mounted file
180system should be changed.
181Any of the options discussed above (the
182.Fl o
183option)
184may be changed;
185also a file system can be changed from read-only to read-write
186or vice versa.
187An attempt to change from read-write to read-only will fail if any
188files on the filesystem are currently open for writing unless the
189.Fl f
190flag is also specified.
191The set of options is determined by first extracting the options
192for the file system from the
193.Xr fstab
194table,
195then applying any options specified by the
196.Fl o
197argument,
198and finally applying the
199.Fl r
200or
201.Fl w
202option.
203.It Fl v
204Verbose mode.
205.It Fl w
206The file system object is to be read and write.
207.Pp
208The options specific to NFS filesystems are described in the
209.Xr mount_nfs 8
210manual page.
211.Sh FILES
212.Bl -tag -width /etc/fstab -compact
213.It Pa /etc/fstab
214file system table
215.El
216.Sh SEE ALSO
217.Xr mount 2 ,
218.Xr fstab 5 ,
219.Xr mount_cd9660 8 ,
220.Xr mount_fdesc 8 ,
221.Xr mount_kernfs 8 ,
222.Xr mount_lfs 8 ,
223.Xr mount_lofs 8 ,
224.Xr mount_mfs 8 ,
225.Xr mount_nfs 8 ,
226.Xr mount_null 8 ,
227.Xr mount_portal 8 ,
228.Xr mount_procfs 8 ,
229.Xr mount_umap 8 ,
230.Xr mount_union 8 ,
231.Xr umount 8
232.Sh BUGS
233It is possible for a corrupted file system to cause a crash.
234.Sh HISTORY
235A
236.Nm mount
237command appeared in
238.At v6 .
239