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