Deleted Added
full compact
mount.8 (31468) mount.8 (35105)
1.\" Copyright (c) 1980, 1989, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)mount.8 8.8 (Berkeley) 6/16/94
1.\" Copyright (c) 1980, 1989, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)mount.8 8.8 (Berkeley) 6/16/94
33.\" $Id: mount.8,v 1.20 1997/11/13 00:28:49 julian Exp $
33.\" $Id: mount.8,v 1.21 1997/12/01 00:44:16 steve Exp $
34.\"
35.Dd June 16, 1994
36.Dt MOUNT 8
37.Os BSD 4
38.Sh NAME
39.Nm mount
40.Nd mount file systems
41.Sh SYNOPSIS
42.Nm mount
43.Op Fl adfpruvw
44.Op Fl t Ar ufs | lfs | external_type
45.Nm mount
46.Op Fl dfpruvw
47.Ar special | node
48.Nm mount
49.Op Fl dfpruvw
50.Op Fl o Ar options
51.Op Fl t Ar ufs | lfs | external_type
52.Ar special node
53.Sh DESCRIPTION
54The
55.Nm
56command
57calls the
58.Xr mount 2
59system call to prepare and graft a
60.Ar "special device"
61or the remote node (rhost:path) on to the file system tree at the point
62.Ar node .
63If either
64.Ar special
65or
66.Ar node
67are not provided, the appropriate information is taken from the
68.Xr fstab 5
69file.
70.Pp
71The system maintains a list of currently mounted file systems.
72If no arguments are given to
73.Nm mount ,
74this list is printed.
75.Pp
76The options are as follows:
77.Bl -tag -width indent
78.It Fl a
79All the filesystems described in
80.Xr fstab 5
81are mounted.
82Exceptions are those marked as ``noauto'', excluded by the
83.Fl t
84flag (see below), or if they are already mounted (except the
85root filesystem which is always remounted to preserve
86traditional single user mode behavior).
87.It Fl d
88Causes everything to be done except for the actual system call.
89This option is useful in conjunction with the
90.Fl v
91flag to
92determine what the
93.Nm
94command is trying to do.
95.It Fl f
96Forces the revocation of write access when trying to downgrade
97a filesystem mount status from read-write to read-only. Also
98forces the R/W mount of an unclean filesystem (dangerous; use with
99caution).
100.It Fl o
101Options are specified with a
102.Fl o
103flag followed by a comma separated string of options.
104The following options are available:
105.Bl -tag -width indent
106.It async
107All
108.Tn I/O
109to the file system should be done asynchronously.
110This is a
111.Em dangerous
112flag to set,
113and should not be used unless you are prepared to recreate the file
114system should your system crash.
115.It force
116The same as
117.Fl f ;
118forces the revocation of write access when trying to downgrade
119a filesystem mount status from read-write to read-only. Also
120forces the R/W mount of an unclean filesystem (dangerous; use with caution).
121.It noatime
122Do not update the file access time when reading from a file. This option
123is useful on filesystems where there are large numbers of files and
124performance is more critical than updating the file access time (which is
125rarely ever important). This option is currently only supported on local
126filesystems.
127.It noauto
128This filesystem should be skipped when mount is run with the
129.Fl a
130flag.
131.It noclusterr
132Disable read clustering.
133.It noclusterw
134Disable write clustering.
135.It nodev
136Do not interpret character or block special devices on the file system.
137This option is useful for a server that has file systems containing
138special devices for architectures other than its own.
139.It noexec
140Do not allow execution of any binaries on the mounted file system.
141This option is useful for a server that has file systems containing
142binaries for architectures other than its own.
143.It nosuid
144Do not allow set-user-identifier or set-group-identifier bits to take effect.
145Note: this option is worthless if a public available suid or sgid
146wrapper like
147.Xr suidperl 1
148is installed on your system.
34.\"
35.Dd June 16, 1994
36.Dt MOUNT 8
37.Os BSD 4
38.Sh NAME
39.Nm mount
40.Nd mount file systems
41.Sh SYNOPSIS
42.Nm mount
43.Op Fl adfpruvw
44.Op Fl t Ar ufs | lfs | external_type
45.Nm mount
46.Op Fl dfpruvw
47.Ar special | node
48.Nm mount
49.Op Fl dfpruvw
50.Op Fl o Ar options
51.Op Fl t Ar ufs | lfs | external_type
52.Ar special node
53.Sh DESCRIPTION
54The
55.Nm
56command
57calls the
58.Xr mount 2
59system call to prepare and graft a
60.Ar "special device"
61or the remote node (rhost:path) on to the file system tree at the point
62.Ar node .
63If either
64.Ar special
65or
66.Ar node
67are not provided, the appropriate information is taken from the
68.Xr fstab 5
69file.
70.Pp
71The system maintains a list of currently mounted file systems.
72If no arguments are given to
73.Nm mount ,
74this list is printed.
75.Pp
76The options are as follows:
77.Bl -tag -width indent
78.It Fl a
79All the filesystems described in
80.Xr fstab 5
81are mounted.
82Exceptions are those marked as ``noauto'', excluded by the
83.Fl t
84flag (see below), or if they are already mounted (except the
85root filesystem which is always remounted to preserve
86traditional single user mode behavior).
87.It Fl d
88Causes everything to be done except for the actual system call.
89This option is useful in conjunction with the
90.Fl v
91flag to
92determine what the
93.Nm
94command is trying to do.
95.It Fl f
96Forces the revocation of write access when trying to downgrade
97a filesystem mount status from read-write to read-only. Also
98forces the R/W mount of an unclean filesystem (dangerous; use with
99caution).
100.It Fl o
101Options are specified with a
102.Fl o
103flag followed by a comma separated string of options.
104The following options are available:
105.Bl -tag -width indent
106.It async
107All
108.Tn I/O
109to the file system should be done asynchronously.
110This is a
111.Em dangerous
112flag to set,
113and should not be used unless you are prepared to recreate the file
114system should your system crash.
115.It force
116The same as
117.Fl f ;
118forces the revocation of write access when trying to downgrade
119a filesystem mount status from read-write to read-only. Also
120forces the R/W mount of an unclean filesystem (dangerous; use with caution).
121.It noatime
122Do not update the file access time when reading from a file. This option
123is useful on filesystems where there are large numbers of files and
124performance is more critical than updating the file access time (which is
125rarely ever important). This option is currently only supported on local
126filesystems.
127.It noauto
128This filesystem should be skipped when mount is run with the
129.Fl a
130flag.
131.It noclusterr
132Disable read clustering.
133.It noclusterw
134Disable write clustering.
135.It nodev
136Do not interpret character or block special devices on the file system.
137This option is useful for a server that has file systems containing
138special devices for architectures other than its own.
139.It noexec
140Do not allow execution of any binaries on the mounted file system.
141This option is useful for a server that has file systems containing
142binaries for architectures other than its own.
143.It nosuid
144Do not allow set-user-identifier or set-group-identifier bits to take effect.
145Note: this option is worthless if a public available suid or sgid
146wrapper like
147.Xr suidperl 1
148is installed on your system.
149.It nosymfollow
150Do not follow symlinks
151on the mounted file system.
149.It rdonly
150The same as
151.Fl r ;
152mount the file system read-only (even the super-user may not write it).
153.It sync
154All
155.Tn I/O
156to the file system should be done synchronously.
157.It suiddir
158A directory on the mounted filesystem will respond to the SUID bit
159being set, by setting the owner of any new files to be the same
160as the owner of the directory.
161New directories will inherit the bit from their parents.
162Execute bits are removed from
163the file, and it will not be given to root.
164.Pp
165This feature is designed for use on fileservers serving PC users via
166ftp, SAMBA, or netatalk. It provides security holes for shell users and as
167such should not be used on shell machines, especially on home directories.
168This option requires the SUIDDIR
169option in the kernel to work. Only UFS filesystems support this option.
170See
171.Xr chmod 2
172for more information.
173.It update
174The same as
175.Fl u ;
176indicate that the status of an already mounted file system should be changed.
177.It union
178Causes the namespace at the mount point to appear as the union
179of the mounted filesystem root and the existing directory.
180Lookups will be done in the mounted filesystem first.
181If those operations fail due to a non-existent file the underlying
182directory is then accessed.
183All creates are done in the mounted filesystem.
184.El
185.Pp
186Any additional options specific to a filesystem type that is not
187one of the internally known types (see the
188.Fl t
189option) may be passed as a comma separated list; these options are
190distinguished by a leading
191.Dq \&-
192(dash).
193Options that take a value are specified using the syntax -option=value.
194For example, the
195.Nm
196command:
197.Bd -literal -offset indent
198mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
199.Ed
200.Pp
201causes
202.Nm
203to execute the equivalent of:
204.Bd -literal -offset indent
205/sbin/mount_mfs -o nosuid -N -s 4000 /dev/dk0b /tmp
206.Ed
207.It Fl p
208Print mount information in fstab format. Implies also the
209.Fl v
210option.
211.It Fl r
212The file system is to be mounted read-only.
213Mount the file system read-only (even the super-user may not write it).
214The same as the
215.Dq rdonly
216argument to the
217.Fl o
218option.
219.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type"
220The argument following the
221.Fl t
222is used to indicate the file system type.
223The type
224.Ar ufs
225is the default.
226The
227.Fl t
228option can be used
229to indicate that the actions should only be taken on
230filesystems of the specified type.
231More than one type may be specified in a comma separated list.
232The list of filesystem types can be prefixed with
233.Dq no
234to specify the filesystem types for which action should
235.Em not
236be taken.
237For example, the
238.Nm
239command:
240.Bd -literal -offset indent
241mount -a -t nonfs,mfs
242.Ed
243.Pp
244mounts all filesystems except those of type
245.Tn NFS
246and
247.Tn MFS .
248.Pp
249If the type is not one of the internally known types,
250.Nm
251will attempt to execute a program in
252.Pa /sbin/mount_ Ns Em XXX
253where
254.Em XXX
255is replaced by the type name.
256For example, nfs filesystems are mounted by the program
257.Pa /sbin/mount_nfs .
258.Pp
259Most filesystems will be dynamically loaded by their mount programs
260if not already present in the kernel, using the
261.Xr vfsload 3
262subroutine. Because this mechanism requires writable temporary space,
263the filesystem type containing
264.Pa /tmp
265must be compiled into the kernel, and the filesystems containing
266.Pa /tmp
267and
268.Pa /usr/bin/ld
269must be listed in
270.Pa /etc/fstab
271before any filesystems which might be dynamically loaded.
272.It Fl u
273The
274.Fl u
275flag indicates that the status of an already mounted file
276system should be changed.
277Any of the options discussed above (the
278.Fl o
279option)
280may be changed;
281also a file system can be changed from read-only to read-write
282or vice versa.
283An attempt to change from read-write to read-only will fail if any
284files on the filesystem are currently open for writing unless the
285.Fl f
286flag is also specified.
287The set of options is determined by first extracting the options
288for the file system from the
289.Xr fstab 5
290table,
291then applying any options specified by the
292.Fl o
293argument,
294and finally applying the
295.Fl r
296or
297.Fl w
298option.
299.It Fl v
300Verbose mode.
301.It Fl w
302The file system object is to be read and write.
303.Pp
304The options specific to NFS filesystems are described in the
305.Xr mount_nfs 8
306manual page.
307.Sh DIAGNOSTICS
308Various, most of them are self-explanatory.
309.Pp
310.Dl XXXXX filesystem is not available
311.Pp
312The kernel doesn't support the respective filesystem type. Note that
313support for a particular filesystem might be provided either on a static
314(kernel compile-time), or dynamic basis (loaded as a kernel module by
315.Xr modload 8 ).
316Normally,
317.Nm
318or its subprocesses attempt to dynamically load a filesystem module if
319it hasn't been configured statically, using
320.Xr vfsload 3 .
321In this case, the above error message can also mean that you didn't
322have permission to load the module.
323.Sh FILES
324.Bl -tag -width /etc/fstab -compact
325.It Pa /etc/fstab
326file system table
327.El
328.Sh SEE ALSO
329.Xr mount 2 ,
330.Xr vfsload 3 ,
331.Xr fstab 5 ,
332.Xr mount_cd9660 8 ,
333.Xr mount_devfs 8 ,
334.Xr mount_fdesc 8 ,
335.Xr mount_kernfs 8 ,
336.Xr mount_lfs 8 ,
337.Xr mount_mfs 8 ,
338.Xr mount_msdos 8 ,
339.Xr mount_nfs 8 ,
340.Xr mount_null 8 ,
341.Xr mount_portal 8 ,
342.Xr mount_procfs 8 ,
343.Xr mount_umap 8 ,
344.Xr mount_union 8 ,
345.Xr umount 8
346.Sh BUGS
347It is possible for a corrupted file system to cause a crash.
348.Sh HISTORY
349A
350.Nm
351command appeared in
352.At v1 .
152.It rdonly
153The same as
154.Fl r ;
155mount the file system read-only (even the super-user may not write it).
156.It sync
157All
158.Tn I/O
159to the file system should be done synchronously.
160.It suiddir
161A directory on the mounted filesystem will respond to the SUID bit
162being set, by setting the owner of any new files to be the same
163as the owner of the directory.
164New directories will inherit the bit from their parents.
165Execute bits are removed from
166the file, and it will not be given to root.
167.Pp
168This feature is designed for use on fileservers serving PC users via
169ftp, SAMBA, or netatalk. It provides security holes for shell users and as
170such should not be used on shell machines, especially on home directories.
171This option requires the SUIDDIR
172option in the kernel to work. Only UFS filesystems support this option.
173See
174.Xr chmod 2
175for more information.
176.It update
177The same as
178.Fl u ;
179indicate that the status of an already mounted file system should be changed.
180.It union
181Causes the namespace at the mount point to appear as the union
182of the mounted filesystem root and the existing directory.
183Lookups will be done in the mounted filesystem first.
184If those operations fail due to a non-existent file the underlying
185directory is then accessed.
186All creates are done in the mounted filesystem.
187.El
188.Pp
189Any additional options specific to a filesystem type that is not
190one of the internally known types (see the
191.Fl t
192option) may be passed as a comma separated list; these options are
193distinguished by a leading
194.Dq \&-
195(dash).
196Options that take a value are specified using the syntax -option=value.
197For example, the
198.Nm
199command:
200.Bd -literal -offset indent
201mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
202.Ed
203.Pp
204causes
205.Nm
206to execute the equivalent of:
207.Bd -literal -offset indent
208/sbin/mount_mfs -o nosuid -N -s 4000 /dev/dk0b /tmp
209.Ed
210.It Fl p
211Print mount information in fstab format. Implies also the
212.Fl v
213option.
214.It Fl r
215The file system is to be mounted read-only.
216Mount the file system read-only (even the super-user may not write it).
217The same as the
218.Dq rdonly
219argument to the
220.Fl o
221option.
222.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type"
223The argument following the
224.Fl t
225is used to indicate the file system type.
226The type
227.Ar ufs
228is the default.
229The
230.Fl t
231option can be used
232to indicate that the actions should only be taken on
233filesystems of the specified type.
234More than one type may be specified in a comma separated list.
235The list of filesystem types can be prefixed with
236.Dq no
237to specify the filesystem types for which action should
238.Em not
239be taken.
240For example, the
241.Nm
242command:
243.Bd -literal -offset indent
244mount -a -t nonfs,mfs
245.Ed
246.Pp
247mounts all filesystems except those of type
248.Tn NFS
249and
250.Tn MFS .
251.Pp
252If the type is not one of the internally known types,
253.Nm
254will attempt to execute a program in
255.Pa /sbin/mount_ Ns Em XXX
256where
257.Em XXX
258is replaced by the type name.
259For example, nfs filesystems are mounted by the program
260.Pa /sbin/mount_nfs .
261.Pp
262Most filesystems will be dynamically loaded by their mount programs
263if not already present in the kernel, using the
264.Xr vfsload 3
265subroutine. Because this mechanism requires writable temporary space,
266the filesystem type containing
267.Pa /tmp
268must be compiled into the kernel, and the filesystems containing
269.Pa /tmp
270and
271.Pa /usr/bin/ld
272must be listed in
273.Pa /etc/fstab
274before any filesystems which might be dynamically loaded.
275.It Fl u
276The
277.Fl u
278flag indicates that the status of an already mounted file
279system should be changed.
280Any of the options discussed above (the
281.Fl o
282option)
283may be changed;
284also a file system can be changed from read-only to read-write
285or vice versa.
286An attempt to change from read-write to read-only will fail if any
287files on the filesystem are currently open for writing unless the
288.Fl f
289flag is also specified.
290The set of options is determined by first extracting the options
291for the file system from the
292.Xr fstab 5
293table,
294then applying any options specified by the
295.Fl o
296argument,
297and finally applying the
298.Fl r
299or
300.Fl w
301option.
302.It Fl v
303Verbose mode.
304.It Fl w
305The file system object is to be read and write.
306.Pp
307The options specific to NFS filesystems are described in the
308.Xr mount_nfs 8
309manual page.
310.Sh DIAGNOSTICS
311Various, most of them are self-explanatory.
312.Pp
313.Dl XXXXX filesystem is not available
314.Pp
315The kernel doesn't support the respective filesystem type. Note that
316support for a particular filesystem might be provided either on a static
317(kernel compile-time), or dynamic basis (loaded as a kernel module by
318.Xr modload 8 ).
319Normally,
320.Nm
321or its subprocesses attempt to dynamically load a filesystem module if
322it hasn't been configured statically, using
323.Xr vfsload 3 .
324In this case, the above error message can also mean that you didn't
325have permission to load the module.
326.Sh FILES
327.Bl -tag -width /etc/fstab -compact
328.It Pa /etc/fstab
329file system table
330.El
331.Sh SEE ALSO
332.Xr mount 2 ,
333.Xr vfsload 3 ,
334.Xr fstab 5 ,
335.Xr mount_cd9660 8 ,
336.Xr mount_devfs 8 ,
337.Xr mount_fdesc 8 ,
338.Xr mount_kernfs 8 ,
339.Xr mount_lfs 8 ,
340.Xr mount_mfs 8 ,
341.Xr mount_msdos 8 ,
342.Xr mount_nfs 8 ,
343.Xr mount_null 8 ,
344.Xr mount_portal 8 ,
345.Xr mount_procfs 8 ,
346.Xr mount_umap 8 ,
347.Xr mount_union 8 ,
348.Xr umount 8
349.Sh BUGS
350It is possible for a corrupted file system to cause a crash.
351.Sh HISTORY
352A
353.Nm
354command appeared in
355.At v1 .