xref: /freebsd/sbin/mount/mount.8 (revision e725ee7eb672a8501600552283d3d08a2f7b6847)
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.
12fbbd9655SWarner Losh.\" 3. 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.\"
31*e725ee7eSCameron Katri.Dd May 18, 2021
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
39*e725ee7eSCameron Katri.Op Fl -libxo
404b4f9170SDag-Erling Smørgrav.Op Fl adflpruvw
41ef258dd9SMatthew N. Dodd.Op Fl F Ar fstab
42c14d21f6SGuido van Rooij.Op Fl o Ar options
4370866c8dSMateusz Piotrowski.Op Fl t Oo Cm no Oc Ns Cm Ar type Ns Op Cm , Ns Ar type ...
447c7fb079SRuslan Ermilov.Nm
45*e725ee7eSCameron Katri.Op Fl -libxo
46a257a45eSJordan K. Hubbard.Op Fl dfpruvw
478fae3551SRodney W. Grimes.Ar special | node
487c7fb079SRuslan Ermilov.Nm
49*e725ee7eSCameron Katri.Op Fl -libxo
50a257a45eSJordan K. Hubbard.Op Fl dfpruvw
518fae3551SRodney W. Grimes.Op Fl o Ar options
5270866c8dSMateusz Piotrowski.Op Fl t Oo Cm no Oc Ns Cm Ar type Ns Op Cm , Ns Ar type ...
538fae3551SRodney W. Grimes.Ar special node
548fae3551SRodney W. Grimes.Sh DESCRIPTION
558fae3551SRodney W. GrimesThe
56951122deSSteve Price.Nm
57e1205e80SPhilippe Charnierutility calls the
587c5347aeSCraig Rodrigues.Xr nmount 2
598fae3551SRodney W. Grimessystem call to prepare and graft a
608266d476SRuslan Ermilov.Ar special
618266d476SRuslan Ermilovdevice or the remote node (rhost:path) on to the file system tree at the point
628fae3551SRodney W. Grimes.Ar node .
638fae3551SRodney W. GrimesIf either
648fae3551SRodney W. Grimes.Ar special
658fae3551SRodney W. Grimesor
668fae3551SRodney W. Grimes.Ar node
678fae3551SRodney W. Grimesare not provided, the appropriate information is taken from the
688fae3551SRodney W. Grimes.Xr fstab 5
698fae3551SRodney W. Grimesfile.
708fae3551SRodney W. Grimes.Pp
718fae3551SRodney W. GrimesThe system maintains a list of currently mounted file systems.
728fae3551SRodney W. GrimesIf no arguments are given to
737c7fb079SRuslan Ermilov.Nm ,
748fae3551SRodney W. Grimesthis list is printed.
758fae3551SRodney W. Grimes.Pp
768fae3551SRodney W. GrimesThe options are as follows:
778fae3551SRodney W. Grimes.Bl -tag -width indent
78*e725ee7eSCameron Katri.It Fl -libxo
79*e725ee7eSCameron KatriGenerate output via
80*e725ee7eSCameron Katri.Xr libxo 3
81*e725ee7eSCameron Katriin a selection of different human and machine readable formats.
82*e725ee7eSCameron KatriSee
83*e725ee7eSCameron Katri.Xr xo_parse_args 3
84*e725ee7eSCameron Katrifor details on command line arguments.
85c4e95187SDavid Greenman.It Fl a
86c06fe0a0SPeter WemmAll the file systems described in
87c06fe0a0SPeter Wemm.Xr fstab 5
88c06fe0a0SPeter Wemmare mounted.
897f804728SRuslan ErmilovExceptions are those marked as
908266d476SRuslan Ermilov.Dq Li noauto ,
914b4f9170SDag-Erling Smørgravthose marked as
928266d476SRuslan Ermilov.Dq Li late
934b4f9170SDag-Erling Smørgrav(unless the
944b4f9170SDag-Erling Smørgrav.Fl l
954b4f9170SDag-Erling Smørgravoption was specified),
964b4f9170SDag-Erling Smørgravthose excluded by the
97c06fe0a0SPeter Wemm.Fl t
98fba1c154SSteve Priceflag (see below), or if they are already mounted (except the
99fba1c154SSteve Priceroot file system which is always remounted to preserve
100fba1c154SSteve Pricetraditional single user mode behavior).
1018fae3551SRodney W. Grimes.It Fl d
1028fae3551SRodney W. GrimesCauses everything to be done except for the actual system call.
1038fae3551SRodney W. GrimesThis option is useful in conjunction with the
1048fae3551SRodney W. Grimes.Fl v
1058fae3551SRodney W. Grimesflag to
1068fae3551SRodney W. Grimesdetermine what the
107951122deSSteve Price.Nm
1088fae3551SRodney W. Grimescommand is trying to do.
109ef258dd9SMatthew N. Dodd.It Fl F Ar fstab
110ef258dd9SMatthew N. DoddSpecify the
111ef258dd9SMatthew N. Dodd.Pa fstab
112ef258dd9SMatthew N. Doddfile to use.
1138fae3551SRodney W. Grimes.It Fl f
1148fae3551SRodney W. GrimesForces the revocation of write access when trying to downgrade
115ef8f7ac9SSheldon Hearna file system mount status from read-write to read-only.
116ef8f7ac9SSheldon HearnAlso
1171469eec8SDavid Greenmanforces the R/W mount of an unclean file system (dangerous; use with
1181469eec8SDavid Greenmancaution).
119b48b774fSChris Rees.It Fl L
120b48b774fSChris ReesWhen used in conjunction with the
121b48b774fSChris Rees.Fl a
122b48b774fSChris Reesoption, mount
123b48b774fSChris Rees.Em only
124b48b774fSChris Reesthose file systems which are marked as
125b48b774fSChris Rees.Dq Li late .
1264b4f9170SDag-Erling Smørgrav.It Fl l
1274b4f9170SDag-Erling SmørgravWhen used in conjunction with the
1284b4f9170SDag-Erling Smørgrav.Fl a
1294b4f9170SDag-Erling Smørgravoption, also mount those file systems which are marked as
1308266d476SRuslan Ermilov.Dq Li late .
131fc98db27SRobert Millan.It Fl n
132fc98db27SRobert MillanFor compatibility with some other implementations, this flag is
133fc98db27SRobert Millancurrently a no-op.
1348fae3551SRodney W. Grimes.It Fl o
1358fae3551SRodney W. GrimesOptions are specified with a
1368fae3551SRodney W. Grimes.Fl o
1378fae3551SRodney W. Grimesflag followed by a comma separated string of options.
13818af6044SJoseph KoshyIn case of conflicting options being specified, the rightmost option
13918af6044SJoseph Koshytakes effect.
1408fae3551SRodney W. GrimesThe following options are available:
1418fae3551SRodney W. Grimes.Bl -tag -width indent
142f00a5dbdSTom Rhodes.It Cm acls
1439340fc72SEdward Tomasz NapieralaEnable POSIX.1e Access Control Lists, or ACLs, which can be customized via the
144f00a5dbdSTom Rhodes.Xr setfacl 1
145f00a5dbdSTom Rhodesand
146f00a5dbdSTom Rhodes.Xr getfacl 1
147f00a5dbdSTom Rhodescommands.
1489340fc72SEdward Tomasz NapieralaThis flag is mutually exclusive with
1499340fc72SEdward Tomasz Napierala.Cm nfsv4acls
1509340fc72SEdward Tomasz Napieralaflag.
1517f804728SRuslan Ermilov.It Cm async
15270866c8dSMateusz PiotrowskiAll I/O to the file system should be done asynchronously.
1538fae3551SRodney W. GrimesThis is a
1548fae3551SRodney W. Grimes.Em dangerous
155d6649c25SDaniel Gerzoflag to set, since it does not guarantee that the file system structure
156d6649c25SDaniel Gerzoon the disk will remain consistent.
157d6649c25SDaniel GerzoFor this reason, the
158d6649c25SDaniel Gerzo.Cm async
159d6649c25SDaniel Gerzoflag should be used sparingly, and only when some data recovery
160d6649c25SDaniel Gerzomechanism is present.
161543bed93SEdward Tomasz Napierala.It Cm automounted
162543bed93SEdward Tomasz NapieralaThis flag indicates that the file system was mounted by
163543bed93SEdward Tomasz Napierala.Xr automountd 8 .
164543bed93SEdward Tomasz NapieralaAutomounted file systems are automatically unmounted by
165543bed93SEdward Tomasz Napierala.Xr autounmountd 8 .
16631260bf0SAndriy Gapon.It Cm autoro
16731260bf0SAndriy GaponMount the file system read-write.
16831260bf0SAndriy GaponIf that fails with an error that suggests that the media could be read-only,
16931260bf0SAndriy Gaponthen automatically try to mount the file system read-only.
1707f804728SRuslan Ermilov.It Cm current
17118af6044SJoseph KoshyWhen used with the
17218af6044SJoseph Koshy.Fl u
17318af6044SJoseph Koshyflag, this is the same as specifying the options currently in effect for
17418af6044SJoseph Koshythe mounted file system.
175ba7a55d9SSean Eric Fagan.It Cm emptydir
176ba7a55d9SSean Eric FaganRequire that the mount point directory be empty.
1777f804728SRuslan Ermilov.It Cm force
1788fae3551SRodney W. GrimesThe same as
1798fae3551SRodney W. Grimes.Fl f ;
1808fae3551SRodney W. Grimesforces the revocation of write access when trying to downgrade
181ef8f7ac9SSheldon Hearna file system mount status from read-write to read-only.
182ef8f7ac9SSheldon HearnAlso
1831469eec8SDavid Greenmanforces the R/W mount of an unclean file system (dangerous; use with caution).
1847f804728SRuslan Ermilov.It Cm fstab
18518af6044SJoseph KoshyWhen used with the
18618af6044SJoseph Koshy.Fl u
18718af6044SJoseph Koshyflag, this is the same as specifying all the options listed in the
18818af6044SJoseph Koshy.Xr fstab 5
18918af6044SJoseph Koshyfile for the file system.
1904b4f9170SDag-Erling Smørgrav.It Cm late
1914b4f9170SDag-Erling SmørgravThis file system should be skipped when
19274109472SDag-Erling Smørgrav.Nm
19374109472SDag-Erling Smørgravis run with the
1944b4f9170SDag-Erling Smørgrav.Fl a
1954b4f9170SDag-Erling Smørgravflag but without the
1964b4f9170SDag-Erling Smørgrav.Fl l
1974b4f9170SDag-Erling Smørgravflag.
198c7835769SCraig Rodrigues.It Cm mountprog Ns = Ns Aq Ar program
199c7835769SCraig RodriguesForce
200c7835769SCraig Rodrigues.Nm
201c7835769SCraig Rodriguesto use the specified program to mount the file system, instead of calling
202c7835769SCraig Rodrigues.Xr nmount 2
20342923317SEitan Adlerdirectly.
20442923317SEitan AdlerFor example:
205c7835769SCraig Rodrigues.Bd -literal
2060b0d825aSEnji Coopermount -t foofs -o mountprog=/mydir/fooprog /dev/cd0 /mnt
207c7835769SCraig Rodrigues.Ed
208f00a5dbdSTom Rhodes.It Cm multilabel
20990b9e3f1SRobert WatsonEnable multi-label Mandatory Access Control, or MAC, on the specified file
21090b9e3f1SRobert Watsonsystem.
21190b9e3f1SRobert WatsonIf the file system supports multilabel operation, individual labels will
21290b9e3f1SRobert Watsonbe maintained for each object in the file system, rather than using a
2138e5c1e59SJosef El-Rayessingle label for all objects.
214d04b5dfeSRuslan ErmilovAn alternative to the
215d04b5dfeSRuslan Ermilov.Fl l
216f00a5dbdSTom Rhodesflag in
217f00a5dbdSTom Rhodes.Xr tunefs 8 .
218f00a5dbdSTom RhodesSee
219f00a5dbdSTom Rhodes.Xr mac 4
22090b9e3f1SRobert Watsonfor more information, which cause the multilabel mount flag to be set
22190b9e3f1SRobert Watsonautomatically at mount-time.
2229340fc72SEdward Tomasz Napierala.It Cm nfsv4acls
2239340fc72SEdward Tomasz NapieralaEnable NFSv4 ACLs, which can be customized via the
2249340fc72SEdward Tomasz Napierala.Xr setfacl 1
2259340fc72SEdward Tomasz Napieralaand
2269340fc72SEdward Tomasz Napierala.Xr getfacl 1
2279340fc72SEdward Tomasz Napieralacommands.
2289340fc72SEdward Tomasz NapieralaThis flag is mutually exclusive with
2299340fc72SEdward Tomasz Napierala.Cm acls
2309340fc72SEdward Tomasz Napieralaflag.
2317f804728SRuslan Ermilov.It Cm noasync
232534e0080SDavid E. O'BrienMetadata I/O should be done synchronously, while data I/O should be done
2337f804728SRuslan Ermilovasynchronously.
2347f804728SRuslan ErmilovThis is the default.
2357f804728SRuslan Ermilov.It Cm noatime
236ef8f7ac9SSheldon HearnDo not update the file access time when reading from a file.
237ef8f7ac9SSheldon HearnThis option
238fa947154SDavid Greenmanis useful on file systems where there are large numbers of files and
239fa947154SDavid Greenmanperformance is more critical than updating the file access time (which is
2407f804728SRuslan Ermilovrarely ever important).
2412960733fSDoug BartonThis option is currently only supported on local file systems.
2427f804728SRuslan Ermilov.It Cm noauto
2437f804728SRuslan ErmilovThis file system should be skipped when
2447f804728SRuslan Ermilov.Nm
2457f804728SRuslan Ermilovis run with the
246c06fe0a0SPeter Wemm.Fl a
247c06fe0a0SPeter Wemmflag.
2487f804728SRuslan Ermilov.It Cm noclusterr
24975b714acSKATO TakenoriDisable read clustering.
2507f804728SRuslan Ermilov.It Cm noclusterw
25175b714acSKATO TakenoriDisable write clustering.
252ba7a55d9SSean Eric Fagan.It Cm nocover
253ba7a55d9SSean Eric FaganDo not mount if the requested mount point is already
254ba7a55d9SSean Eric Faganthe root of a mount point.
2557f804728SRuslan Ermilov.It Cm noexec
2568fae3551SRodney W. GrimesDo not allow execution of any binaries on the mounted file system.
2578fae3551SRodney W. GrimesThis option is useful for a server that has file systems containing
2588fae3551SRodney W. Grimesbinaries for architectures other than its own.
25918a3dd1eSColin PercivalNote: This option was not designed as a security feature and no
26018a3dd1eSColin Percivalguarantee is made that it will prevent malicious code execution; for
26118a3dd1eSColin Percivalexample, it is still possible to execute scripts which reside on a
26218a3dd1eSColin Percival.Cm noexec
26318a3dd1eSColin Percivalmounted partition.
2647f804728SRuslan Ermilov.It Cm nosuid
2658fae3551SRodney W. GrimesDo not allow set-user-identifier or set-group-identifier bits to take effect.
266b23472acSWolfram SchneiderNote: this option is worthless if a public available suid or sgid
267b23472acSWolfram Schneiderwrapper like
268951122deSSteve Price.Xr suidperl 1
269b23472acSWolfram Schneideris installed on your system.
270b4206324SJoerg WunschIt is set automatically when the user does not have super-user privileges.
2717f804728SRuslan Ermilov.It Cm nosymfollow
2725ddc8dedSWolfram SchneiderDo not follow symlinks
2735ddc8dedSWolfram Schneideron the mounted file system.
274c80f12d0SSean Chittenden.It Cm ro
2758fae3551SRodney W. GrimesThe same as
2768fae3551SRodney W. Grimes.Fl r ;
2778fae3551SRodney W. Grimesmount the file system read-only (even the super-user may not write it).
278299f1561STom Rhodes.It Cm snapshot
279299f1561STom RhodesThis option allows a snapshot of the specified file system to be taken.
280299f1561STom RhodesThe
281299f1561STom Rhodes.Fl u
282299f1561STom Rhodesflag is required with this option.
283299f1561STom RhodesNote that snapshot files must be created in the file system that is being
284299f1561STom Rhodessnapshotted.
285299f1561STom RhodesYou may create up to 20 snapshots per file system.
286299f1561STom RhodesActive snapshots are recorded in the superblock, so they persist across unmount
287299f1561STom Rhodesand remount operations and across system reboots.
288299f1561STom RhodesWhen you are done with a snapshot, it can be removed with the
2899acd9d01SRuslan Ermilov.Xr rm 1
290299f1561STom Rhodescommand.
291299f1561STom RhodesSnapshots may be removed in any order, however you may not get back all the
292299f1561STom Rhodesspace contained in the snapshot as another snapshot may claim some of the blocks
293299f1561STom Rhodesthat it is releasing.
294299f1561STom RhodesNote that the schg flag is set on snapshots to ensure that not even the root
295299f1561STom Rhodesuser can write to them.
296299f1561STom RhodesThe unlink command makes an exception for snapshot files in that it allows them
297299f1561STom Rhodesto be removed even though they have the schg flag set, so it is not necessary to
298299f1561STom Rhodesclear the schg flag before removing a snapshot file.
299299f1561STom Rhodes.Pp
300299f1561STom RhodesOnce you have taken a snapshot, there are three interesting things that you can
301299f1561STom Rhodesdo with it:
302299f1561STom Rhodes.Pp
303299f1561STom Rhodes.Bl -enum -compact
304299f1561STom Rhodes.It
3059acd9d01SRuslan ErmilovRun
3069acd9d01SRuslan Ermilov.Xr fsck 8
3079acd9d01SRuslan Ermilovon the snapshot file.
308299f1561STom RhodesAssuming that the file system was clean when it was mounted, you should always
309299f1561STom Rhodesget a clean (and unchanging) result from running fsck on the snapshot.
310299f1561STom RhodesThis is essentially what the background fsck process does.
311299f1561STom Rhodes.Pp
312299f1561STom Rhodes.It
3139acd9d01SRuslan ErmilovRun
3149acd9d01SRuslan Ermilov.Xr dump 8
3159acd9d01SRuslan Ermilovon the snapshot.
316299f1561STom RhodesYou will get a dump that is consistent with the file system as of the timestamp
317299f1561STom Rhodesof the snapshot.
318299f1561STom Rhodes.Pp
319299f1561STom Rhodes.It
320299f1561STom RhodesMount the snapshot as a frozen image of the file system.
321299f1561STom RhodesTo mount the snapshot
322299f1561STom Rhodes.Pa /var/snapshot/snap1 :
323299f1561STom Rhodes.Bd -literal
324299f1561STom Rhodesmdconfig -a -t vnode -f /var/snapshot/snap1 -u 4
325299f1561STom Rhodesmount -r /dev/md4 /mnt
326299f1561STom Rhodes.Ed
327299f1561STom Rhodes.Pp
328299f1561STom RhodesYou can now cruise around your frozen
329299f1561STom Rhodes.Pa /var
330299f1561STom Rhodesfile system at
331299f1561STom Rhodes.Pa /mnt .
332299f1561STom RhodesEverything will be in the same state that it was at the time the snapshot was
333299f1561STom Rhodestaken.
334299f1561STom RhodesThe one exception is that any earlier snapshots will appear as zero length
335299f1561STom Rhodesfiles.
336299f1561STom RhodesWhen you are done with the mounted snapshot:
337299f1561STom Rhodes.Bd -literal
338299f1561STom Rhodesumount /mnt
339299f1561STom Rhodesmdconfig -d -u 4
340299f1561STom Rhodes.Ed
341299f1561STom Rhodes.El
3427f804728SRuslan Ermilov.It Cm suiddir
34352bf64c7SJulian ElischerA directory on the mounted file system will respond to the SUID bit
34452bf64c7SJulian Elischerbeing set, by setting the owner of any new files to be the same
34552bf64c7SJulian Elischeras the owner of the directory.
34652bf64c7SJulian ElischerNew directories will inherit the bit from their parents.
34752bf64c7SJulian ElischerExecute bits are removed from
34852bf64c7SJulian Elischerthe file, and it will not be given to root.
34952bf64c7SJulian Elischer.Pp
35052bf64c7SJulian ElischerThis feature is designed for use on fileservers serving PC users via
351ef8f7ac9SSheldon Hearnftp, SAMBA, or netatalk.
352ef8f7ac9SSheldon HearnIt provides security holes for shell users and as
35352bf64c7SJulian Elischersuch should not be used on shell machines, especially on home directories.
35452bf64c7SJulian ElischerThis option requires the SUIDDIR
355ef8f7ac9SSheldon Hearnoption in the kernel to work.
356ef8f7ac9SSheldon HearnOnly UFS file systems support this option.
35752bf64c7SJulian ElischerSee
35852bf64c7SJulian Elischer.Xr chmod 2
35952bf64c7SJulian Elischerfor more information.
360ef37e89dSJohn Baldwin.It Cm sync
36170866c8dSMateusz PiotrowskiAll I/O to the file system should be done synchronously.
3627f804728SRuslan Ermilov.It Cm update
3638fae3551SRodney W. GrimesThe same as
3648fae3551SRodney W. Grimes.Fl u ;
3658fae3551SRodney W. Grimesindicate that the status of an already mounted file system should be changed.
3667f804728SRuslan Ermilov.It Cm union
3678fae3551SRodney W. GrimesCauses the namespace at the mount point to appear as the union
3688fae3551SRodney W. Grimesof the mounted file system root and the existing directory.
3698fae3551SRodney W. GrimesLookups will be done in the mounted file system first.
3708fae3551SRodney W. GrimesIf those operations fail due to a non-existent file the underlying
3718fae3551SRodney W. Grimesdirectory is then accessed.
3728fae3551SRodney W. GrimesAll creates are done in the mounted file system.
373daba4da8SKirk McKusick.It Cm untrusted
374daba4da8SKirk McKusickThe file system is untrusted and the kernel should use more
375daba4da8SKirk McKusickextensive checks on the file-system's metadata before using it.
376daba4da8SKirk McKusickThis option is intended to be used when mounting file systems
377daba4da8SKirk McKusickfrom untrusted media such as USB memory sticks or other
378daba4da8SKirk McKusickexternally-provided media.
3798fae3551SRodney W. Grimes.El
3808fae3551SRodney W. Grimes.Pp
3818fae3551SRodney W. GrimesAny additional options specific to a file system type that is not
3828fae3551SRodney W. Grimesone of the internally known types (see the
3838fae3551SRodney W. Grimes.Fl t
3848fae3551SRodney W. Grimesoption) may be passed as a comma separated list; these options are
3858fae3551SRodney W. Grimesdistinguished by a leading
3868fae3551SRodney W. Grimes.Dq \&-
3878fae3551SRodney W. Grimes(dash).
388951122deSSteve PriceFor example, the
389951122deSSteve Price.Nm
390951122deSSteve Pricecommand:
3918fae3551SRodney W. Grimes.Bd -literal -offset indent
3923592acb1STom McLaughlinmount -t cd9660 -o -e /dev/cd0 /cdrom
3938fae3551SRodney W. Grimes.Ed
3948fae3551SRodney W. Grimes.Pp
3958fae3551SRodney W. Grimescauses
396951122deSSteve Price.Nm
3978fae3551SRodney W. Grimesto execute the equivalent of:
3988fae3551SRodney W. Grimes.Bd -literal -offset indent
3993592acb1STom McLaughlin/sbin/mount_cd9660 -e /dev/cd0 /cdrom
4008fae3551SRodney W. Grimes.Ed
401e4bc2e34SSheldon Hearn.Pp
402d452fb8aSGavin AtkinsonOptions that take a value are specified using the -option=value syntax:
403d452fb8aSGavin Atkinson.Bd -literal -offset indent
404d452fb8aSGavin Atkinsonmount -t msdosfs -o -u=fred,-g=wheel /dev/da0s1 /mnt
405d452fb8aSGavin Atkinson.Ed
406d452fb8aSGavin Atkinson.Pp
407d452fb8aSGavin Atkinsonis equivalent to
408d452fb8aSGavin Atkinson.Bd -literal -offset indent
409d452fb8aSGavin Atkinson/sbin/mount_msdosfs -u fred -g wheel /dev/da0s1 /mnt
410d452fb8aSGavin Atkinson.Ed
411d452fb8aSGavin Atkinson.Pp
412e4bc2e34SSheldon HearnAdditional options specific to file system types
413e4bc2e34SSheldon Hearnwhich are not internally known
414e4bc2e34SSheldon Hearn(see the description of the
415e4bc2e34SSheldon Hearn.Fl t
416e4bc2e34SSheldon Hearnoption below)
417e4bc2e34SSheldon Hearnmay be described in the manual pages for the associated
418e4bc2e34SSheldon Hearn.Pa /sbin/mount_ Ns Sy XXX
419e4bc2e34SSheldon Hearnutilities.
420a257a45eSJordan K. Hubbard.It Fl p
4217f804728SRuslan ErmilovPrint mount information in
4227f804728SRuslan Ermilov.Xr fstab 5
4237f804728SRuslan Ermilovformat.
424ef8f7ac9SSheldon HearnImplies also the
425a257a45eSJordan K. Hubbard.Fl v
426a257a45eSJordan K. Hubbardoption.
4278fae3551SRodney W. Grimes.It Fl r
4288fae3551SRodney W. GrimesThe file system is to be mounted read-only.
4298fae3551SRodney W. GrimesMount the file system read-only (even the super-user may not write it).
4308fae3551SRodney W. GrimesThe same as the
431c80f12d0SSean Chittenden.Cm ro
4328fae3551SRodney W. Grimesargument to the
4338fae3551SRodney W. Grimes.Fl o
4348fae3551SRodney W. Grimesoption.
43570866c8dSMateusz Piotrowski.It Fl t Oo Cm no Oc Ns Cm Ar type Ns Op Cm , Ns Ar type ...
4368fae3551SRodney W. GrimesThe argument following the
4378fae3551SRodney W. Grimes.Fl t
4388fae3551SRodney W. Grimesis used to indicate the file system type.
4398fae3551SRodney W. GrimesThe type
4408266d476SRuslan Ermilov.Cm ufs
4418fae3551SRodney W. Grimesis the default.
44293eb5567SGarrett WollmanThe
44393eb5567SGarrett Wollman.Fl t
44493eb5567SGarrett Wollmanoption can be used
4458fae3551SRodney W. Grimesto indicate that the actions should only be taken on
4468fae3551SRodney W. Grimesfile systems of the specified type.
4478fae3551SRodney W. GrimesMore than one type may be specified in a comma separated list.
4488fae3551SRodney W. GrimesThe list of file system types can be prefixed with
44970866c8dSMateusz Piotrowski.Cm no
4508fae3551SRodney W. Grimesto specify the file system types for which action should
4518fae3551SRodney W. Grimes.Em not
4528fae3551SRodney W. Grimesbe taken.
4538fae3551SRodney W. GrimesFor example, the
454951122deSSteve Price.Nm
4558fae3551SRodney W. Grimescommand:
4568fae3551SRodney W. Grimes.Bd -literal -offset indent
4570b381bf1SRuslan Ermilovmount -a -t nonfs,nullfs
4588fae3551SRodney W. Grimes.Ed
4598fae3551SRodney W. Grimes.Pp
46070866c8dSMateusz Piotrowskimounts all file systems except those of type NFS and NULLFS.
4618fae3551SRodney W. Grimes.Pp
4627c5347aeSCraig RodriguesThe default behavior of
463951122deSSteve Price.Nm
4647c5347aeSCraig Rodriguesis to pass the
4657c5347aeSCraig Rodrigues.Fl t
4667c5347aeSCraig Rodriguesoption directly to the
4677c5347aeSCraig Rodrigues.Xr nmount 2
4687c5347aeSCraig Rodriguessystem call in the
4697c5347aeSCraig Rodrigues.Li fstype
4707c5347aeSCraig Rodriguesoption.
4717c5347aeSCraig Rodrigues.Pp
4727c5347aeSCraig RodriguesHowever, for the following file system types:
4738266d476SRuslan Ermilov.Cm cd9660 ,
4748266d476SRuslan Ermilov.Cm mfs ,
4758266d476SRuslan Ermilov.Cm msdosfs ,
4768266d476SRuslan Ermilov.Cm nfs ,
4778266d476SRuslan Ermilov.Cm nullfs ,
478237abf0cSDavide Italiano.Cm smbfs ,
4798266d476SRuslan Ermilov.Cm udf ,
4807c5347aeSCraig Rodriguesand
48170866c8dSMateusz Piotrowski.Cm unionfs
4827c5347aeSCraig Rodrigues.Nm
4837c5347aeSCraig Rodrigueswill not call
4847c5347aeSCraig Rodrigues.Xr nmount 2
4857c5347aeSCraig Rodriguesdirectly and will instead attempt to execute a program in
48670866c8dSMateusz Piotrowski.Pa /sbin/mount_ Ns Ar type
4878fae3551SRodney W. Grimeswhere
48870866c8dSMateusz Piotrowski.Ar type
4897c5347aeSCraig Rodriguesis replaced by the file system type name.
49070866c8dSMateusz PiotrowskiFor example,
49170866c8dSMateusz Piotrowski.Cm nfs
49270866c8dSMateusz Piotrowskifile systems are mounted by the program
4938fae3551SRodney W. Grimes.Pa /sbin/mount_nfs .
49493eb5567SGarrett Wollman.Pp
49526fbf78bSMaxime HenrionMost file systems will be dynamically loaded by the kernel
49626fbf78bSMaxime Henrionif not already present, and if the kernel module is available.
4978fae3551SRodney W. Grimes.It Fl u
4988fae3551SRodney W. GrimesThe
4998fae3551SRodney W. Grimes.Fl u
5008fae3551SRodney W. Grimesflag indicates that the status of an already mounted file
5018fae3551SRodney W. Grimessystem should be changed.
5028fae3551SRodney W. GrimesAny of the options discussed above (the
5038fae3551SRodney W. Grimes.Fl o
5048fae3551SRodney W. Grimesoption)
5058fae3551SRodney W. Grimesmay be changed;
5068fae3551SRodney W. Grimesalso a file system can be changed from read-only to read-write
5078fae3551SRodney W. Grimesor vice versa.
5088fae3551SRodney W. GrimesAn attempt to change from read-write to read-only will fail if any
5098fae3551SRodney W. Grimesfiles on the file system are currently open for writing unless the
5108fae3551SRodney W. Grimes.Fl f
5118fae3551SRodney W. Grimesflag is also specified.
51218af6044SJoseph KoshyThe set of options is determined by applying the options specified
51318af6044SJoseph Koshyin the argument to
5148fae3551SRodney W. Grimes.Fl o
5158fae3551SRodney W. Grimesand finally applying the
5168fae3551SRodney W. Grimes.Fl r
5178fae3551SRodney W. Grimesor
5188fae3551SRodney W. Grimes.Fl w
5198fae3551SRodney W. Grimesoption.
5208fae3551SRodney W. Grimes.It Fl v
5218fae3551SRodney W. GrimesVerbose mode.
5228abb2a6eSPawel Jakub DawidekIf the
5238abb2a6eSPawel Jakub Dawidek.Fl v
5248abb2a6eSPawel Jakub Dawidekis used alone, show all file systems, including those that were mounted with the
5258abb2a6eSPawel Jakub Dawidek.Dv MNT_IGNORE
5268abb2a6eSPawel Jakub Dawidekflag and show additional information about each file system (including fsid
5278abb2a6eSPawel Jakub Dawidekwhen run by root).
5288fae3551SRodney W. Grimes.It Fl w
5298fae3551SRodney W. GrimesThe file system object is to be read and write.
5301252c1bbSRuslan Ermilov.El
531ef258dd9SMatthew N. Dodd.Sh ENVIRONMENT
532a0b6213bSRuslan Ermilov.Bl -tag -width ".Ev PATH_FSTAB"
533a0b6213bSRuslan Ermilov.It Ev PATH_FSTAB
534ef258dd9SMatthew N. DoddIf the environment variable
535a0b6213bSRuslan Ermilov.Ev PATH_FSTAB
536a0b6213bSRuslan Ermilovis set, all operations are performed against the specified file.
537a0b6213bSRuslan Ermilov.Ev PATH_FSTAB
538564b641eSMatthew N. Doddwill not be honored if the process environment or memory address space is
5390e9efd19SChristian Bruefferconsidered
540564b641eSMatthew N. Dodd.Dq tainted .
541564b641eSMatthew N. Dodd(See
542a0b6213bSRuslan Ermilov.Xr issetugid 2
543564b641eSMatthew N. Doddfor more information.)
544ef258dd9SMatthew N. Dodd.El
5458fae3551SRodney W. Grimes.Sh FILES
5468fae3551SRodney W. Grimes.Bl -tag -width /etc/fstab -compact
5478fae3551SRodney W. Grimes.It Pa /etc/fstab
5488fae3551SRodney W. Grimesfile system table
5498fae3551SRodney W. Grimes.El
5506087df9eSRuslan Ermilov.Sh DIAGNOSTICS
5516087df9eSRuslan ErmilovVarious, most of them are self-explanatory.
5526087df9eSRuslan Ermilov.Pp
5536087df9eSRuslan Ermilov.Dl XXXXX file system is not available
5546087df9eSRuslan Ermilov.Pp
5556087df9eSRuslan ErmilovThe kernel does not support the respective file system type.
5566087df9eSRuslan ErmilovNote that
5576087df9eSRuslan Ermilovsupport for a particular file system might be provided either on a static
5586087df9eSRuslan Ermilov(kernel compile-time), or dynamic basis (loaded as a kernel module by
5596087df9eSRuslan Ermilov.Xr kldload 8 ) .
5608fae3551SRodney W. Grimes.Sh SEE ALSO
561ed1b9fc9STom Rhodes.Xr getfacl 1 ,
562ed1b9fc9STom Rhodes.Xr setfacl 1 ,
5637c5347aeSCraig Rodrigues.Xr nmount 2 ,
564ed1b9fc9STom Rhodes.Xr acl 3 ,
565*e725ee7eSCameron Katri.Xr libxo 3 ,
566*e725ee7eSCameron Katri.Xr xo_parse_args 3 ,
567ed1b9fc9STom Rhodes.Xr mac 4 ,
568acc3e913SEnji Cooper.Xr cd9660 5 ,
5697f482407SJilles Tjoelker.Xr devfs 5 ,
570c002dbe6SCraig Rodrigues.Xr ext2fs 5 ,
5718266d476SRuslan Ermilov.Xr fstab 5 ,
572067eb35dSCraig Rodrigues.Xr procfs 5 ,
573c09eb466SJoel Dahl.Xr tmpfs 5 ,
5749df66c85SEdward Tomasz Napierala.Xr automount 8 ,
575be3a49eeSEdward Tomasz Napierala.Xr fstyp 8 ,
5768266d476SRuslan Ermilov.Xr kldload 8 ,
5778fae3551SRodney W. Grimes.Xr mount_cd9660 8 ,
5784ccd7546SRuslan Ermilov.Xr mount_msdosfs 8 ,
5798fae3551SRodney W. Grimes.Xr mount_nfs 8 ,
5806ad10804SRuslan Ermilov.Xr mount_nullfs 8 ,
581237abf0cSDavide Italiano.Xr mount_smbfs 8 ,
582b6925fa9SDavid Malone.Xr mount_udf 8 ,
5836ad10804SRuslan Ermilov.Xr mount_unionfs 8 ,
58440350c1bSEdward Tomasz Napierala.Xr umount 8 ,
58540350c1bSEdward Tomasz Napierala.Xr zfs 8 ,
58640350c1bSEdward Tomasz Napierala.Xr zpool 8
5870afc94c1SUlrich Spörlein.Sh HISTORY
5880afc94c1SUlrich SpörleinA
5890afc94c1SUlrich Spörlein.Nm
5900afc94c1SUlrich Spörleinutility appeared in
5910afc94c1SUlrich Spörlein.At v1 .
592ce602323SJoseph Koshy.Sh CAVEATS
5937f804728SRuslan ErmilovAfter a successful
5947f804728SRuslan Ermilov.Nm ,
5957f804728SRuslan Ermilovthe permissions on the original mount point determine if
5967f804728SRuslan Ermilov.Pa ..\&
5977f804728SRuslan Ermilovis accessible from the mounted file system.
5987f804728SRuslan ErmilovThe minimum permissions for
599ce602323SJoseph Koshythe mount point for traversal across the mount point in both
600ce602323SJoseph Koshydirections to be possible for all users is 0111 (execute for all).
6016d29a0b6SKonstantin Belousov.Pp
6026d29a0b6SKonstantin BelousovUse of the
6036d29a0b6SKonstantin Belousov.Nm
6046d29a0b6SKonstantin Belousovis preferred over the use of the file system specific
605ac14190eSRuslan Ermilov.Pa mount_ Ns Sy XXX
6066d29a0b6SKonstantin Belousovcommands.
607ac14190eSRuslan ErmilovIn particular,
608ac14190eSRuslan Ermilov.Xr mountd 8
609ac14190eSRuslan Ermilovgets a
610ac14190eSRuslan Ermilov.Dv SIGHUP
611ac14190eSRuslan Ermilovsignal (that causes an update of the export list)
6126d29a0b6SKonstantin Belousovonly when the file system is mounted via
6136d29a0b6SKonstantin Belousov.Nm .
6146087df9eSRuslan Ermilov.Sh BUGS
6156087df9eSRuslan ErmilovIt is possible for a corrupted file system to cause a crash.
616