xref: /original-bsd/sbin/mount/mount.8 (revision f737e041)
1.\" Copyright (c) 1980, 1989, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"     @(#)mount.8	8.4 (Berkeley) 02/20/94
7.\"
8.Dd
9.Dt MOUNT 8
10.Os BSD 4
11.Sh NAME
12.Nm mount
13.Nd mount file systems
14.Sh SYNOPSIS
15.Nm mount
16.Op Fl adfruvw
17.Op Fl t Ar ufs | lfs | external_type
18.Nm mount
19.Op Fl dfruvw
20.Ar special | node
21.Nm mount
22.Op Fl dfruvw
23.Op Fl t Ar ufs | lfs | external_type
24.Op Fl o Ar options
25.Ar special node
26.Sh DESCRIPTION
27The
28.Nm mount
29command
30calls the
31.Xr mount 2
32system call to prepare and graft a
33.Ar "special device"
34or the remote node (rhost:path) on to the file system tree at the point
35.Ar node .
36If either
37.Ar special
38or
39.Ar node
40are not provided, the appropriate information is taken from the
41.Xr fstab 5
42file.
43.Pp
44The system maintains a list of currently mounted file systems.
45If no arguments are given to
46.Nm mount,
47this list is printed.
48.Pp
49The options are as follows:
50.Bl -tag -width indent
51.It Fl F
52The standard mount options are parsed and
53passed to external program via the
54.Fl F
55option
56as a decimal number.
57(See example below.)
58.It Fl d
59Causes everything to be done except for the actual system call.
60This option is useful in conjunction with the
61.Fl v
62flag to
63determine what the
64.Nm mount
65command is trying to do.
66.It Fl f
67Forces the revocation of write access when trying to downgrade
68a filesystem mount status from read-write to read-only.
69.It Fl o
70Options are specified with a
71.Fl o
72flag
73followed by a comma separated string of options.
74The following options apply to any file system that is being mounted:
75.Bl -tag -width indent
76.It noexec
77Do not allow execution of any binaries on the mounted file system.
78This option is useful for a server that has file systems containing
79binaries for architectures other than its own.
80.It nosuid
81Do not allow set-user-identifier or set-group-identifier bits to take effect.
82.It nodev
83Do not interpret character or block special devices on the file system.
84This option is useful for a server that has file systems containing
85special devices for architectures other than its own.
86.It synchronous
87All
88.Tn I/O
89to the file system should be done synchronously.
90.It union
91Causes the namespace at the mount point to appear as the union
92of the mounted filesystem root and the existing directory.
93Lookups will be done in the mounted filesystem first.
94If those operations fail due to a non-existent file the underlying
95directory is then accessed.
96All creates are done in the mounted filesystem.
97.El
98.It Fl r
99The file system object is to be mounted read-only.
100.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type"
101The argument following the
102.Fl t
103is used to indicate the file system type.
104The type
105.Ar ufs
106is the default.
107The \fI-t\fP option can be used
108to indicate that the actions should only be taken on
109filesystems of the specified type.
110More than one type may be specified in a comma separated list.
111The list of filesystem types can be prefixed with
112.Dq no
113to specify the filesystem types for which action should
114.Em not
115be taken.
116For example, the
117.Nm mount
118command:
119.Bd -literal -offset indent
120mount -a -t nonfs,mfs
121.Ed
122.Pp
123mounts all filesystems except those of type
124.Tn NFS
125and
126.Tn MFS .
127.Pp
128If the type is not one of the internally known types,
129mount will attempt to execute a program in
130.Pa /sbin/mount_ Ns Em XXX
131where
132.Em XXX
133is replaced by the type name.
134For example, nfs filesystems are mounted by the program
135.Pa /sbin/mount_nfs .
136.It Fl u
137The
138.Fl u
139flag indicates that the status of an already mounted file
140system should be changed.
141Any of the options discussed above (the
142.Fl o
143option)
144may be changed;
145also a file system can be changed from read-only to read-write
146or vice versa.
147An attempt to change from read-write to read-only will fail if any
148files on the filesystem are currently open for writing unless the
149.Fl f
150flag is also specified.
151The set of options is determined by first extracting the options
152for the file system from the
153.Xr fstab
154table,
155then applying any options specified by the
156.Fl o
157argument,
158and finally applying the
159.Fl r
160or
161.Fl w
162option.
163.It Fl v
164Verbose mode.
165.It Fl w
166The file system object is to be read and write.
167.It Fl
168Any additional options specific to the program can
169be passed as a comma separated list;
170these options are distinguished by starting with a
171.Fl
172(dash).
173.El
174.Pp
175Those options that take a value are specified
176using the syntax -option=value.
177For example, the mount command:
178.Bd -literal -offset indent
179mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
180.Ed
181.Pp
182causes mount to attempt to execute:
183.Bd -literal -offset indent
184/sbin/mount_mfs -F 8 -N -s 4000 /dev/dk0b /tmp
185.Ed
186.Pp
187The options specific to NFS filesystems are described in the
188.Xr mount_nfs 8
189manual page.
190.Sh FILES
191.Bl -tag -width /etc/fstab -compact
192.It Pa /etc/fstab
193file system table
194.El
195.Sh SEE ALSO
196.Xr mount 2 ,
197.Xr fstab 5 ,
198.Xr mount_cd9660 8 ,
199.Xr mount_fdesc 8 ,
200.Xr mount_kernfs 8 ,
201.Xr mount_lfs 8 ,
202.Xr mount_lofs 8 ,
203.Xr mount_mfs 8 ,
204.Xr mount_nfs 8 ,
205.Xr mount_null 8 ,
206.Xr mount_portal 8 ,
207.Xr mount_procfs 8 ,
208.Xr mount_umap 8 ,
209.Xr mount_union 8 ,
210.Xr umount 8
211.Sh BUGS
212It is possible for a corrupted file system to cause a crash.
213.Sh HISTORY
214A
215.Nm mount
216command appeared in
217.At v6 .
218