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