xref: /original-bsd/sbin/mount/mount.8 (revision 334c6481)
1.\" Copyright (c) 1980, 1989, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"     @(#)mount.8	6.18 (Berkeley) 01/06/92
7.\"
8.Dd
9.Dt MOUNT 8
10.Os BSD 4
11.Sh NAME
12.Nm mount ,
13.Nm umount
14.Nd mount and dismount file systems
15.Sh SYNOPSIS
16.Nm mount
17.Op Fl afrwu
18.Op Fl t Ar ufs | lfs | external_type
19.Nm mount
20.Op Fl frwu
21.Ar special | node
22.Nm mount
23.Op Fl frwu
24.Op Fl t Ar ufs | lfs | external_type
25.Op Fl o Ar options
26.Ar special node
27.Nm umount
28.Op Fl af
29.Op Fl t Ar ufs | lfs | external_type
30.Nm umount
31.Op Fl f
32.Ar special | node
33.Sh DESCRIPTION
34The
35.Nm mount
36command
37calls the
38.Xr mount 2
39system call to prepare and graft a
40.Ar special
41device or the remote node
42(rhost:path)
43on to the file system tree at the point
44.Ar node.
45If either
46.Ar special
47or
48.Ar node
49are not provided, the appropriate
50information is taken from the
51.Xr fstab 5
52file.
53.Pp
54The system maintains a list of currently mounted file systems.
55If no arguments are given to
56.Nm mount,
57this list is printed.
58.Pp
59Options available for the
60.Nm mount
61command:
62.Bl -tag -width indent
63.It Fl F
64The standard mount options are parsed and
65passed to external program via the
66.Fl F
67option
68as a decimal number.
69(See example below.)
70.It Fl f
71Causes everything to be done except for the actual system call; if it's
72not obvious, this ``fakes'' mounting the file system.
73This option is useful in conjunction with the
74.Fl v
75flag to
76determine what the
77.Nm mount
78command is trying to do.
79.It Fl o
80Options are specified with a
81.Fl o
82flag
83followed by a comma separated string of options.
84The following options apply to any file system that is being mounted:
85.Bl -tag -width indent
86.It noexec
87Do not allow execution of any binaries on the mounted file system.
88This options is useful for a server that has file systems containing
89binaries for architectures other than its own.
90.It nosuid
91Do not allow set-user-identifier or set-group-identifier bits to take effect.
92.It nodev
93Do not interpret character or block special devices on the file system.
94This options is useful for a server that has file systems containing
95special devices for architectures other than its own.
96.It synchronous
97All
98.Tn I/O
99to the file system should be done synchronously.
100.El
101.It Fl r
102The file system object is to be mounted read-only.
103.It Fl t Ar "ufs \\*(Ba lfs \\*(Ba external type"
104The argument following the
105.Fl t
106is used to indicate the file system type.
107The type
108.Ar ufs
109is the default.
110The \fI-t\fP option can be used
111to indicate that the actions should only be taken on
112filesystems of the specified type.
113More than one type may be specified in a comma separated list.
114The list of filesystem types can be prefixed with ``no'' to
115specify the filesystem types on which no action should be 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.
146The set of options is determined by first extracting the options
147for the file system from the
148.Xr fstab
149table,
150then applying any options specified by the
151.Fl o
152argument,
153and finally applying the
154.Fl r
155or
156.Fl w
157option.
158.It Fl v
159Verbose mode.
160.It Fl w
161The file system object is to be read and write.
162.It Fl
163Any additional options specific to the program can
164be passed as a comma separated list;
165these options are distinguished by starting with a
166.Fl
167(dash).
168.El
169.Pp
170Those options that take a value are specified
171using the syntax -option=value.
172For example, the mount command:
173.Bd -literal -offset indent
174mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp
175.Ed
176.Pp
177causes mount to attempt to execute:
178.Bd -literal -offset indent
179/sbin/mount_mfs -F 8 -N -s 4000 /dev/dk0b /tmp
180.Ed
181.Pp
182The options specific to NFS filesystems are described in the
183.Xr mount_nfs 8
184manual page.
185.Pp
186.Nm Umount
187removes the
188.Ar special
189device grafted at point
190.Ar node
191from file system tree.
192.Pp
193Options for the
194.Nm umount
195command:
196.Bl -tag -width indent
197.It Fl f
198The file system is forcibly unmounted.
199Active special devices continue to work,
200but all other files return errors if further accesses are attempted.
201The root file system cannot be forcibly unmounted.
202.It Fl a
203All of the file systems described in
204.Xr fstab 5
205are unmounted.
206.It Fl t
207Is used to indicate the actions should only be taken on
208filesystems of the specified type.
209More than one type may be specified in a comma separated list.
210The list of filesystem types can be prefixed with ``no'' to
211specify the filesystem types on which no action should be taken.
212(See example above for the
213.Nm mount
214command.)
215.El
216.Sh FILES
217.Bl -tag -width /etc/fstab -compact
218.It Pa /etc/fstab
219file system table
220.El
221.Sh SEE ALSO
222.Xr mount 2 ,
223.Xr unmount 2 ,
224.Xr fstab 5
225.Sh BUGS
226It is possible for a corrupted file system to cause a crash.
227.Sh HISTORY
228A
229.Nm
230command appeared in
231.At v6 .
232