xref: /csrg-svn/sbin/mount/mount.8 (revision 67413)
163765Sbostic.\" Copyright (c) 1980, 1989, 1991, 1993
263765Sbostic.\"	The Regents of the University of California.  All rights reserved.
318892Smckusick.\"
449073Scael.\" %sccs.include.redist.roff%
518892Smckusick.\"
6*67413Smckusick.\"     @(#)mount.8	8.8 (Berkeley) 06/16/94
739328Smckusick.\"
849073Scael.Dd
949073Scael.Dt MOUNT 8
1049073Scael.Os BSD 4
1149073Scael.Sh NAME
1266169Sbostic.Nm mount
1366169Sbostic.Nd mount file systems
1449073Scael.Sh SYNOPSIS
1549073Scael.Nm mount
1666170Spendry.Op Fl adfruvw
1752113Smckusick.Op Fl t Ar ufs | lfs | external_type
1849073Scael.Nm mount
1966170Spendry.Op Fl dfruvw
2052113Smckusick.Ar special | node
2149073Scael.Nm mount
2266170Spendry.Op Fl dfruvw
2366459Sbostic.Op Fl o Ar options
2452113Smckusick.Op Fl t Ar ufs | lfs | external_type
2549073Scael.Ar special node
2649073Scael.Sh DESCRIPTION
2749073ScaelThe
2849073Scael.Nm mount
2949073Scaelcommand
3049073Scaelcalls the
3149073Scael.Xr mount 2
3249073Scaelsystem call to prepare and graft a
3366169Sbostic.Ar "special device"
3466169Sbosticor the remote node (rhost:path) on to the file system tree at the point
3566169Sbostic.Ar node .
3649073ScaelIf either
3749073Scael.Ar special
3849073Scaelor
3949073Scael.Ar node
4066169Sbosticare not provided, the appropriate information is taken from the
4149073Scael.Xr fstab 5
4249073Scaelfile.
4349073Scael.Pp
4449073ScaelThe system maintains a list of currently mounted file systems.
4549073ScaelIf no arguments are given to
4649073Scael.Nm mount,
4749073Scaelthis list is printed.
4849073Scael.Pp
4966169SbosticThe options are as follows:
5049073Scael.Bl -tag -width indent
51*67413Smckusick.It Fl a
52*67413SmckusickAll the filesystems described in
53*67413Smckusick.Xr fstab 5
54*67413Smckusickare mounted.
55*67413SmckusickExceptions are those marked as ``noauto'' or are excluded by the
56*67413Smckusick.Fl t
57*67413Smckusickflag (see below).
5856842Smckusick.It Fl d
5956842SmckusickCauses everything to be done except for the actual system call.
6049073ScaelThis option is useful in conjunction with the
6149073Scael.Fl v
6249073Scaelflag to
6339328Smckusickdetermine what the
6449073Scael.Nm mount
6539328Smckusickcommand is trying to do.
6656842Smckusick.It Fl f
6756842SmckusickForces the revocation of write access when trying to downgrade
6856842Smckusicka filesystem mount status from read-write to read-only.
6949073Scael.It Fl o
7049073ScaelOptions are specified with a
7149073Scael.Fl o
7266459Sbosticflag followed by a comma separated string of options.
7366459SbosticThe following options are available:
7449073Scael.Bl -tag -width indent
7566490Sbostic.It async
7666459SbosticAll
7766459Sbostic.Tn I/O
7866459Sbosticto the file system should be done asynchronously.
7966459SbosticThis is a
8066459Sbostic.Em dangerous
8166459Sbosticflag to set,
8266459Sbosticand should not be used unless you are prepared to recreate the file
8366459Sbosticsystem should your system crash.
8466459Sbostic.It force
8566459SbosticThe same as
8666459Sbostic.Fl f ;
8766459Sbosticforces the revocation of write access when trying to downgrade
8866459Sbostica filesystem mount status from read-write to read-only.
89*67413Smckusick.It noauto
90*67413SmckusickThis filesystem should be skipped when mount is run with the
91*67413Smckusick.Fl a
92*67413Smckusickflag.
9366459Sbostic.It nodev
9466459SbosticDo not interpret character or block special devices on the file system.
9566459SbosticThis option is useful for a server that has file systems containing
9666459Sbosticspecial devices for architectures other than its own.
9749073Scael.It noexec
9839328SmckusickDo not allow execution of any binaries on the mounted file system.
9966164SpendryThis option is useful for a server that has file systems containing
10039328Smckusickbinaries for architectures other than its own.
10149073Scael.It nosuid
10239328SmckusickDo not allow set-user-identifier or set-group-identifier bits to take effect.
10366459Sbostic.It rdonly
10466459SbosticThe same as
10566492Sbostic.Fl r ;
10666459Sbosticmount the file system read-only (even the super-user may not write it).
10766490Sbostic.It sync
10850767ScaelAll
10950767Scael.Tn I/O
11050767Scaelto the file system should be done synchronously.
11166459Sbostic.It update
11266459SbosticThe same as
11366459Sbostic.Fl u ;
11466459Sbosticindicate that the status of an already mounted file system should be changed.
11558987Spendry.It union
11658987SpendryCauses the namespace at the mount point to appear as the union
11758987Spendryof the mounted filesystem root and the existing directory.
11858987SpendryLookups will be done in the mounted filesystem first.
11958987SpendryIf those operations fail due to a non-existent file the underlying
12058987Spendrydirectory is then accessed.
12158987SpendryAll creates are done in the mounted filesystem.
12249073Scael.El
12366459Sbostic.Pp
12466459SbosticAny additional options specific to a filesystem type that is not
12566459Sbosticone of the internally known types (see the
12666459Sbostic.Fl t
12766459Sbosticoption) may be passed as a comma separated list; these options are
12866459Sbosticdistinguished by a leading
12966459Sbostic.Dq \&-
13066459Sbostic(dash).
13166459SbosticOptions that take a value are specified using the syntax -option=value.
13266459SbosticFor example, the mount command:
13366459Sbostic.Bd -literal -offset indent
13466459Sbosticmount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
13566459Sbostic.Ed
13666459Sbostic.Pp
13766459Sbosticcauses
13866459Sbostic.Nm mount
13966459Sbosticto execute the equivalent of:
14066459Sbostic.Bd -literal -offset indent
14166459Sbostic/sbin/mount_mfs -o nosuid -N -s 4000 /dev/dk0b /tmp
14266459Sbostic.Ed
14349073Scael.It Fl r
14466459SbosticThe file system is to be mounted read-only.
14566459SbosticMount the file system read-only (even the super-user may not write it).
14666459SbosticThe same as the
14766459Sbostic.Dq rdonly
14866459Sbosticargument to the
14966459Sbostic.Fl o
15066459Sbosticoption.
15152113Smckusick.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type"
15249073ScaelThe argument following the
15349073Scael.Fl t
15449073Scaelis used to indicate the file system type.
15549073ScaelThe type
15649073Scael.Ar ufs
15749073Scaelis the default.
15852113SmckusickThe \fI-t\fP option can be used
15952113Smckusickto indicate that the actions should only be taken on
16052113Smckusickfilesystems of the specified type.
16152113SmckusickMore than one type may be specified in a comma separated list.
16266169SbosticThe list of filesystem types can be prefixed with
16366169Sbostic.Dq no
16466169Sbosticto specify the filesystem types for which action should
16566169Sbostic.Em not
16666169Sbosticbe taken.
16749073ScaelFor example, the
16849073Scael.Nm mount
16949073Scaelcommand:
17049073Scael.Bd -literal -offset indent
17149073Scaelmount -a -t nonfs,mfs
17249073Scael.Ed
17349073Scael.Pp
17449073Scaelmounts all filesystems except those of type
17549073Scael.Tn NFS
17649073Scaeland
17749073Scael.Tn MFS .
17849073Scael.Pp
17949073ScaelIf the type is not one of the internally known types,
18049073Scaelmount will attempt to execute a program in
18149073Scael.Pa /sbin/mount_ Ns Em XXX
18249073Scaelwhere
18349073Scael.Em XXX
18449073Scaelis replaced by the type name.
18552113SmckusickFor example, nfs filesystems are mounted by the program
18652113Smckusick.Pa /sbin/mount_nfs .
18749073Scael.It Fl u
18849073ScaelThe
18949073Scael.Fl u
19049073Scaelflag indicates that the status of an already mounted file
19139466Smckusicksystem should be changed.
19249073ScaelAny of the options discussed above (the
19349073Scael.Fl o
19449073Scaeloption)
19549073Scaelmay be changed;
19656842Smckusickalso a file system can be changed from read-only to read-write
19756842Smckusickor vice versa.
19856842SmckusickAn attempt to change from read-write to read-only will fail if any
19956842Smckusickfiles on the filesystem are currently open for writing unless the
20056842Smckusick.Fl f
20156842Smckusickflag is also specified.
20239466SmckusickThe set of options is determined by first extracting the options
20349073Scaelfor the file system from the
20449073Scael.Xr fstab
20549073Scaeltable,
20649073Scaelthen applying any options specified by the
20749073Scael.Fl o
20849073Scaelargument,
20949073Scaeland finally applying the
21049073Scael.Fl r
21149073Scaelor
21249073Scael.Fl w
21349073Scaeloption.
21449073Scael.It Fl v
21549073ScaelVerbose mode.
21649073Scael.It Fl w
21749073ScaelThe file system object is to be read and write.
21849073Scael.Pp
21952113SmckusickThe options specific to NFS filesystems are described in the
22052113Smckusick.Xr mount_nfs 8
22152113Smckusickmanual page.
22249073Scael.Sh FILES
22349073Scael.Bl -tag -width /etc/fstab -compact
22449073Scael.It Pa /etc/fstab
22549073Scaelfile system table
22649073Scael.El
22749073Scael.Sh SEE ALSO
22849073Scael.Xr mount 2 ,
22966169Sbostic.Xr fstab 5 ,
23066169Sbostic.Xr mount_cd9660 8 ,
23166169Sbostic.Xr mount_fdesc 8 ,
23266169Sbostic.Xr mount_kernfs 8 ,
23366169Sbostic.Xr mount_lfs 8 ,
23466169Sbostic.Xr mount_lofs 8 ,
23566169Sbostic.Xr mount_mfs 8 ,
23666169Sbostic.Xr mount_nfs 8 ,
23766169Sbostic.Xr mount_null 8 ,
23866169Sbostic.Xr mount_portal 8 ,
23966170Spendry.Xr mount_procfs 8 ,
24066169Sbostic.Xr mount_umap 8 ,
24166170Spendry.Xr mount_union 8 ,
24266169Sbostic.Xr umount 8
24349073Scael.Sh BUGS
24449073ScaelIt is possible for a corrupted file system to cause a crash.
24549073Scael.Sh HISTORY
24649073ScaelA
24766169Sbostic.Nm mount
24849073Scaelcommand appeared in
24949073Scael.At v6 .
250