xref: /freebsd/sbin/mount/mount.8 (revision b48b774f99f8984c3e2bd9bb8a01dee0c5aa2058)
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.\"
3174794314SEitan Adler.Dd July 12, 2012
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).
109*b48b774fSChris Rees.It Fl L
110*b48b774fSChris ReesWhen used in conjunction with the
111*b48b774fSChris Rees.Fl a
112*b48b774fSChris Reesoption, mount
113*b48b774fSChris Rees.Em only
114*b48b774fSChris Reesthose file systems which are marked as
115*b48b774fSChris Rees.Dq Li late .
1164b4f9170SDag-Erling Smørgrav.It Fl l
1174b4f9170SDag-Erling SmørgravWhen used in conjunction with the
1184b4f9170SDag-Erling Smørgrav.Fl a
1194b4f9170SDag-Erling Smørgravoption, also mount those file systems which are marked as
1208266d476SRuslan Ermilov.Dq Li late .
1218fae3551SRodney W. Grimes.It Fl o
1228fae3551SRodney W. GrimesOptions are specified with a
1238fae3551SRodney W. Grimes.Fl o
1248fae3551SRodney W. Grimesflag followed by a comma separated string of options.
12518af6044SJoseph KoshyIn case of conflicting options being specified, the rightmost option
12618af6044SJoseph Koshytakes effect.
1278fae3551SRodney W. GrimesThe following options are available:
1288fae3551SRodney W. Grimes.Bl -tag -width indent
129f00a5dbdSTom Rhodes.It Cm acls
1309340fc72SEdward Tomasz NapieralaEnable POSIX.1e Access Control Lists, or ACLs, which can be customized via the
131f00a5dbdSTom Rhodes.Xr setfacl 1
132f00a5dbdSTom Rhodesand
133f00a5dbdSTom Rhodes.Xr getfacl 1
134f00a5dbdSTom Rhodescommands.
1359340fc72SEdward Tomasz NapieralaThis flag is mutually exclusive with
1369340fc72SEdward Tomasz Napierala.Cm nfsv4acls
1379340fc72SEdward Tomasz Napieralaflag.
1387f804728SRuslan Ermilov.It Cm async
1398fae3551SRodney W. GrimesAll
1408fae3551SRodney W. Grimes.Tn I/O
1418fae3551SRodney W. Grimesto the file system should be done asynchronously.
1428fae3551SRodney W. GrimesThis is a
1438fae3551SRodney W. Grimes.Em dangerous
144d6649c25SDaniel Gerzoflag to set, since it does not guarantee that the file system structure
145d6649c25SDaniel Gerzoon the disk will remain consistent.
146d6649c25SDaniel GerzoFor this reason, the
147d6649c25SDaniel Gerzo.Cm async
148d6649c25SDaniel Gerzoflag should be used sparingly, and only when some data recovery
149d6649c25SDaniel Gerzomechanism is present.
1507f804728SRuslan Ermilov.It Cm current
15118af6044SJoseph KoshyWhen used with the
15218af6044SJoseph Koshy.Fl u
15318af6044SJoseph Koshyflag, this is the same as specifying the options currently in effect for
15418af6044SJoseph Koshythe mounted file system.
15574794314SEitan Adler.It Cm failok
15674794314SEitan AdlerIf this option is specified,
15774794314SEitan Adler.Nm
15874794314SEitan Adlerwill return 0 even if an error occurs
15974794314SEitan Adlerduring the mount of the filesystem.
1607f804728SRuslan Ermilov.It Cm force
1618fae3551SRodney W. GrimesThe same as
1628fae3551SRodney W. Grimes.Fl f ;
1638fae3551SRodney W. Grimesforces the revocation of write access when trying to downgrade
164ef8f7ac9SSheldon Hearna file system mount status from read-write to read-only.
165ef8f7ac9SSheldon HearnAlso
1661469eec8SDavid Greenmanforces the R/W mount of an unclean file system (dangerous; use with caution).
1677f804728SRuslan Ermilov.It Cm fstab
16818af6044SJoseph KoshyWhen used with the
16918af6044SJoseph Koshy.Fl u
17018af6044SJoseph Koshyflag, this is the same as specifying all the options listed in the
17118af6044SJoseph Koshy.Xr fstab 5
17218af6044SJoseph Koshyfile for the file system.
1734b4f9170SDag-Erling Smørgrav.It Cm late
1744b4f9170SDag-Erling SmørgravThis file system should be skipped when
17574109472SDag-Erling Smørgrav.Nm
17674109472SDag-Erling Smørgravis run with the
1774b4f9170SDag-Erling Smørgrav.Fl a
1784b4f9170SDag-Erling Smørgravflag but without the
1794b4f9170SDag-Erling Smørgrav.Fl l
1804b4f9170SDag-Erling Smørgravflag.
181c7835769SCraig Rodrigues.It Cm mountprog Ns = Ns Aq Ar program
182c7835769SCraig RodriguesForce
183c7835769SCraig Rodrigues.Nm
184c7835769SCraig Rodriguesto use the specified program to mount the file system, instead of calling
185c7835769SCraig Rodrigues.Xr nmount 2
18642923317SEitan Adlerdirectly.
18742923317SEitan AdlerFor example:
188c7835769SCraig Rodrigues.Bd -literal
189c7835769SCraig Rodriguesmount -t foofs -o mountprog=/mydir/fooprog /dev/acd0 /mnt
190c7835769SCraig Rodrigues.Ed
191f00a5dbdSTom Rhodes.It Cm multilabel
19290b9e3f1SRobert WatsonEnable multi-label Mandatory Access Control, or MAC, on the specified file
19390b9e3f1SRobert Watsonsystem.
19490b9e3f1SRobert WatsonIf the file system supports multilabel operation, individual labels will
19590b9e3f1SRobert Watsonbe maintained for each object in the file system, rather than using a
1968e5c1e59SJosef El-Rayessingle label for all objects.
197d04b5dfeSRuslan ErmilovAn alternative to the
198d04b5dfeSRuslan Ermilov.Fl l
199f00a5dbdSTom Rhodesflag in
200f00a5dbdSTom Rhodes.Xr tunefs 8 .
201f00a5dbdSTom RhodesSee
202f00a5dbdSTom Rhodes.Xr mac 4
20390b9e3f1SRobert Watsonfor more information, which cause the multilabel mount flag to be set
20490b9e3f1SRobert Watsonautomatically at mount-time.
2059340fc72SEdward Tomasz Napierala.It Cm nfsv4acls
2069340fc72SEdward Tomasz NapieralaEnable NFSv4 ACLs, which can be customized via the
2079340fc72SEdward Tomasz Napierala.Xr setfacl 1
2089340fc72SEdward Tomasz Napieralaand
2099340fc72SEdward Tomasz Napierala.Xr getfacl 1
2109340fc72SEdward Tomasz Napieralacommands.
2119340fc72SEdward Tomasz NapieralaThis flag is mutually exclusive with
2129340fc72SEdward Tomasz Napierala.Cm acls
2139340fc72SEdward Tomasz Napieralaflag.
2147f804728SRuslan Ermilov.It Cm noasync
215534e0080SDavid E. O'BrienMetadata I/O should be done synchronously, while data I/O should be done
2167f804728SRuslan Ermilovasynchronously.
2177f804728SRuslan ErmilovThis is the default.
2187f804728SRuslan Ermilov.It Cm noatime
219ef8f7ac9SSheldon HearnDo not update the file access time when reading from a file.
220ef8f7ac9SSheldon HearnThis option
221fa947154SDavid Greenmanis useful on file systems where there are large numbers of files and
222fa947154SDavid Greenmanperformance is more critical than updating the file access time (which is
2237f804728SRuslan Ermilovrarely ever important).
2242960733fSDoug BartonThis option is currently only supported on local file systems.
2257f804728SRuslan Ermilov.It Cm noauto
2267f804728SRuslan ErmilovThis file system should be skipped when
2277f804728SRuslan Ermilov.Nm
2287f804728SRuslan Ermilovis run with the
229c06fe0a0SPeter Wemm.Fl a
230c06fe0a0SPeter Wemmflag.
2317f804728SRuslan Ermilov.It Cm noclusterr
23275b714acSKATO TakenoriDisable read clustering.
2337f804728SRuslan Ermilov.It Cm noclusterw
23475b714acSKATO TakenoriDisable write clustering.
2357f804728SRuslan Ermilov.It Cm noexec
2368fae3551SRodney W. GrimesDo not allow execution of any binaries on the mounted file system.
2378fae3551SRodney W. GrimesThis option is useful for a server that has file systems containing
2388fae3551SRodney W. Grimesbinaries for architectures other than its own.
23918a3dd1eSColin PercivalNote: This option was not designed as a security feature and no
24018a3dd1eSColin Percivalguarantee is made that it will prevent malicious code execution; for
24118a3dd1eSColin Percivalexample, it is still possible to execute scripts which reside on a
24218a3dd1eSColin Percival.Cm noexec
24318a3dd1eSColin Percivalmounted partition.
2447f804728SRuslan Ermilov.It Cm nosuid
2458fae3551SRodney W. GrimesDo not allow set-user-identifier or set-group-identifier bits to take effect.
246b23472acSWolfram SchneiderNote: this option is worthless if a public available suid or sgid
247b23472acSWolfram Schneiderwrapper like
248951122deSSteve Price.Xr suidperl 1
249b23472acSWolfram Schneideris installed on your system.
250b4206324SJoerg WunschIt is set automatically when the user does not have super-user privileges.
2517f804728SRuslan Ermilov.It Cm nosymfollow
2525ddc8dedSWolfram SchneiderDo not follow symlinks
2535ddc8dedSWolfram Schneideron the mounted file system.
254c80f12d0SSean Chittenden.It Cm ro
2558fae3551SRodney W. GrimesThe same as
2568fae3551SRodney W. Grimes.Fl r ;
2578fae3551SRodney W. Grimesmount the file system read-only (even the super-user may not write it).
258299f1561STom Rhodes.It Cm snapshot
259299f1561STom RhodesThis option allows a snapshot of the specified file system to be taken.
260299f1561STom RhodesThe
261299f1561STom Rhodes.Fl u
262299f1561STom Rhodesflag is required with this option.
263299f1561STom RhodesNote that snapshot files must be created in the file system that is being
264299f1561STom Rhodessnapshotted.
265299f1561STom RhodesYou may create up to 20 snapshots per file system.
266299f1561STom RhodesActive snapshots are recorded in the superblock, so they persist across unmount
267299f1561STom Rhodesand remount operations and across system reboots.
268299f1561STom RhodesWhen you are done with a snapshot, it can be removed with the
2699acd9d01SRuslan Ermilov.Xr rm 1
270299f1561STom Rhodescommand.
271299f1561STom RhodesSnapshots may be removed in any order, however you may not get back all the
272299f1561STom Rhodesspace contained in the snapshot as another snapshot may claim some of the blocks
273299f1561STom Rhodesthat it is releasing.
274299f1561STom RhodesNote that the schg flag is set on snapshots to ensure that not even the root
275299f1561STom Rhodesuser can write to them.
276299f1561STom RhodesThe unlink command makes an exception for snapshot files in that it allows them
277299f1561STom Rhodesto be removed even though they have the schg flag set, so it is not necessary to
278299f1561STom Rhodesclear the schg flag before removing a snapshot file.
279299f1561STom Rhodes.Pp
280299f1561STom RhodesOnce you have taken a snapshot, there are three interesting things that you can
281299f1561STom Rhodesdo with it:
282299f1561STom Rhodes.Pp
283299f1561STom Rhodes.Bl -enum -compact
284299f1561STom Rhodes.It
2859acd9d01SRuslan ErmilovRun
2869acd9d01SRuslan Ermilov.Xr fsck 8
2879acd9d01SRuslan Ermilovon the snapshot file.
288299f1561STom RhodesAssuming that the file system was clean when it was mounted, you should always
289299f1561STom Rhodesget a clean (and unchanging) result from running fsck on the snapshot.
290299f1561STom RhodesThis is essentially what the background fsck process does.
291299f1561STom Rhodes.Pp
292299f1561STom Rhodes.It
2939acd9d01SRuslan ErmilovRun
2949acd9d01SRuslan Ermilov.Xr dump 8
2959acd9d01SRuslan Ermilovon the snapshot.
296299f1561STom RhodesYou will get a dump that is consistent with the file system as of the timestamp
297299f1561STom Rhodesof the snapshot.
298299f1561STom Rhodes.Pp
299299f1561STom Rhodes.It
300299f1561STom RhodesMount the snapshot as a frozen image of the file system.
301299f1561STom RhodesTo mount the snapshot
302299f1561STom Rhodes.Pa /var/snapshot/snap1 :
303299f1561STom Rhodes.Bd -literal
304299f1561STom Rhodesmdconfig -a -t vnode -f /var/snapshot/snap1 -u 4
305299f1561STom Rhodesmount -r /dev/md4 /mnt
306299f1561STom Rhodes.Ed
307299f1561STom Rhodes.Pp
308299f1561STom RhodesYou can now cruise around your frozen
309299f1561STom Rhodes.Pa /var
310299f1561STom Rhodesfile system at
311299f1561STom Rhodes.Pa /mnt .
312299f1561STom RhodesEverything will be in the same state that it was at the time the snapshot was
313299f1561STom Rhodestaken.
314299f1561STom RhodesThe one exception is that any earlier snapshots will appear as zero length
315299f1561STom Rhodesfiles.
316299f1561STom RhodesWhen you are done with the mounted snapshot:
317299f1561STom Rhodes.Bd -literal
318299f1561STom Rhodesumount /mnt
319299f1561STom Rhodesmdconfig -d -u 4
320299f1561STom Rhodes.Ed
321299f1561STom Rhodes.El
3227f804728SRuslan Ermilov.It Cm suiddir
32352bf64c7SJulian ElischerA directory on the mounted file system will respond to the SUID bit
32452bf64c7SJulian Elischerbeing set, by setting the owner of any new files to be the same
32552bf64c7SJulian Elischeras the owner of the directory.
32652bf64c7SJulian ElischerNew directories will inherit the bit from their parents.
32752bf64c7SJulian ElischerExecute bits are removed from
32852bf64c7SJulian Elischerthe file, and it will not be given to root.
32952bf64c7SJulian Elischer.Pp
33052bf64c7SJulian ElischerThis feature is designed for use on fileservers serving PC users via
331ef8f7ac9SSheldon Hearnftp, SAMBA, or netatalk.
332ef8f7ac9SSheldon HearnIt provides security holes for shell users and as
33352bf64c7SJulian Elischersuch should not be used on shell machines, especially on home directories.
33452bf64c7SJulian ElischerThis option requires the SUIDDIR
335ef8f7ac9SSheldon Hearnoption in the kernel to work.
336ef8f7ac9SSheldon HearnOnly UFS file systems support this option.
33752bf64c7SJulian ElischerSee
33852bf64c7SJulian Elischer.Xr chmod 2
33952bf64c7SJulian Elischerfor more information.
340ef37e89dSJohn Baldwin.It Cm sync
341ef37e89dSJohn BaldwinAll
342ef37e89dSJohn Baldwin.Tn I/O
343ef37e89dSJohn Baldwinto the file system should be done synchronously.
3447f804728SRuslan Ermilov.It Cm update
3458fae3551SRodney W. GrimesThe same as
3468fae3551SRodney W. Grimes.Fl u ;
3478fae3551SRodney W. Grimesindicate that the status of an already mounted file system should be changed.
3487f804728SRuslan Ermilov.It Cm union
3498fae3551SRodney W. GrimesCauses the namespace at the mount point to appear as the union
3508fae3551SRodney W. Grimesof the mounted file system root and the existing directory.
3518fae3551SRodney W. GrimesLookups will be done in the mounted file system first.
3528fae3551SRodney W. GrimesIf those operations fail due to a non-existent file the underlying
3538fae3551SRodney W. Grimesdirectory is then accessed.
3548fae3551SRodney W. GrimesAll creates are done in the mounted file system.
3558fae3551SRodney W. Grimes.El
3568fae3551SRodney W. Grimes.Pp
3578fae3551SRodney W. GrimesAny additional options specific to a file system type that is not
3588fae3551SRodney W. Grimesone of the internally known types (see the
3598fae3551SRodney W. Grimes.Fl t
3608fae3551SRodney W. Grimesoption) may be passed as a comma separated list; these options are
3618fae3551SRodney W. Grimesdistinguished by a leading
3628fae3551SRodney W. Grimes.Dq \&-
3638fae3551SRodney W. Grimes(dash).
364951122deSSteve PriceFor example, the
365951122deSSteve Price.Nm
366951122deSSteve Pricecommand:
3678fae3551SRodney W. Grimes.Bd -literal -offset indent
3683592acb1STom McLaughlinmount -t cd9660 -o -e /dev/cd0 /cdrom
3698fae3551SRodney W. Grimes.Ed
3708fae3551SRodney W. Grimes.Pp
3718fae3551SRodney W. Grimescauses
372951122deSSteve Price.Nm
3738fae3551SRodney W. Grimesto execute the equivalent of:
3748fae3551SRodney W. Grimes.Bd -literal -offset indent
3753592acb1STom McLaughlin/sbin/mount_cd9660 -e /dev/cd0 /cdrom
3768fae3551SRodney W. Grimes.Ed
377e4bc2e34SSheldon Hearn.Pp
378d452fb8aSGavin AtkinsonOptions that take a value are specified using the -option=value syntax:
379d452fb8aSGavin Atkinson.Bd -literal -offset indent
380d452fb8aSGavin Atkinsonmount -t msdosfs -o -u=fred,-g=wheel /dev/da0s1 /mnt
381d452fb8aSGavin Atkinson.Ed
382d452fb8aSGavin Atkinson.Pp
383d452fb8aSGavin Atkinsonis equivalent to
384d452fb8aSGavin Atkinson.Bd -literal -offset indent
385d452fb8aSGavin Atkinson/sbin/mount_msdosfs -u fred -g wheel /dev/da0s1 /mnt
386d452fb8aSGavin Atkinson.Ed
387d452fb8aSGavin Atkinson.Pp
388e4bc2e34SSheldon HearnAdditional options specific to file system types
389e4bc2e34SSheldon Hearnwhich are not internally known
390e4bc2e34SSheldon Hearn(see the description of the
391e4bc2e34SSheldon Hearn.Fl t
392e4bc2e34SSheldon Hearnoption below)
393e4bc2e34SSheldon Hearnmay be described in the manual pages for the associated
394e4bc2e34SSheldon Hearn.Pa /sbin/mount_ Ns Sy XXX
395e4bc2e34SSheldon Hearnutilities.
396a257a45eSJordan K. Hubbard.It Fl p
3977f804728SRuslan ErmilovPrint mount information in
3987f804728SRuslan Ermilov.Xr fstab 5
3997f804728SRuslan Ermilovformat.
400ef8f7ac9SSheldon HearnImplies also the
401a257a45eSJordan K. Hubbard.Fl v
402a257a45eSJordan K. Hubbardoption.
4038fae3551SRodney W. Grimes.It Fl r
4048fae3551SRodney W. GrimesThe file system is to be mounted read-only.
4058fae3551SRodney W. GrimesMount the file system read-only (even the super-user may not write it).
4068fae3551SRodney W. GrimesThe same as the
407c80f12d0SSean Chittenden.Cm ro
4088fae3551SRodney W. Grimesargument to the
4098fae3551SRodney W. Grimes.Fl o
4108fae3551SRodney W. Grimesoption.
4118266d476SRuslan Ermilov.It Fl t Cm ufs | Ar external_type
4128fae3551SRodney W. GrimesThe argument following the
4138fae3551SRodney W. Grimes.Fl t
4148fae3551SRodney W. Grimesis used to indicate the file system type.
4158fae3551SRodney W. GrimesThe type
4168266d476SRuslan Ermilov.Cm ufs
4178fae3551SRodney W. Grimesis the default.
41893eb5567SGarrett WollmanThe
41993eb5567SGarrett Wollman.Fl t
42093eb5567SGarrett Wollmanoption can be used
4218fae3551SRodney W. Grimesto indicate that the actions should only be taken on
4228fae3551SRodney W. Grimesfile systems of the specified type.
4238fae3551SRodney W. GrimesMore than one type may be specified in a comma separated list.
4248fae3551SRodney W. GrimesThe list of file system types can be prefixed with
4258266d476SRuslan Ermilov.Dq Li no
4268fae3551SRodney W. Grimesto specify the file system types for which action should
4278fae3551SRodney W. Grimes.Em not
4288fae3551SRodney W. Grimesbe taken.
4298fae3551SRodney W. GrimesFor example, the
430951122deSSteve Price.Nm
4318fae3551SRodney W. Grimescommand:
4328fae3551SRodney W. Grimes.Bd -literal -offset indent
4330b381bf1SRuslan Ermilovmount -a -t nonfs,nullfs
4348fae3551SRodney W. Grimes.Ed
4358fae3551SRodney W. Grimes.Pp
4368fae3551SRodney W. Grimesmounts all file systems except those of type
4378fae3551SRodney W. Grimes.Tn NFS
4388fae3551SRodney W. Grimesand
4390b381bf1SRuslan Ermilov.Tn NULLFS .
4408fae3551SRodney W. Grimes.Pp
4417c5347aeSCraig RodriguesThe default behavior of
442951122deSSteve Price.Nm
4437c5347aeSCraig Rodriguesis to pass the
4447c5347aeSCraig Rodrigues.Fl t
4457c5347aeSCraig Rodriguesoption directly to the
4467c5347aeSCraig Rodrigues.Xr nmount 2
4477c5347aeSCraig Rodriguessystem call in the
4487c5347aeSCraig Rodrigues.Li fstype
4497c5347aeSCraig Rodriguesoption.
4507c5347aeSCraig Rodrigues.Pp
4517c5347aeSCraig RodriguesHowever, for the following file system types:
4528266d476SRuslan Ermilov.Cm cd9660 ,
4538266d476SRuslan Ermilov.Cm mfs ,
4548266d476SRuslan Ermilov.Cm msdosfs ,
4558266d476SRuslan Ermilov.Cm nfs ,
4568266d476SRuslan Ermilov.Cm nullfs ,
457859aaa88SRick Macklem.Cm oldnfs ,
4588266d476SRuslan Ermilov.Cm udf ,
4597c5347aeSCraig Rodriguesand
460344c81a1SWarren Block.Cm unionfs .
4617c5347aeSCraig Rodrigues.Nm
4627c5347aeSCraig Rodrigueswill not call
4637c5347aeSCraig Rodrigues.Xr nmount 2
4647c5347aeSCraig Rodriguesdirectly and will instead attempt to execute a program in
465e4bc2e34SSheldon Hearn.Pa /sbin/mount_ Ns Sy XXX
4668fae3551SRodney W. Grimeswhere
467e4bc2e34SSheldon Hearn.Sy XXX
4687c5347aeSCraig Rodriguesis replaced by the file system type name.
4698fae3551SRodney W. GrimesFor example, nfs file systems are mounted by the program
4708fae3551SRodney W. Grimes.Pa /sbin/mount_nfs .
47193eb5567SGarrett Wollman.Pp
47226fbf78bSMaxime HenrionMost file systems will be dynamically loaded by the kernel
47326fbf78bSMaxime Henrionif not already present, and if the kernel module is available.
4748fae3551SRodney W. Grimes.It Fl u
4758fae3551SRodney W. GrimesThe
4768fae3551SRodney W. Grimes.Fl u
4778fae3551SRodney W. Grimesflag indicates that the status of an already mounted file
4788fae3551SRodney W. Grimessystem should be changed.
4798fae3551SRodney W. GrimesAny of the options discussed above (the
4808fae3551SRodney W. Grimes.Fl o
4818fae3551SRodney W. Grimesoption)
4828fae3551SRodney W. Grimesmay be changed;
4838fae3551SRodney W. Grimesalso a file system can be changed from read-only to read-write
4848fae3551SRodney W. Grimesor vice versa.
4858fae3551SRodney W. GrimesAn attempt to change from read-write to read-only will fail if any
4868fae3551SRodney W. Grimesfiles on the file system are currently open for writing unless the
4878fae3551SRodney W. Grimes.Fl f
4888fae3551SRodney W. Grimesflag is also specified.
48918af6044SJoseph KoshyThe set of options is determined by applying the options specified
49018af6044SJoseph Koshyin the argument to
4918fae3551SRodney W. Grimes.Fl o
4928fae3551SRodney W. Grimesand finally applying the
4938fae3551SRodney W. Grimes.Fl r
4948fae3551SRodney W. Grimesor
4958fae3551SRodney W. Grimes.Fl w
4968fae3551SRodney W. Grimesoption.
4978fae3551SRodney W. Grimes.It Fl v
4988fae3551SRodney W. GrimesVerbose mode.
4998abb2a6eSPawel Jakub DawidekIf the
5008abb2a6eSPawel Jakub Dawidek.Fl v
5018abb2a6eSPawel Jakub Dawidekis used alone, show all file systems, including those that were mounted with the
5028abb2a6eSPawel Jakub Dawidek.Dv MNT_IGNORE
5038abb2a6eSPawel Jakub Dawidekflag and show additional information about each file system (including fsid
5048abb2a6eSPawel Jakub Dawidekwhen run by root).
5058fae3551SRodney W. Grimes.It Fl w
5068fae3551SRodney W. GrimesThe file system object is to be read and write.
5071252c1bbSRuslan Ermilov.El
508ef258dd9SMatthew N. Dodd.Sh ENVIRONMENT
509a0b6213bSRuslan Ermilov.Bl -tag -width ".Ev PATH_FSTAB"
510a0b6213bSRuslan Ermilov.It Ev PATH_FSTAB
511ef258dd9SMatthew N. DoddIf the environment variable
512a0b6213bSRuslan Ermilov.Ev PATH_FSTAB
513a0b6213bSRuslan Ermilovis set, all operations are performed against the specified file.
514a0b6213bSRuslan Ermilov.Ev PATH_FSTAB
515564b641eSMatthew N. Doddwill not be honored if the process environment or memory address space is
5160e9efd19SChristian Bruefferconsidered
517564b641eSMatthew N. Dodd.Dq tainted .
518564b641eSMatthew N. Dodd(See
519a0b6213bSRuslan Ermilov.Xr issetugid 2
520564b641eSMatthew N. Doddfor more information.)
521ef258dd9SMatthew N. Dodd.El
5228fae3551SRodney W. Grimes.Sh FILES
5238fae3551SRodney W. Grimes.Bl -tag -width /etc/fstab -compact
5248fae3551SRodney W. Grimes.It Pa /etc/fstab
5258fae3551SRodney W. Grimesfile system table
5268fae3551SRodney W. Grimes.El
5276087df9eSRuslan Ermilov.Sh DIAGNOSTICS
5286087df9eSRuslan ErmilovVarious, most of them are self-explanatory.
5296087df9eSRuslan Ermilov.Pp
5306087df9eSRuslan Ermilov.Dl XXXXX file system is not available
5316087df9eSRuslan Ermilov.Pp
5326087df9eSRuslan ErmilovThe kernel does not support the respective file system type.
5336087df9eSRuslan ErmilovNote that
5346087df9eSRuslan Ermilovsupport for a particular file system might be provided either on a static
5356087df9eSRuslan Ermilov(kernel compile-time), or dynamic basis (loaded as a kernel module by
5366087df9eSRuslan Ermilov.Xr kldload 8 ) .
5378fae3551SRodney W. Grimes.Sh SEE ALSO
538ed1b9fc9STom Rhodes.Xr getfacl 1 ,
539ed1b9fc9STom Rhodes.Xr setfacl 1 ,
5407c5347aeSCraig Rodrigues.Xr nmount 2 ,
541ed1b9fc9STom Rhodes.Xr acl 3 ,
542ed1b9fc9STom Rhodes.Xr mac 4 ,
5437f482407SJilles Tjoelker.Xr devfs 5 ,
544c002dbe6SCraig Rodrigues.Xr ext2fs 5 ,
5458266d476SRuslan Ermilov.Xr fstab 5 ,
546067eb35dSCraig Rodrigues.Xr procfs 5 ,
5478266d476SRuslan Ermilov.Xr kldload 8 ,
5488fae3551SRodney W. Grimes.Xr mount_cd9660 8 ,
5494ccd7546SRuslan Ermilov.Xr mount_msdosfs 8 ,
5508fae3551SRodney W. Grimes.Xr mount_nfs 8 ,
5516ad10804SRuslan Ermilov.Xr mount_nullfs 8 ,
552b6925fa9SDavid Malone.Xr mount_udf 8 ,
5536ad10804SRuslan Ermilov.Xr mount_unionfs 8 ,
55440350c1bSEdward Tomasz Napierala.Xr umount 8 ,
55540350c1bSEdward Tomasz Napierala.Xr zfs 8 ,
55640350c1bSEdward Tomasz Napierala.Xr zpool 8
5570afc94c1SUlrich Spörlein.Sh HISTORY
5580afc94c1SUlrich SpörleinA
5590afc94c1SUlrich Spörlein.Nm
5600afc94c1SUlrich Spörleinutility appeared in
5610afc94c1SUlrich Spörlein.At v1 .
562ce602323SJoseph Koshy.Sh CAVEATS
5637f804728SRuslan ErmilovAfter a successful
5647f804728SRuslan Ermilov.Nm ,
5657f804728SRuslan Ermilovthe permissions on the original mount point determine if
5667f804728SRuslan Ermilov.Pa ..\&
5677f804728SRuslan Ermilovis accessible from the mounted file system.
5687f804728SRuslan ErmilovThe minimum permissions for
569ce602323SJoseph Koshythe mount point for traversal across the mount point in both
570ce602323SJoseph Koshydirections to be possible for all users is 0111 (execute for all).
5716d29a0b6SKonstantin Belousov.Pp
5726d29a0b6SKonstantin BelousovUse of the
5736d29a0b6SKonstantin Belousov.Nm
5746d29a0b6SKonstantin Belousovis preferred over the use of the file system specific
575ac14190eSRuslan Ermilov.Pa mount_ Ns Sy XXX
5766d29a0b6SKonstantin Belousovcommands.
577ac14190eSRuslan ErmilovIn particular,
578ac14190eSRuslan Ermilov.Xr mountd 8
579ac14190eSRuslan Ermilovgets a
580ac14190eSRuslan Ermilov.Dv SIGHUP
581ac14190eSRuslan Ermilovsignal (that causes an update of the export list)
5826d29a0b6SKonstantin Belousovonly when the file system is mounted via
5836d29a0b6SKonstantin Belousov.Nm .
5846087df9eSRuslan Ermilov.Sh BUGS
5856087df9eSRuslan ErmilovIt is possible for a corrupted file system to cause a crash.
586