xref: /dragonfly/sbin/mount_ufs/mount_ufs.8 (revision 25a2db75)
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.\" $FreeBSD: src/sbin/mount/mount.8,v 1.31.2.12 2003/02/23 21:17:42 trhodes Exp $
34.\"
35.Dd October 7, 2011
36.Dt MOUNT_UFS 8
37.Os
38.Sh NAME
39.Nm mount_ufs
40.Nd mount file systems
41.Sh SYNOPSIS
42.Nm
43.Op Fl adfpruvw
44.Op Fl F Ar fstab
45.Op Fl o Ar options
46.Op Fl t Ar type
47.Nm
48.Op Fl dfpruvw
49.Brq Ar special | node
50.Nm
51.Op Fl dfpruvw
52.Op Fl o Ar options
53.Op Fl t Ar type
54.Ar special node
55.Sh DESCRIPTION
56The
57.Nm
58utility calls the
59.Xr mount 2
60system call to prepare and graft a
61.Ar "special device"
62or the remote node (rhost:path) on to the file system tree at the point
63.Ar node .
64If either
65.Ar special
66or
67.Ar node
68are not provided, the appropriate information is taken from the
69.Xr fstab 5
70file.
71.Pp
72The system maintains a list of currently mounted file systems.
73If no arguments are given to
74.Nm ,
75this list is printed.
76.Pp
77The options are as follows:
78.Bl -tag -width indent
79.It Fl a
80All the filesystems described in
81.Xr fstab 5
82are mounted.
83Exceptions are those marked as
84.Dq noauto ,
85excluded by the
86.Fl t
87flag (see below), or if they are already mounted (except the
88root filesystem which is always remounted to preserve
89traditional single user mode behavior).
90.It Fl d
91Causes everything to be done except for the actual system call.
92This option is useful in conjunction with the
93.Fl v
94flag to
95determine what the
96.Nm
97command is trying to do.
98.It Fl F Ar fstab
99Specify the
100.Pa fstab
101file to use.
102.It Fl f
103Forces the revocation of write access when trying to downgrade
104a filesystem mount status from read-write to read-only.
105Also
106forces the R/W mount of an unclean filesystem (dangerous; use with
107caution).
108.It Fl o
109Options are specified with a
110.Fl o
111flag followed by a comma separated string of options.
112If a
113.Dq no
114prefix is added or removed from a option name, then meaning is negated.
115In case of conflicting options being specified, the rightmost option
116takes effect.
117The following options are available:
118.Bl -tag -width indent
119.It Cm async
120All
121.Tn I/O
122to the file system should be done asynchronously.
123This is a
124.Em dangerous
125flag to set,
126and should not be used unless you are prepared to recreate the file
127system should your system crash.
128.It Cm current
129When used with the
130.Fl u
131flag, this is the same as specifying the options currently in effect for
132the mounted filesystem.
133.It Cm force
134The same as
135.Fl f ;
136forces the revocation of write access when trying to downgrade
137a filesystem mount status from read-write to read-only.
138Also
139forces the R/W mount of an unclean filesystem (dangerous; use with caution).
140.It Cm fstab
141When used with the
142.Fl u
143flag, this is the same as specifying all the options listed in the
144.Xr fstab 5
145file for the filesystem.
146.It Cm noasync
147Metadata I/O should be done synchronously, while data I/O should be done
148asynchronously.
149This is the default.
150.It Cm noatime
151Do not update the file access time when reading from a file.
152This option
153is useful on filesystems where there are large numbers of files and
154performance is more critical than updating the file access time (which is
155rarely ever important).
156This option is currently only supported on local filesystems.
157.It Cm noauto
158This filesystem should be skipped when
159.Nm
160is run with the
161.Fl a
162flag.
163.It Cm noclusterr
164Disable read clustering.
165.It Cm noclusterw
166Disable write clustering.
167.It Cm nodev
168Do not interpret character or block special devices on the file system.
169This option is useful for a server that has file systems containing
170special devices for architectures other than its own.
171This option is set automatically when the user does not have super-user
172privileges.
173.It Cm noexec
174Do not allow execution of any binaries on the mounted file system.
175This option is useful for a server that has file systems containing
176binaries for architectures other than its own.
177.It Cm nosuid
178Do not allow set-user-identifier or set-group-identifier bits to take effect.
179Note: this option is worthless if a public available suid or sgid
180wrapper like
181.Xr suidperl 1
182is installed on your system.
183It is set automatically when the user does not have super-user privileges.
184.It Cm nosymfollow
185Do not follow symlinks
186on the mounted file system.
187.It Cm rdonly , ro , norw
188The same as
189.Fl r ;
190mount the file system read-only (even the super-user may not write it).
191.It Cm sync
192All
193.Tn I/O
194to the file system should be done synchronously.
195.It Cm trim
196If the device supports TRIM
197.Va ( kern.cam.da.X.trim_enabled
198exists) and is set,
199the file system will perform online trim for corresponding block deletions.
200Currently, only
201.Xr UFS 5
202supports this feature.
203.It Cm suiddir
204A directory on the mounted filesystem will respond to the SUID bit
205being set, by setting the owner of any new files to be the same
206as the owner of the directory.
207New directories will inherit the bit from their parents.
208Execute bits are removed from
209the file, and it will not be given to root.
210.Pp
211This feature is designed for use on fileservers serving PC users via
212ftp or SAMBA.
213It provides security holes for shell users and as
214such should not be used on shell machines, especially on home directories.
215This option requires the SUIDDIR
216option in the kernel to work.
217Only
218.Xr UFS 5
219filesystems support this option.
220See
221.Xr chmod 2
222for more information.
223.It Cm update
224The same as
225.Fl u ;
226indicate that the status of an already mounted file system should be changed.
227.It Cm union
228Causes the namespace at the mount point to appear as the union
229of the mounted filesystem root and the existing directory.
230Lookups will be done in the mounted filesystem first.
231If those operations fail due to a non-existent file the underlying
232directory is then accessed.
233All creates are done in the mounted filesystem.
234.It Cm ignore
235Will be ignored by
236.Xr df 1 .
237.El
238.Pp
239Any additional options specific to a filesystem type that is not
240one of the internally known types (see the
241.Fl t
242option) may be passed as a comma separated list; these options are
243distinguished by a leading
244.Dq \&-
245(dash).
246Options that take a value are specified using the syntax -option=value.
247For example, the
248.Nm
249command:
250.Bd -literal -offset indent
251mount -t mfs -o nosuid,-N,-s=4000 /dev/da0s0b /tmp
252.Ed
253.Pp
254causes
255.Nm
256to execute the equivalent of:
257.Bd -literal -offset indent
258/sbin/mount_mfs -o nosuid -N -s 4000 /dev/da0s0b /tmp
259.Ed
260.Pp
261Additional options specific to filesystem types
262which are not internally known
263(see the description of the
264.Fl t
265option below)
266may be described in the manual pages for the associated
267.Pa /sbin/mount_ Ns Sy XXX
268utilities.
269.It Fl p
270Print mount information in
271.Xr fstab 5
272format.
273If fstab is missing or if the freq and passno fields are omitted,
274the default values as described in
275.Xr fstab 5
276are used.
277Implies also the
278.Fl v
279option.
280.It Fl r
281The file system is to be mounted read-only.
282Mount the file system read-only (even the super-user may not write it).
283The same as the
284.Cm rdonly
285argument to the
286.Fl o
287option.
288.It Fl t Ar type
289The argument following the
290.Fl t
291is used to indicate the file system type.
292The type
293.Cm ufs
294is the default.
295The
296.Fl t
297option can be used
298to indicate that the actions should only be taken on
299filesystems of the specified type.
300More than one type may be specified in a comma separated list.
301The list of filesystem types can be prefixed with
302.Dq no
303to specify the filesystem types for which action should
304.Em not
305be taken.
306For example, the
307.Nm
308command:
309.Bd -literal -offset indent
310mount -a -t nonfs,mfs
311.Ed
312.Pp
313mounts all filesystems except those of type
314.Tn NFS
315and
316.Tn MFS .
317.Pp
318If the type is not the internally known type,
319.Cm ufs ,
320.Nm
321will attempt to execute a program in
322.Pa /sbin/mount_ Ns Sy XXX
323where
324.Sy XXX
325is replaced by the type name.
326For example, nfs filesystems are mounted by the program
327.Pa /sbin/mount_nfs .
328.Pp
329Most filesystems will be dynamically loaded by their
330.Nm
331programs
332if not already present in the kernel, using the
333.Xr vfsload 3
334subroutine.
335Because this mechanism requires writable temporary space,
336the filesystem type containing
337.Pa /tmp
338must be compiled into the kernel, and the filesystems containing
339.Pa /tmp
340and
341.Pa /usr/bin/ld
342must be listed in
343.Pa /etc/fstab
344before any filesystems which might be dynamically loaded.
345.It Fl u
346The
347.Fl u
348flag indicates that the status of an already mounted file
349system should be changed.
350Any of the options discussed above (the
351.Fl o
352option)
353may be changed;
354also a file system can be changed from read-only to read-write
355or vice versa.
356An attempt to change from read-write to read-only will fail if any
357files on the filesystem are currently open for writing unless the
358.Fl f
359flag is also specified.
360The set of options is determined by applying the options specified
361in the argument to
362.Fl o
363and finally applying the
364.Fl r
365or
366.Fl w
367option.
368.It Fl v
369Verbose mode.
370.It Fl w
371The file system object is to be read and write.
372.El
373.Sh ENVIRONMENT
374.Bl -tag -width PATH_FSTAB
375.It Pa PATH_FSTAB
376If the environment variable
377.Pa PATH_FSTAB
378is set all operations are performed against the specified file.
379.El
380.Sh FILES
381.Bl -tag -width /etc/fstab -compact
382.It Pa /etc/fstab
383file system table
384.El
385.Sh DIAGNOSTICS
386Various, most of them are self-explanatory.
387.Pp
388.Dl XXXXX filesystem is not available
389.Pp
390The kernel does not support the respective filesystem type.
391Note that
392support for a particular filesystem might be provided either on a static
393(kernel compile-time), or dynamic basis (loaded as a kernel module by
394.Xr kldload 8 ) .
395Normally,
396.Nm
397or its subprocesses attempt to dynamically load a filesystem module if
398it has not been configured statically, using
399.Xr vfsload 3 .
400In this case, the above error message can also mean that you did not
401have permission to load the module.
402.Sh SEE ALSO
403.Xr df 1 ,
404.Xr lsvfs 1 ,
405.Xr mount 2 ,
406.Xr vfsload 3 ,
407.Xr devtab 5 ,
408.Xr fstab 5 ,
409.Xr UFS 5 ,
410.Xr kldload 8 ,
411.Xr mount_cd9660 8 ,
412.Xr mount_devfs 8 ,
413.Xr mount_ext2fs 8 ,
414.Xr mount_fdesc 8 ,
415.Xr mount_hammer 8 ,
416.Xr mount_hpfs 8 ,
417.Xr mount_linprocfs 8 ,
418.Xr mount_mfs 8 ,
419.Xr mount_msdos 8 ,
420.Xr mount_nfs 8 ,
421.Xr mount_ntfs 8 ,
422.Xr mount_null 8 ,
423.Xr mount_nwfs 8 ,
424.Xr mount_portal 8 ,
425.Xr mount_procfs 8 ,
426.Xr mount_smbfs 8 ,
427.Xr mount_std 8 ,
428.Xr mount_tmpfs 8 ,
429.Xr mount_udf 8 ,
430.Xr mount_union 8 ,
431.Xr sysctl 8 ,
432.Xr umount 8
433.Sh HISTORY
434A
435.Nm
436utility appeared in
437.At v1 .
438.Sh CAVEATS
439After a successful
440.Nm ,
441the permissions on the original mount point determine if
442.Pa ..\&
443is accessible from the mounted file system.
444The minimum permissions for
445the mount point for traversal across the mount point in both
446directions to be possible for all users is 0111 (execute for all).
447.Sh BUGS
448It is possible for a corrupted file system to cause a crash.
449