xref: /freebsd/sbin/mount/mount.8 (revision c783576970fd40b22705bda102c03976d78badd2)
18fae3551SRodney W. Grimes.\" Copyright (c) 1980, 1989, 1991, 1993
28fae3551SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
38fae3551SRodney W. Grimes.\"
48fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
58fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions
68fae3551SRodney W. Grimes.\" are met:
78fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
88fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
98fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
108fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
118fae3551SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
128fae3551SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
138fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
148fae3551SRodney W. Grimes.\"    without specific prior written permission.
158fae3551SRodney W. Grimes.\"
168fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
178fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
188fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
198fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
208fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
218fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
228fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
238fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
248fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
258fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
268fae3551SRodney W. Grimes.\" SUCH DAMAGE.
278fae3551SRodney W. Grimes.\"
28c06fe0a0SPeter Wemm.\"     @(#)mount.8	8.8 (Berkeley) 6/16/94
297f3dea24SPeter Wemm.\" $FreeBSD$
308fae3551SRodney W. Grimes.\"
313592acb1STom McLaughlin.Dd March 11, 2008
328fae3551SRodney W. Grimes.Dt MOUNT 8
339fe48c6eSRuslan Ermilov.Os
348fae3551SRodney W. Grimes.Sh NAME
358fae3551SRodney W. Grimes.Nm mount
368fae3551SRodney W. Grimes.Nd mount file systems
378fae3551SRodney W. Grimes.Sh SYNOPSIS
387c7fb079SRuslan Ermilov.Nm
394b4f9170SDag-Erling Smørgrav.Op Fl adflpruvw
40ef258dd9SMatthew N. Dodd.Op Fl F Ar fstab
41c14d21f6SGuido van Rooij.Op Fl o Ar options
428266d476SRuslan Ermilov.Op Fl t Cm ufs | Ar external_type
437c7fb079SRuslan Ermilov.Nm
44a257a45eSJordan K. Hubbard.Op Fl dfpruvw
458fae3551SRodney W. Grimes.Ar special | node
467c7fb079SRuslan Ermilov.Nm
47a257a45eSJordan K. Hubbard.Op Fl dfpruvw
488fae3551SRodney W. Grimes.Op Fl o Ar options
498266d476SRuslan Ermilov.Op Fl t Cm ufs | Ar external_type
508fae3551SRodney W. Grimes.Ar special node
518fae3551SRodney W. Grimes.Sh DESCRIPTION
528fae3551SRodney W. GrimesThe
53951122deSSteve Price.Nm
54e1205e80SPhilippe Charnierutility calls the
557c5347aeSCraig Rodrigues.Xr nmount 2
568fae3551SRodney W. Grimessystem call to prepare and graft a
578266d476SRuslan Ermilov.Ar special
588266d476SRuslan Ermilovdevice or the remote node (rhost:path) on to the file system tree at the point
598fae3551SRodney W. Grimes.Ar node .
608fae3551SRodney W. GrimesIf either
618fae3551SRodney W. Grimes.Ar special
628fae3551SRodney W. Grimesor
638fae3551SRodney W. Grimes.Ar node
648fae3551SRodney W. Grimesare not provided, the appropriate information is taken from the
658fae3551SRodney W. Grimes.Xr fstab 5
668fae3551SRodney W. Grimesfile.
678fae3551SRodney W. Grimes.Pp
688fae3551SRodney W. GrimesThe system maintains a list of currently mounted file systems.
698fae3551SRodney W. GrimesIf no arguments are given to
707c7fb079SRuslan Ermilov.Nm ,
718fae3551SRodney W. Grimesthis list is printed.
728fae3551SRodney W. Grimes.Pp
738fae3551SRodney W. GrimesThe options are as follows:
748fae3551SRodney W. Grimes.Bl -tag -width indent
75c4e95187SDavid Greenman.It Fl a
76c06fe0a0SPeter WemmAll the file systems described in
77c06fe0a0SPeter Wemm.Xr fstab 5
78c06fe0a0SPeter Wemmare mounted.
797f804728SRuslan ErmilovExceptions are those marked as
808266d476SRuslan Ermilov.Dq Li noauto ,
814b4f9170SDag-Erling Smørgravthose marked as
828266d476SRuslan Ermilov.Dq Li late
834b4f9170SDag-Erling Smørgrav(unless the
844b4f9170SDag-Erling Smørgrav.Fl l
854b4f9170SDag-Erling Smørgravoption was specified),
864b4f9170SDag-Erling Smørgravthose excluded by the
87c06fe0a0SPeter Wemm.Fl t
88fba1c154SSteve Priceflag (see below), or if they are already mounted (except the
89fba1c154SSteve Priceroot file system which is always remounted to preserve
90fba1c154SSteve Pricetraditional single user mode behavior).
918fae3551SRodney W. Grimes.It Fl d
928fae3551SRodney W. GrimesCauses everything to be done except for the actual system call.
938fae3551SRodney W. GrimesThis option is useful in conjunction with the
948fae3551SRodney W. Grimes.Fl v
958fae3551SRodney W. Grimesflag to
968fae3551SRodney W. Grimesdetermine what the
97951122deSSteve Price.Nm
988fae3551SRodney W. Grimescommand is trying to do.
99ef258dd9SMatthew N. Dodd.It Fl F Ar fstab
100ef258dd9SMatthew N. DoddSpecify the
101ef258dd9SMatthew N. Dodd.Pa fstab
102ef258dd9SMatthew N. Doddfile to use.
1038fae3551SRodney W. Grimes.It Fl f
1048fae3551SRodney W. GrimesForces the revocation of write access when trying to downgrade
105ef8f7ac9SSheldon Hearna file system mount status from read-write to read-only.
106ef8f7ac9SSheldon HearnAlso
1071469eec8SDavid Greenmanforces the R/W mount of an unclean file system (dangerous; use with
1081469eec8SDavid Greenmancaution).
1094b4f9170SDag-Erling Smørgrav.It Fl l
1104b4f9170SDag-Erling SmørgravWhen used in conjunction with the
1114b4f9170SDag-Erling Smørgrav.Fl a
1124b4f9170SDag-Erling Smørgravoption, also mount those file systems which are marked as
1138266d476SRuslan Ermilov.Dq Li late .
1148fae3551SRodney W. Grimes.It Fl o
1158fae3551SRodney W. GrimesOptions are specified with a
1168fae3551SRodney W. Grimes.Fl o
1178fae3551SRodney W. Grimesflag followed by a comma separated string of options.
11818af6044SJoseph KoshyIn case of conflicting options being specified, the rightmost option
11918af6044SJoseph Koshytakes effect.
1208fae3551SRodney W. GrimesThe following options are available:
1218fae3551SRodney W. Grimes.Bl -tag -width indent
122f00a5dbdSTom Rhodes.It Cm acls
123f00a5dbdSTom RhodesEnable Access Control Lists, or ACLS, which can be customized via the
124f00a5dbdSTom Rhodes.Xr setfacl 1
125f00a5dbdSTom Rhodesand
126f00a5dbdSTom Rhodes.Xr getfacl 1
127f00a5dbdSTom Rhodescommands.
1287f804728SRuslan Ermilov.It Cm async
1298fae3551SRodney W. GrimesAll
1308fae3551SRodney W. Grimes.Tn I/O
1318fae3551SRodney W. Grimesto the file system should be done asynchronously.
1328fae3551SRodney W. GrimesThis is a
1338fae3551SRodney W. Grimes.Em dangerous
134d6649c25SDaniel Gerzoflag to set, since it does not guarantee that the file system structure
135d6649c25SDaniel Gerzoon the disk will remain consistent.
136d6649c25SDaniel GerzoFor this reason, the
137d6649c25SDaniel Gerzo.Cm async
138d6649c25SDaniel Gerzoflag should be used sparingly, and only when some data recovery
139d6649c25SDaniel Gerzomechanism is present.
1407f804728SRuslan Ermilov.It Cm current
14118af6044SJoseph KoshyWhen used with the
14218af6044SJoseph Koshy.Fl u
14318af6044SJoseph Koshyflag, this is the same as specifying the options currently in effect for
14418af6044SJoseph Koshythe mounted file system.
1457f804728SRuslan Ermilov.It Cm force
1468fae3551SRodney W. GrimesThe same as
1478fae3551SRodney W. Grimes.Fl f ;
1488fae3551SRodney W. Grimesforces the revocation of write access when trying to downgrade
149ef8f7ac9SSheldon Hearna file system mount status from read-write to read-only.
150ef8f7ac9SSheldon HearnAlso
1511469eec8SDavid Greenmanforces the R/W mount of an unclean file system (dangerous; use with caution).
1527f804728SRuslan Ermilov.It Cm fstab
15318af6044SJoseph KoshyWhen used with the
15418af6044SJoseph Koshy.Fl u
15518af6044SJoseph Koshyflag, this is the same as specifying all the options listed in the
15618af6044SJoseph Koshy.Xr fstab 5
15718af6044SJoseph Koshyfile for the file system.
1584b4f9170SDag-Erling Smørgrav.It Cm late
1594b4f9170SDag-Erling SmørgravThis file system should be skipped when
16074109472SDag-Erling Smørgrav.Nm
16174109472SDag-Erling Smørgravis run with the
1624b4f9170SDag-Erling Smørgrav.Fl a
1634b4f9170SDag-Erling Smørgravflag but without the
1644b4f9170SDag-Erling Smørgrav.Fl l
1654b4f9170SDag-Erling Smørgravflag.
166c7835769SCraig Rodrigues.It Cm mountprog Ns = Ns Aq Ar program
167c7835769SCraig RodriguesForce
168c7835769SCraig Rodrigues.Nm
169c7835769SCraig Rodriguesto use the specified program to mount the file system, instead of calling
170c7835769SCraig Rodrigues.Xr nmount 2
171c7835769SCraig Rodriguesdirectly.  For example:
172c7835769SCraig Rodrigues.Bd -literal
173c7835769SCraig Rodriguesmount -t foofs -o mountprog=/mydir/fooprog /dev/acd0 /mnt
174c7835769SCraig Rodrigues.Ed
175f00a5dbdSTom Rhodes.It Cm multilabel
17690b9e3f1SRobert WatsonEnable multi-label Mandatory Access Control, or MAC, on the specified file
17790b9e3f1SRobert Watsonsystem.
17890b9e3f1SRobert WatsonIf the file system supports multilabel operation, individual labels will
17990b9e3f1SRobert Watsonbe maintained for each object in the file system, rather than using a
1808e5c1e59SJosef El-Rayessingle label for all objects.
181d04b5dfeSRuslan ErmilovAn alternative to the
182d04b5dfeSRuslan Ermilov.Fl l
183f00a5dbdSTom Rhodesflag in
184f00a5dbdSTom Rhodes.Xr tunefs 8 .
185f00a5dbdSTom RhodesSee
186f00a5dbdSTom Rhodes.Xr mac 4
18790b9e3f1SRobert Watsonfor more information, which cause the multilabel mount flag to be set
18890b9e3f1SRobert Watsonautomatically at mount-time.
1897f804728SRuslan Ermilov.It Cm noasync
190534e0080SDavid E. O'BrienMetadata I/O should be done synchronously, while data I/O should be done
1917f804728SRuslan Ermilovasynchronously.
1927f804728SRuslan ErmilovThis is the default.
1937f804728SRuslan Ermilov.It Cm noatime
194ef8f7ac9SSheldon HearnDo not update the file access time when reading from a file.
195ef8f7ac9SSheldon HearnThis option
196fa947154SDavid Greenmanis useful on file systems where there are large numbers of files and
197fa947154SDavid Greenmanperformance is more critical than updating the file access time (which is
1987f804728SRuslan Ermilovrarely ever important).
1997f804728SRuslan ErmilovThis option is currently only supported on local file systems.
2007f804728SRuslan Ermilov.It Cm noauto
2017f804728SRuslan ErmilovThis file system should be skipped when
2027f804728SRuslan Ermilov.Nm
2037f804728SRuslan Ermilovis run with the
204c06fe0a0SPeter Wemm.Fl a
205c06fe0a0SPeter Wemmflag.
2067f804728SRuslan Ermilov.It Cm noclusterr
20775b714acSKATO TakenoriDisable read clustering.
2087f804728SRuslan Ermilov.It Cm noclusterw
20975b714acSKATO TakenoriDisable write clustering.
2107f804728SRuslan Ermilov.It Cm noexec
2118fae3551SRodney W. GrimesDo not allow execution of any binaries on the mounted file system.
2128fae3551SRodney W. GrimesThis option is useful for a server that has file systems containing
2138fae3551SRodney W. Grimesbinaries for architectures other than its own.
21418a3dd1eSColin PercivalNote: This option was not designed as a security feature and no
21518a3dd1eSColin Percivalguarantee is made that it will prevent malicious code execution; for
21618a3dd1eSColin Percivalexample, it is still possible to execute scripts which reside on a
21718a3dd1eSColin Percival.Cm noexec
21818a3dd1eSColin Percivalmounted partition.
2197f804728SRuslan Ermilov.It Cm nosuid
2208fae3551SRodney W. GrimesDo not allow set-user-identifier or set-group-identifier bits to take effect.
221b23472acSWolfram SchneiderNote: this option is worthless if a public available suid or sgid
222b23472acSWolfram Schneiderwrapper like
223951122deSSteve Price.Xr suidperl 1
224b23472acSWolfram Schneideris installed on your system.
225b4206324SJoerg WunschIt is set automatically when the user does not have super-user privileges.
2267f804728SRuslan Ermilov.It Cm nosymfollow
2275ddc8dedSWolfram SchneiderDo not follow symlinks
2285ddc8dedSWolfram Schneideron the mounted file system.
229c80f12d0SSean Chittenden.It Cm ro
2308fae3551SRodney W. GrimesThe same as
2318fae3551SRodney W. Grimes.Fl r ;
2328fae3551SRodney W. Grimesmount the file system read-only (even the super-user may not write it).
233299f1561STom Rhodes.It Cm snapshot
234299f1561STom RhodesThis option allows a snapshot of the specified file system to be taken.
235299f1561STom RhodesThe
236299f1561STom Rhodes.Fl u
237299f1561STom Rhodesflag is required with this option.
238299f1561STom RhodesNote that snapshot files must be created in the file system that is being
239299f1561STom Rhodessnapshotted.
240299f1561STom RhodesYou may create up to 20 snapshots per file system.
241299f1561STom RhodesActive snapshots are recorded in the superblock, so they persist across unmount
242299f1561STom Rhodesand remount operations and across system reboots.
243299f1561STom RhodesWhen you are done with a snapshot, it can be removed with the
2449acd9d01SRuslan Ermilov.Xr rm 1
245299f1561STom Rhodescommand.
246299f1561STom RhodesSnapshots may be removed in any order, however you may not get back all the
247299f1561STom Rhodesspace contained in the snapshot as another snapshot may claim some of the blocks
248299f1561STom Rhodesthat it is releasing.
249299f1561STom RhodesNote that the schg flag is set on snapshots to ensure that not even the root
250299f1561STom Rhodesuser can write to them.
251299f1561STom RhodesThe unlink command makes an exception for snapshot files in that it allows them
252299f1561STom Rhodesto be removed even though they have the schg flag set, so it is not necessary to
253299f1561STom Rhodesclear the schg flag before removing a snapshot file.
254299f1561STom Rhodes.Pp
255299f1561STom RhodesOnce you have taken a snapshot, there are three interesting things that you can
256299f1561STom Rhodesdo with it:
257299f1561STom Rhodes.Pp
258299f1561STom Rhodes.Bl -enum -compact
259299f1561STom Rhodes.It
2609acd9d01SRuslan ErmilovRun
2619acd9d01SRuslan Ermilov.Xr fsck 8
2629acd9d01SRuslan Ermilovon the snapshot file.
263299f1561STom RhodesAssuming that the file system was clean when it was mounted, you should always
264299f1561STom Rhodesget a clean (and unchanging) result from running fsck on the snapshot.
265299f1561STom RhodesThis is essentially what the background fsck process does.
266299f1561STom Rhodes.Pp
267299f1561STom Rhodes.It
2689acd9d01SRuslan ErmilovRun
2699acd9d01SRuslan Ermilov.Xr dump 8
2709acd9d01SRuslan Ermilovon the snapshot.
271299f1561STom RhodesYou will get a dump that is consistent with the file system as of the timestamp
272299f1561STom Rhodesof the snapshot.
273299f1561STom Rhodes.Pp
274299f1561STom Rhodes.It
275299f1561STom RhodesMount the snapshot as a frozen image of the file system.
276299f1561STom RhodesTo mount the snapshot
277299f1561STom Rhodes.Pa /var/snapshot/snap1 :
278299f1561STom Rhodes.Bd -literal
279299f1561STom Rhodesmdconfig -a -t vnode -f /var/snapshot/snap1 -u 4
280299f1561STom Rhodesmount -r /dev/md4 /mnt
281299f1561STom Rhodes.Ed
282299f1561STom Rhodes.Pp
283299f1561STom RhodesYou can now cruise around your frozen
284299f1561STom Rhodes.Pa /var
285299f1561STom Rhodesfile system at
286299f1561STom Rhodes.Pa /mnt .
287299f1561STom RhodesEverything will be in the same state that it was at the time the snapshot was
288299f1561STom Rhodestaken.
289299f1561STom RhodesThe one exception is that any earlier snapshots will appear as zero length
290299f1561STom Rhodesfiles.
291299f1561STom RhodesWhen you are done with the mounted snapshot:
292299f1561STom Rhodes.Bd -literal
293299f1561STom Rhodesumount /mnt
294299f1561STom Rhodesmdconfig -d -u 4
295299f1561STom Rhodes.Ed
296299f1561STom Rhodes.Pp
297299f1561STom RhodesFurther details can be found in the file at
298299f1561STom Rhodes.Pa /usr/src/sys/ufs/ffs/README.snapshot .
299299f1561STom Rhodes.El
3007f804728SRuslan Ermilov.It Cm suiddir
30152bf64c7SJulian ElischerA directory on the mounted file system will respond to the SUID bit
30252bf64c7SJulian Elischerbeing set, by setting the owner of any new files to be the same
30352bf64c7SJulian Elischeras the owner of the directory.
30452bf64c7SJulian ElischerNew directories will inherit the bit from their parents.
30552bf64c7SJulian ElischerExecute bits are removed from
30652bf64c7SJulian Elischerthe file, and it will not be given to root.
30752bf64c7SJulian Elischer.Pp
30852bf64c7SJulian ElischerThis feature is designed for use on fileservers serving PC users via
309ef8f7ac9SSheldon Hearnftp, SAMBA, or netatalk.
310ef8f7ac9SSheldon HearnIt provides security holes for shell users and as
31152bf64c7SJulian Elischersuch should not be used on shell machines, especially on home directories.
31252bf64c7SJulian ElischerThis option requires the SUIDDIR
313ef8f7ac9SSheldon Hearnoption in the kernel to work.
314ef8f7ac9SSheldon HearnOnly UFS file systems support this option.
31552bf64c7SJulian ElischerSee
31652bf64c7SJulian Elischer.Xr chmod 2
31752bf64c7SJulian Elischerfor more information.
318ef37e89dSJohn Baldwin.It Cm sync
319ef37e89dSJohn BaldwinAll
320ef37e89dSJohn Baldwin.Tn I/O
321ef37e89dSJohn Baldwinto the file system should be done synchronously.
3227f804728SRuslan Ermilov.It Cm update
3238fae3551SRodney W. GrimesThe same as
3248fae3551SRodney W. Grimes.Fl u ;
3258fae3551SRodney W. Grimesindicate that the status of an already mounted file system should be changed.
3267f804728SRuslan Ermilov.It Cm union
3278fae3551SRodney W. GrimesCauses the namespace at the mount point to appear as the union
3288fae3551SRodney W. Grimesof the mounted file system root and the existing directory.
3298fae3551SRodney W. GrimesLookups will be done in the mounted file system first.
3308fae3551SRodney W. GrimesIf those operations fail due to a non-existent file the underlying
3318fae3551SRodney W. Grimesdirectory is then accessed.
3328fae3551SRodney W. GrimesAll creates are done in the mounted file system.
3338fae3551SRodney W. Grimes.El
3348fae3551SRodney W. Grimes.Pp
3358fae3551SRodney W. GrimesAny additional options specific to a file system type that is not
3368fae3551SRodney W. Grimesone of the internally known types (see the
3378fae3551SRodney W. Grimes.Fl t
3388fae3551SRodney W. Grimesoption) may be passed as a comma separated list; these options are
3398fae3551SRodney W. Grimesdistinguished by a leading
3408fae3551SRodney W. Grimes.Dq \&-
3418fae3551SRodney W. Grimes(dash).
3428fae3551SRodney W. GrimesOptions that take a value are specified using the syntax -option=value.
343951122deSSteve PriceFor example, the
344951122deSSteve Price.Nm
345951122deSSteve Pricecommand:
3468fae3551SRodney W. Grimes.Bd -literal -offset indent
3473592acb1STom McLaughlinmount -t cd9660 -o -e /dev/cd0 /cdrom
3488fae3551SRodney W. Grimes.Ed
3498fae3551SRodney W. Grimes.Pp
3508fae3551SRodney W. Grimescauses
351951122deSSteve Price.Nm
3528fae3551SRodney W. Grimesto execute the equivalent of:
3538fae3551SRodney W. Grimes.Bd -literal -offset indent
3543592acb1STom McLaughlin/sbin/mount_cd9660 -e /dev/cd0 /cdrom
3558fae3551SRodney W. Grimes.Ed
356e4bc2e34SSheldon Hearn.Pp
357e4bc2e34SSheldon HearnAdditional options specific to file system types
358e4bc2e34SSheldon Hearnwhich are not internally known
359e4bc2e34SSheldon Hearn(see the description of the
360e4bc2e34SSheldon Hearn.Fl t
361e4bc2e34SSheldon Hearnoption below)
362e4bc2e34SSheldon Hearnmay be described in the manual pages for the associated
363e4bc2e34SSheldon Hearn.Pa /sbin/mount_ Ns Sy XXX
364e4bc2e34SSheldon Hearnutilities.
365a257a45eSJordan K. Hubbard.It Fl p
3667f804728SRuslan ErmilovPrint mount information in
3677f804728SRuslan Ermilov.Xr fstab 5
3687f804728SRuslan Ermilovformat.
369ef8f7ac9SSheldon HearnImplies also the
370a257a45eSJordan K. Hubbard.Fl v
371a257a45eSJordan K. Hubbardoption.
3728fae3551SRodney W. Grimes.It Fl r
3738fae3551SRodney W. GrimesThe file system is to be mounted read-only.
3748fae3551SRodney W. GrimesMount the file system read-only (even the super-user may not write it).
3758fae3551SRodney W. GrimesThe same as the
376c80f12d0SSean Chittenden.Cm ro
3778fae3551SRodney W. Grimesargument to the
3788fae3551SRodney W. Grimes.Fl o
3798fae3551SRodney W. Grimesoption.
3808266d476SRuslan Ermilov.It Fl t Cm ufs | Ar external_type
3818fae3551SRodney W. GrimesThe argument following the
3828fae3551SRodney W. Grimes.Fl t
3838fae3551SRodney W. Grimesis used to indicate the file system type.
3848fae3551SRodney W. GrimesThe type
3858266d476SRuslan Ermilov.Cm ufs
3868fae3551SRodney W. Grimesis the default.
38793eb5567SGarrett WollmanThe
38893eb5567SGarrett Wollman.Fl t
38993eb5567SGarrett Wollmanoption can be used
3908fae3551SRodney W. Grimesto indicate that the actions should only be taken on
3918fae3551SRodney W. Grimesfile systems of the specified type.
3928fae3551SRodney W. GrimesMore than one type may be specified in a comma separated list.
3938fae3551SRodney W. GrimesThe list of file system types can be prefixed with
3948266d476SRuslan Ermilov.Dq Li no
3958fae3551SRodney W. Grimesto specify the file system types for which action should
3968fae3551SRodney W. Grimes.Em not
3978fae3551SRodney W. Grimesbe taken.
3988fae3551SRodney W. GrimesFor example, the
399951122deSSteve Price.Nm
4008fae3551SRodney W. Grimescommand:
4018fae3551SRodney W. Grimes.Bd -literal -offset indent
4020b381bf1SRuslan Ermilovmount -a -t nonfs,nullfs
4038fae3551SRodney W. Grimes.Ed
4048fae3551SRodney W. Grimes.Pp
4058fae3551SRodney W. Grimesmounts all file systems except those of type
4068fae3551SRodney W. Grimes.Tn NFS
4078fae3551SRodney W. Grimesand
4080b381bf1SRuslan Ermilov.Tn NULLFS .
4098fae3551SRodney W. Grimes.Pp
4107c5347aeSCraig RodriguesThe default behavior of
411951122deSSteve Price.Nm
4127c5347aeSCraig Rodriguesis to pass the
4137c5347aeSCraig Rodrigues.Fl t
4147c5347aeSCraig Rodriguesoption directly to the
4157c5347aeSCraig Rodrigues.Xr nmount 2
4167c5347aeSCraig Rodriguessystem call in the
4177c5347aeSCraig Rodrigues.Li fstype
4187c5347aeSCraig Rodriguesoption.
4197c5347aeSCraig Rodrigues.Pp
4207c5347aeSCraig RodriguesHowever, for the following file system types:
4218266d476SRuslan Ermilov.Cm cd9660 ,
4228266d476SRuslan Ermilov.Cm mfs ,
4238266d476SRuslan Ermilov.Cm msdosfs ,
4248266d476SRuslan Ermilov.Cm nfs ,
4258266d476SRuslan Ermilov.Cm nfs4 ,
4268266d476SRuslan Ermilov.Cm ntfs ,
4278266d476SRuslan Ermilov.Cm nwfs ,
4288266d476SRuslan Ermilov.Cm nullfs ,
4298266d476SRuslan Ermilov.Cm portalfs ,
4308266d476SRuslan Ermilov.Cm smbfs ,
4318266d476SRuslan Ermilov.Cm udf ,
4327c5347aeSCraig Rodriguesand
4338266d476SRuslan Ermilov.Cm unionfs ,
4347c5347aeSCraig Rodrigues.Nm
4357c5347aeSCraig Rodrigueswill not call
4367c5347aeSCraig Rodrigues.Xr nmount 2
4377c5347aeSCraig Rodriguesdirectly and will instead attempt to execute a program in
438e4bc2e34SSheldon Hearn.Pa /sbin/mount_ Ns Sy XXX
4398fae3551SRodney W. Grimeswhere
440e4bc2e34SSheldon Hearn.Sy XXX
4417c5347aeSCraig Rodriguesis replaced by the file system type name.
4428fae3551SRodney W. GrimesFor example, nfs file systems are mounted by the program
4438fae3551SRodney W. Grimes.Pa /sbin/mount_nfs .
44493eb5567SGarrett Wollman.Pp
44526fbf78bSMaxime HenrionMost file systems will be dynamically loaded by the kernel
44626fbf78bSMaxime Henrionif not already present, and if the kernel module is available.
4478fae3551SRodney W. Grimes.It Fl u
4488fae3551SRodney W. GrimesThe
4498fae3551SRodney W. Grimes.Fl u
4508fae3551SRodney W. Grimesflag indicates that the status of an already mounted file
4518fae3551SRodney W. Grimessystem should be changed.
4528fae3551SRodney W. GrimesAny of the options discussed above (the
4538fae3551SRodney W. Grimes.Fl o
4548fae3551SRodney W. Grimesoption)
4558fae3551SRodney W. Grimesmay be changed;
4568fae3551SRodney W. Grimesalso a file system can be changed from read-only to read-write
4578fae3551SRodney W. Grimesor vice versa.
4588fae3551SRodney W. GrimesAn attempt to change from read-write to read-only will fail if any
4598fae3551SRodney W. Grimesfiles on the file system are currently open for writing unless the
4608fae3551SRodney W. Grimes.Fl f
4618fae3551SRodney W. Grimesflag is also specified.
46218af6044SJoseph KoshyThe set of options is determined by applying the options specified
46318af6044SJoseph Koshyin the argument to
4648fae3551SRodney W. Grimes.Fl o
4658fae3551SRodney W. Grimesand finally applying the
4668fae3551SRodney W. Grimes.Fl r
4678fae3551SRodney W. Grimesor
4688fae3551SRodney W. Grimes.Fl w
4698fae3551SRodney W. Grimesoption.
4708fae3551SRodney W. Grimes.It Fl v
4718fae3551SRodney W. GrimesVerbose mode.
4728fae3551SRodney W. Grimes.It Fl w
4738fae3551SRodney W. GrimesThe file system object is to be read and write.
4741252c1bbSRuslan Ermilov.El
475ef258dd9SMatthew N. Dodd.Sh ENVIRONMENT
476a0b6213bSRuslan Ermilov.Bl -tag -width ".Ev PATH_FSTAB"
477a0b6213bSRuslan Ermilov.It Ev PATH_FSTAB
478ef258dd9SMatthew N. DoddIf the environment variable
479a0b6213bSRuslan Ermilov.Ev PATH_FSTAB
480a0b6213bSRuslan Ermilovis set, all operations are performed against the specified file.
481a0b6213bSRuslan Ermilov.Ev PATH_FSTAB
482564b641eSMatthew N. Doddwill not be honored if the process environment or memory address space is
4830e9efd19SChristian Bruefferconsidered
484564b641eSMatthew N. Dodd.Dq tainted .
485564b641eSMatthew N. Dodd(See
486a0b6213bSRuslan Ermilov.Xr issetugid 2
487564b641eSMatthew N. Doddfor more information.)
488ef258dd9SMatthew N. Dodd.El
4898fae3551SRodney W. Grimes.Sh FILES
4908fae3551SRodney W. Grimes.Bl -tag -width /etc/fstab -compact
4918fae3551SRodney W. Grimes.It Pa /etc/fstab
4928fae3551SRodney W. Grimesfile system table
4938fae3551SRodney W. Grimes.El
4946087df9eSRuslan Ermilov.Sh DIAGNOSTICS
4956087df9eSRuslan ErmilovVarious, most of them are self-explanatory.
4966087df9eSRuslan Ermilov.Pp
4976087df9eSRuslan Ermilov.Dl XXXXX file system is not available
4986087df9eSRuslan Ermilov.Pp
4996087df9eSRuslan ErmilovThe kernel does not support the respective file system type.
5006087df9eSRuslan ErmilovNote that
5016087df9eSRuslan Ermilovsupport for a particular file system might be provided either on a static
5026087df9eSRuslan Ermilov(kernel compile-time), or dynamic basis (loaded as a kernel module by
5036087df9eSRuslan Ermilov.Xr kldload 8 ) .
5048fae3551SRodney W. Grimes.Sh SEE ALSO
505ed1b9fc9STom Rhodes.Xr getfacl 1 ,
506ed1b9fc9STom Rhodes.Xr setfacl 1 ,
5077c5347aeSCraig Rodrigues.Xr nmount 2 ,
508ed1b9fc9STom Rhodes.Xr acl 3 ,
509ed1b9fc9STom Rhodes.Xr mac 4 ,
510c002dbe6SCraig Rodrigues.Xr ext2fs 5 ,
5118266d476SRuslan Ermilov.Xr fstab 5 ,
512067eb35dSCraig Rodrigues.Xr procfs 5 ,
5138266d476SRuslan Ermilov.Xr kldload 8 ,
5148fae3551SRodney W. Grimes.Xr mount_cd9660 8 ,
5154ccd7546SRuslan Ermilov.Xr mount_msdosfs 8 ,
5168fae3551SRodney W. Grimes.Xr mount_nfs 8 ,
51701c78dbbSNik Clayton.Xr mount_ntfs 8 ,
5186ad10804SRuslan Ermilov.Xr mount_nullfs 8 ,
5191ce9f317SNik Clayton.Xr mount_nwfs 8 ,
5206ad10804SRuslan Ermilov.Xr mount_portalfs 8 ,
521b6925fa9SDavid Malone.Xr mount_smbfs 8 ,
522b6925fa9SDavid Malone.Xr mount_udf 8 ,
5236ad10804SRuslan Ermilov.Xr mount_unionfs 8 ,
524ed1b9fc9STom Rhodes.Xr umount 8
525ce602323SJoseph Koshy.Sh CAVEATS
5267f804728SRuslan ErmilovAfter a successful
5277f804728SRuslan Ermilov.Nm ,
5287f804728SRuslan Ermilovthe permissions on the original mount point determine if
5297f804728SRuslan Ermilov.Pa ..\&
5307f804728SRuslan Ermilovis accessible from the mounted file system.
5317f804728SRuslan ErmilovThe minimum permissions for
532ce602323SJoseph Koshythe mount point for traversal across the mount point in both
533ce602323SJoseph Koshydirections to be possible for all users is 0111 (execute for all).
5346d29a0b6SKonstantin Belousov.Pp
5356d29a0b6SKonstantin BelousovUse of the
5366d29a0b6SKonstantin Belousov.Nm
5376d29a0b6SKonstantin Belousovis preferred over the use of the file system specific
538ac14190eSRuslan Ermilov.Pa mount_ Ns Sy XXX
5396d29a0b6SKonstantin Belousovcommands.
540ac14190eSRuslan ErmilovIn particular,
541ac14190eSRuslan Ermilov.Xr mountd 8
542ac14190eSRuslan Ermilovgets a
543ac14190eSRuslan Ermilov.Dv SIGHUP
544ac14190eSRuslan Ermilovsignal (that causes an update of the export list)
5456d29a0b6SKonstantin Belousovonly when the file system is mounted via
5466d29a0b6SKonstantin Belousov.Nm .
5478fae3551SRodney W. Grimes.Sh HISTORY
5488fae3551SRodney W. GrimesA
549951122deSSteve Price.Nm
550e1205e80SPhilippe Charnierutility appeared in
551b8923d4cSWolfram Schneider.At v1 .
5526087df9eSRuslan Ermilov.Sh BUGS
5536087df9eSRuslan ErmilovIt is possible for a corrupted file system to cause a crash.
554