1 .\" Copyright (c) 1980, 1989, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
32 .\" @(#)mount.2 8.3 (Berkeley) 5/24/95
33 .\" $FreeBSD: src/lib/libc/sys/mount.2,v 1.20.2.8 2003/01/17 22:02:42 joerg Exp $
34 .\" $DragonFly: src/lib/libc/sys/mount.2,v 1.4 2007/07/14 21:48:15 swildner Exp $
42 .Nd mount or dismount a filesystem
49 .Fn mount "const char *type" "const char *dir" "int flags" "void *data"
51 .Fn unmount "const char *dir" "int flags"
56 a filesystem object onto the system file tree
61 describes the filesystem object to be mounted.
64 tells the kernel how to interpret
69 The contents of the filesystem
70 become available through the new mount point
75 of a successful mount are swept under the carpet so to speak, and
76 are unavailable until the filesystem is unmounted.
78 By default only the super-user may call the
81 This restriction can be removed by setting the sysctl
88 suppress default semantics which affect filesystem access.
89 .Bl -tag -width MNT_SYNCHRONOUS
91 The filesystem should be treated as read-only;
92 Even the super-user may not write on it.
93 Specifying MNT_UPDATE without this option will upgrade
94 a read-only filesystem to read/write.
96 Do not allow files to be executed from the filesystem.
98 Do not honor setuid or setgid bits on files when executing them.
99 This flag is set automatically when the caller is not the super-user.
101 Disable update of file access times.
103 Do not interpret special files on the filesystem.
104 This flag is set automatically when the caller is not the super-user.
106 Directories with the SUID bit set chown new files to their own owner.
107 .It Dv MNT_SYNCHRONOUS
108 All I/O to the filesystem should be done synchronously.
110 All I/O to the filesystem should be done asynchronously.
112 Force a read-write mount even if the filesystem appears to be unclean.
114 .It Dv MNT_NOCLUSTERR
115 Disable read clustering.
116 .It Dv MNT_NOCLUSTERW
117 Disable write clustering.
122 indicates that the mount command is being applied
123 to an already mounted filesystem.
124 This allows the mount flags to be changed without requiring
125 that the filesystem be unmounted and remounted.
126 Some filesystems may not allow all flags to be changed.
128 many filesystems will not allow a change from read-write to read-only.
132 causes the vfs subsystem to update its data structures pertaining to
133 the specified already mounted filesystem.
137 argument names the filesystem.
138 The types of filesystems known to the system can be obtained with
142 is a pointer to a structure that contains the type
143 specific arguments to mount.
144 The format for these argument structures is described in the
145 manual page for each filesystem.
146 By convention filesystem manual pages are named
147 by prefixing ``mount_'' to the name of the filesystem as returned by
151 filesystem is described by the
157 function call disassociates the filesystem from the specified
165 to specify that the filesystem should be forcibly unmounted or made read-only
166 (if MNT_UPDATE and MNT_RDONLY are also specified)
167 even if files are still active.
168 Active special devices continue to work,
169 but any further accesses to any other active files result in errors
170 even if the filesystem is later remounted.
174 option requires the SUIDDIR option to have been compiled into the kernel
180 pages for more information.
186 function will fail when one of the following occurs:
189 The caller is neither the super-user nor the owner of
191 .It Bq Er ENAMETOOLONG
192 A component of a pathname exceeded 255 characters,
193 or the entire length of a path name exceeded 1023 characters.
195 Too many symbolic links were encountered in translating a pathname.
208 Another process currently holds a reference to
212 points outside the process's allocated address space.
215 The following errors can occur for a
220 A component of ufs_args
225 is not a block device.
227 The major device number of
229 is out of range (this indicates no device driver exists
230 for the associated hardware).
235 No space remains in the mount table.
237 The super block for the filesystem had a bad magic
238 number or an out of range block size.
240 Not enough memory was available to read the cylinder
241 group information for the filesystem.
243 An I/O error occurred while reading the super block or
244 cylinder group information.
247 points outside the process's allocated address space.
250 The following errors can occur for a
256 timed out trying to contact the server.
258 Some part of the information described by nfs_args
259 points outside the process's allocated address space.
262 The following errors can occur for a
267 No space remains in the mount table.
269 The super block for the filesystem had a bad magic
270 number or an out of range block size.
272 Not enough memory was available to read the cylinder
273 group information for the filesystem.
275 A paging error occurred while reading the super block or
276 cylinder group information.
279 points outside the process's allocated address space.
284 function may fail with one of the following errors:
287 The caller is neither the super-user nor the user who issued the corresponding
291 A component of the path is not a directory.
292 .It Bq Er ENAMETOOLONG
293 A component of a pathname exceeded 255 characters,
294 or an entire path name exceeded 1023 characters.
296 Too many symbolic links were encountered in translating the pathname.
298 The requested directory is not in the mount table.
300 A process is holding a reference to a file located
303 An I/O error occurred while writing cached filesystem information.
306 points outside the process's allocated address space.
313 mount can also fail if the maximum number of filesystems are currently
325 function calls appeared in
328 Some of the error codes need translation to more obvious messages.