]>
Commit | Line | Data |
---|---|---|
60a2a323 | 1 | .\" Copyright (c) 1996-2004 Andries Brouwer |
0d05f161 | 2 | .\" Copyright (C) 2006-2012 Karel Zak <kzak@redhat.com> |
60a2a323 KZ |
3 | .\" |
4 | .\" This page is somewhat derived from a page that was | |
5 | .\" (c) 1980, 1989, 1991 The Regents of the University of California | |
6 | .\" and had been heavily modified by Rik Faith and myself. | |
7 | .\" (Probably no BSD text remains.) | |
8 | .\" Fragments of text were written by Werner Almesberger, Remy Card, | |
9 | .\" Stephen Tweedie and Eric Youngdale. | |
10 | .\" | |
11 | .\" This is free documentation; you can redistribute it and/or | |
12 | .\" modify it under the terms of the GNU General Public License as | |
13 | .\" published by the Free Software Foundation; either version 2 of | |
14 | .\" the License, or (at your option) any later version. | |
15 | .\" | |
16 | .\" The GNU General Public License's references to "object code" | |
17 | .\" and "executables" are to be interpreted as the output of any | |
18 | .\" document formatting or typesetting system, including | |
19 | .\" intermediate and printed output. | |
20 | .\" | |
21 | .\" This manual is distributed in the hope that it will be useful, | |
22 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | |
23 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
24 | .\" GNU General Public License for more details. | |
25 | .\" | |
7cebf0bb SK |
26 | .\" You should have received a copy of the GNU General Public License along |
27 | .\" with this program; if not, write to the Free Software Foundation, Inc., | |
28 | .\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
60a2a323 | 29 | .\" |
bcdf0978 | 30 | .TH MOUNT 8 "August 2015" "util-linux" "System Administration" |
60a2a323 KZ |
31 | .SH NAME |
32 | mount \- mount a filesystem | |
33 | .SH SYNOPSIS | |
34 | .B mount | |
00d1cc1d | 35 | .RB [ \-l | \-h | \-V ] |
60a2a323 | 36 | .LP |
00d1cc1d | 37 | .B mount \-a |
60a2a323 KZ |
38 | .RB [ \-fFnrsvw ] |
39 | .RB [ \-t | |
00d1cc1d | 40 | .IR fstype ] |
60a2a323 KZ |
41 | .RB [ \-O |
42 | .IR optlist ] | |
43 | .LP | |
44 | .B mount | |
45 | .RB [ \-fnrsvw ] | |
46 | .RB [ \-o | |
00d1cc1d | 47 | .IR options ] |
60a2a323 KZ |
48 | .IR device | dir |
49 | .LP | |
50 | .B mount | |
51 | .RB [ \-fnrsvw ] | |
52 | .RB [ \-t | |
00d1cc1d | 53 | .IB fstype ] |
60a2a323 KZ |
54 | .RB [ \-o |
55 | .IR options ] | |
56 | .I device dir | |
57 | .SH DESCRIPTION | |
58 | All files accessible in a Unix system are arranged in one big | |
59 | tree, the file hierarchy, rooted at | |
46f057ed | 60 | .IR / . |
3711f113 | 61 | These files can be spread out over several devices. The |
60a2a323 KZ |
62 | .B mount |
63 | command serves to attach the filesystem found on some device | |
3711f113 | 64 | to the big file tree. Conversely, the |
60a2a323 | 65 | .BR umount (8) |
0ed9c7d5 | 66 | command will detach it again. The filesystem is used to control how data is |
1538f6f6 | 67 | stored on the device or provided in a virtual way by network or other services. |
60a2a323 KZ |
68 | |
69 | The standard form of the | |
70 | .B mount | |
3711f113 | 71 | command is: |
60a2a323 KZ |
72 | .RS |
73 | ||
74 | .br | |
75 | .BI "mount \-t" " type device dir" | |
76 | .br | |
77 | ||
78 | .RE | |
79 | This tells the kernel to attach the filesystem found on | |
80 | .I device | |
81 | (which is of type | |
82 | .IR type ) | |
83 | at the directory | |
84 | .IR dir . | |
9fb4ab8e KZ |
85 | The option \fB\-t \fItype\fR is optional. The |
86 | .B mount | |
87 | command is usually able to detect a filesystem. The root permissions are necessary | |
88 | to mount a filesystem by default. See section "Non-superuser mounts" below for more details. | |
60a2a323 KZ |
89 | The previous contents (if any) and owner and mode of |
90 | .I dir | |
91 | become invisible, and as long as this filesystem remains mounted, | |
92 | the pathname | |
93 | .I dir | |
94 | refers to the root of the filesystem on | |
95 | .IR device . | |
96 | ||
3711f113 | 97 | If only the directory or the device is given, for example: |
60a2a323 | 98 | .RS |
bcdf0978 | 99 | .sp |
0bb7e904 | 100 | .B mount /dir |
bcdf0978 | 101 | .sp |
60a2a323 | 102 | .RE |
3711f113 | 103 | then \fBmount\fR looks for a mountpoint (and if not found then for a device) in the |
0bb7e904 | 104 | .I /etc/fstab |
3711f113 | 105 | file. It's possible to use the |
0d05f161 | 106 | .B \-\-target |
aedeaa40 | 107 | or |
0d05f161 | 108 | .B \-\-source |
96e47ad0 MK |
109 | options to avoid ambiguous interpretation of the given argument. |
110 | For example: | |
aedeaa40 | 111 | .RS |
bcdf0978 | 112 | .sp |
0bb7e904 | 113 | .B mount \-\-target /mountpoint |
bcdf0978 | 114 | .sp |
aedeaa40 KZ |
115 | .RE |
116 | ||
eb024893 | 117 | The same filesystem may be mounted more than once, and in some cases (e.g., |
381db76d | 118 | network filesystems) the same filesystem may be mounted on the same |
96e47ad0 MK |
119 | mountpoint multiple times. The |
120 | .B mount | |
121 | command does not implement any policy to | |
07975119 | 122 | control this behavior. All behavior is controlled by the kernel and it is usually |
381db76d | 123 | specific to the filesystem driver. The exception is \fB\-\-all\fR, in this case |
f49cf49b | 124 | already mounted filesystems are ignored (see \fB\-\-all\fR below for more details). |
8e782a83 | 125 | |
81421334 | 126 | .SS Listing the mounts |
5f7c1890 KZ |
127 | The listing mode is maintained for backward compatibility only. |
128 | ||
3711f113 | 129 | For more robust and customizable output use |
5f7c1890 | 130 | .BR findmnt (8), |
3711f113 | 131 | \fBespecially in your scripts\fP. Note that control characters in the |
5f7c1890 KZ |
132 | mountpoint name are replaced with '?'. |
133 | ||
3711f113 BS |
134 | The following command lists all mounted filesystems (of type |
135 | .IR type ): | |
3711f113 | 136 | .RS |
bcdf0978 | 137 | .sp |
0d05f161 | 138 | .BR "mount " [ \-l "] [" "\-t \fItype\/\fP" ] |
bcdf0978 | 139 | .sp |
3711f113 | 140 | .RE |
3711f113 | 141 | The option \fB\-l\fR adds labels to this listing. See below. |
60a2a323 | 142 | |
0ed9c7d5 | 143 | .SS Indicating the device and filesystem |
3711f113 | 144 | Most devices are indicated by a filename (of a block special device), like |
60a2a323 | 145 | .IR /dev/sda1 , |
3711f113 | 146 | but there are other possibilities. For example, in the case of an NFS mount, |
60a2a323 KZ |
147 | .I device |
148 | may look like | |
149 | .IR knuth.cwi.nl:/dir . | |
72bc0dd2 | 150 | .PP |
b2de475c | 151 | The device names of disk partitions are unstable; hardware reconfiguration, |
96e47ad0 MK |
152 | and adding or removing a device can cause changes in names. |
153 | This is the reason why it's | |
b2de475c | 154 | strongly recommended to use filesystem or partition identifiers like UUID or |
72bc0dd2 KZ |
155 | LABEL. Currently supported identifiers (tags): |
156 | .TP | |
157 | LABEL=\fIlabel\fR | |
158 | Human readable filesystem identifier. See also \fB\-L\fR. | |
159 | .TP | |
160 | UUID=\fIuuid\fR | |
161 | Filesystem universally unique identifier. The format of the UUID is usually a | |
162 | series of hex digits separated by hyphens. See also \fB\-U\fR. | |
163 | .sp | |
164 | Note that | |
165 | .BR mount (8) | |
166 | uses UUIDs as strings. The UUIDs from the command line or from | |
167 | .BR fstab (5) | |
168 | are not converted to internal binary representation. The string representation | |
169 | of the UUID should be based on lower case characters. | |
170 | .TP | |
171 | PARTLABEL=\fIlabel\fR | |
172 | Human readable partition identifier. This identifier is independent on | |
173 | filesystem and does not change by mkfs or mkswap operations It's supported | |
174 | for example for GUID Partition Tables (GPT). | |
175 | .TP | |
176 | PARTUUID=\fIuuid\fR | |
177 | Partition universally unique identifier. This identifier is independent on | |
178 | filesystem and does not change by mkfs or mkswap operations It's supported | |
179 | for example for GUID Partition Tables (GPT). | |
b3391f3a KZ |
180 | .TP |
181 | ID=\fIid\fR | |
182 | Hardware block device ID as generated by udevd. This identifier is usually | |
183 | based on WWN (unique storage identifier) and assigned by the hardware | |
184 | manufacturer. See \fBls /dev/disk/by-id\fR for more details, this directory | |
185 | and running udevd is required. This identifier is not recommended for generic | |
186 | use as the identifier is not strictly defined and it depends on udev, udev rules | |
187 | and hardware. | |
72bc0dd2 KZ |
188 | .RE |
189 | .sp | |
1c4c6024 BIG |
190 | The command \fBlsblk \-\-fs\fR provides an overview of filesystems, LABELs and UUIDs |
191 | on available block devices. The command \fBblkid \-p <device>\fR provides details about | |
0ed9c7d5 | 192 | a filesystem on the specified device. |
71e87708 KZ |
193 | |
194 | Don't forget that there is no guarantee that UUIDs and labels are really | |
195 | unique, especially if you move, share or copy the device. Use | |
0d05f161 | 196 | .B "lsblk \-o +UUID,PARTUUID" |
71e87708 | 197 | to verify that the UUIDs are really unique in your system. |
60a2a323 | 198 | |
0ed9c7d5 | 199 | The recommended setup is to use tags (e.g.\& \fBUUID=\fIuuid\fR) rather than |
b3391f3a | 200 | .I /dev/disk/by-{label,uuid,id,partuuid,partlabel} |
46f057ed MK |
201 | udev symlinks in the |
202 | .I /etc/fstab | |
203 | file. Tags are | |
3711f113 | 204 | more readable, robust and portable. The |
60a2a323 KZ |
205 | .BR mount (8) |
206 | command internally uses udev | |
cfd6b4dc MK |
207 | symlinks, so the use of symlinks in |
208 | .I /etc/fstab | |
209 | has no advantage over tags. | |
60a2a323 KZ |
210 | For more details see |
211 | .BR libblkid (3). | |
212 | ||
60a2a323 KZ |
213 | The |
214 | .I proc | |
215 | filesystem is not associated with a special device, and when | |
96e47ad0 MK |
216 | mounting it, an arbitrary keyword\(emfor example, |
217 | .IR proc \(emcan | |
218 | be used instead of a device specification. | |
60a2a323 KZ |
219 | (The customary choice |
220 | .I none | |
c72fa620 AJ |
221 | is less fortunate: the error message `none already mounted' from |
222 | .B mount | |
60a2a323 | 223 | can be confusing.) |
60a2a323 | 224 | |
81421334 | 225 | .SS The files /etc/fstab, /etc/mtab and /proc/mounts |
60a2a323 KZ |
226 | The file |
227 | .I /etc/fstab | |
228 | (see | |
229 | .BR fstab (5)), | |
230 | may contain lines describing what devices are usually | |
3711f113 | 231 | mounted where, using which options. The default location of the |
60a2a323 | 232 | .BR fstab (5) |
3711f113 BS |
233 | file can be overridden with the |
234 | .BI \-\-fstab " path" | |
235 | command-line option (see below for more details). | |
60a2a323 KZ |
236 | .LP |
237 | The command | |
238 | .RS | |
239 | .sp | |
240 | .B mount \-a | |
241 | .RB [ \-t | |
242 | .IR type ] | |
243 | .RB [ \-O | |
244 | .IR optlist ] | |
245 | .sp | |
246 | .RE | |
247 | (usually given in a bootscript) causes all filesystems mentioned in | |
248 | .I fstab | |
249 | (of the proper type and/or having or not having the proper options) | |
250 | to be mounted as indicated, except for those whose line contains the | |
251 | .B noauto | |
3711f113 | 252 | keyword. Adding the |
60a2a323 | 253 | .B \-F |
00d1cc1d | 254 | option will make \fBmount\fR fork, so that the |
96e47ad0 | 255 | filesystems are mounted in parallel. |
60a2a323 KZ |
256 | .LP |
257 | When mounting a filesystem mentioned in | |
0d05f161 | 258 | .I fstab |
60a2a323 | 259 | or |
0d05f161 | 260 | .IR mtab , |
3711f113 | 261 | it suffices to specify on the command line only the device, or only the mount point. |
00d1cc1d | 262 | .sp |
60a2a323 KZ |
263 | The programs |
264 | .B mount | |
265 | and | |
266 | .B umount | |
00d1cc1d | 267 | traditionally maintained a list of currently mounted filesystems in the file |
60a2a323 | 268 | .IR /etc/mtab . |
b6cc1210 | 269 | The support for regular classic |
559ee54a | 270 | .I /etc/mtab |
96e47ad0 MK |
271 | is completely disabled at compile time by default, because on current Linux |
272 | systems it is better to make | |
273 | .I /etc/mtab | |
274 | a symlink to | |
06716dff | 275 | .I /proc/mounts |
96e47ad0 MK |
276 | instead. The regular |
277 | .I mtab | |
278 | file maintained in userspace cannot reliably | |
00d1cc1d | 279 | work with namespaces, containers and other advanced Linux features. |
96e47ad0 MK |
280 | If the regular |
281 | .I mtab | |
282 | support is enabled, then it's possible to | |
b6cc1210 | 283 | use the file as well as the symlink. |
00d1cc1d | 284 | .sp |
60a2a323 KZ |
285 | If no arguments are given to |
286 | .BR mount , | |
00d1cc1d BS |
287 | the list of mounted filesystems is printed. |
288 | .sp | |
3711f113 | 289 | If you want to override mount options from |
96e47ad0 | 290 | .IR /etc/fstab , |
3711f113 BS |
291 | you have to use the \fB\-o\fR option: |
292 | .RS | |
293 | .sp | |
294 | .BI mount " device" \fR| "dir " \-o " options" | |
295 | .sp | |
296 | .RE | |
297 | and then the mount options from the command line will be appended to | |
298 | the list of options from | |
299 | .IR /etc/fstab . | |
96e47ad0 MK |
300 | This default behaviour can be changed using the |
301 | \fB\-\-options\-mode\fR | |
302 | command-line option. | |
3711f113 BS |
303 | The usual behavior is that the last option wins if there are conflicting |
304 | ones. | |
00d1cc1d | 305 | .sp |
60a2a323 KZ |
306 | The |
307 | .B mount | |
308 | program does not read the | |
309 | .I /etc/fstab | |
3711f113 | 310 | file if both |
60a2a323 | 311 | .I device |
b3391f3a | 312 | (or LABEL, UUID, ID, PARTUUID or PARTLABEL) and |
60a2a323 | 313 | .I dir |
3711f113 BS |
314 | are specified. For example, to mount device |
315 | .BR foo " at " /dir : | |
60a2a323 KZ |
316 | .RS |
317 | .sp | |
318 | .B "mount /dev/foo /dir" | |
319 | .sp | |
320 | .RE | |
96e47ad0 MK |
321 | This default behaviour can be changed by using the |
322 | \fB\-\-options\-source\-force\fR command-line option | |
323 | to always read configuration from | |
cfd6b4dc MK |
324 | .IR fstab . |
325 | For non-root users | |
b8ec0cb4 | 326 | .B mount |
96e47ad0 | 327 | always reads the |
cfd6b4dc MK |
328 | .I fstab |
329 | configuration. | |
60a2a323 | 330 | |
81421334 | 331 | .SS Non-superuser mounts |
60a2a323 KZ |
332 | Normally, only the superuser can mount filesystems. |
333 | However, when | |
334 | .I fstab | |
335 | contains the | |
336 | .B user | |
3711f113 | 337 | option on a line, anybody can mount the corresponding filesystem. |
60a2a323 KZ |
338 | .LP |
339 | Thus, given a line | |
340 | .RS | |
341 | .sp | |
342 | .B "/dev/cdrom /cd iso9660 ro,user,noauto,unhide" | |
343 | .sp | |
344 | .RE | |
3711f113 | 345 | any user can mount the iso9660 filesystem found on an inserted CDROM |
bcdf0978 | 346 | using the command: |
96e47ad0 | 347 | .PP |
60a2a323 | 348 | .RS |
60a2a323 KZ |
349 | .B "mount /cd" |
350 | .sp | |
351 | .RE | |
2480b527 | 352 | Note that \fBmount\fR is very strict about non-root users and all paths |
cfd6b4dc MK |
353 | specified on command line are verified before |
354 | .I fstab | |
355 | is parsed or a helper | |
cf41837f | 356 | program is executed. It's strongly recommended to use a valid mountpoint to |
96e47ad0 | 357 | specify filesystem, otherwise \fBmount\fR may fail. For example it's a bad idea |
2480b527 KZ |
358 | to use NFS or CIFS source on command line. |
359 | .PP | |
96e47ad0 MK |
360 | Since util-linux 2.35, \fBmount\fR does not exit when user permissions are |
361 | inadequate according to libmount's internal security rules. | |
362 | Instead, it drops suid permissions | |
363 | and continues as regular non-root user. This behavior supports use-cases where | |
eb024893 | 364 | root permissions are not necessary (e.g., fuse filesystems, user namespaces, |
6497f2d9 KZ |
365 | etc). |
366 | .PP | |
60a2a323 KZ |
367 | For more details, see |
368 | .BR fstab (5). | |
369 | Only the user that mounted a filesystem can unmount it again. | |
3711f113 | 370 | If any user should be able to unmount it, then use |
60a2a323 KZ |
371 | .B users |
372 | instead of | |
373 | .B user | |
374 | in the | |
375 | .I fstab | |
376 | line. | |
377 | The | |
378 | .B owner | |
379 | option is similar to the | |
380 | .B user | |
381 | option, with the restriction that the user must be the owner | |
3711f113 | 382 | of the special file. This may be useful e.g.\& for |
60a2a323 KZ |
383 | .I /dev/fd |
384 | if a login script makes the console user owner of this device. | |
385 | The | |
386 | .B group | |
96e47ad0 | 387 | option is similar, with the restriction that the user must be a |
60a2a323 | 388 | member of the group of the special file. |
60a2a323 | 389 | |
5109589c | 390 | .SS Bind mount operation |
9f3d0fce | 391 | Remount part of the file hierarchy somewhere else. The call is: |
3711f113 | 392 | |
60a2a323 KZ |
393 | .RS |
394 | .br | |
0d05f161 | 395 | .B mount \-\-bind |
60a2a323 KZ |
396 | .I olddir newdir |
397 | .RE | |
3711f113 | 398 | |
cfd6b4dc MK |
399 | or by using this |
400 | .I fstab | |
401 | entry: | |
3711f113 | 402 | |
60a2a323 KZ |
403 | .RS |
404 | .br | |
3711f113 BS |
405 | .BI / olddir |
406 | .BI / newdir | |
fb724eef | 407 | .B none bind |
60a2a323 KZ |
408 | .RE |
409 | ||
3711f113 | 410 | After this call the same contents are accessible in two places. |
5109589c | 411 | |
96e47ad0 | 412 | It is important to understand that "bind" does not create any second-class |
5109589c KZ |
413 | or special node in the kernel VFS. The "bind" is just another operation to |
414 | attach a filesystem. There is nowhere stored information that the filesystem | |
96e47ad0 MK |
415 | has been attached by a "bind" operation. The \fIolddir\fR and \fInewdir\fR are |
416 | independent and the \fIolddir\fR may be unmounted. | |
5109589c | 417 | |
3711f113 | 418 | One can also remount a single file (on a single file). It's also |
96e47ad0 | 419 | possible to use a bind mount to create a mountpoint from a regular |
60a2a323 KZ |
420 | directory, for example: |
421 | ||
422 | .RS | |
423 | .br | |
3711f113 | 424 | .B mount \-\-bind foo foo |
60a2a323 KZ |
425 | .RE |
426 | ||
427 | The bind mount call attaches only (part of) a single filesystem, not possible | |
96e47ad0 | 428 | submounts. The entire file hierarchy including submounts can be attached |
3711f113 | 429 | a second place by using: |
60a2a323 KZ |
430 | |
431 | .RS | |
432 | .br | |
0d05f161 | 433 | .B mount \-\-rbind |
60a2a323 KZ |
434 | .I olddir newdir |
435 | .RE | |
436 | ||
96e47ad0 | 437 | Note that the filesystem mount options maintained by the kernel will remain the same as those |
eb024893 | 438 | on the original mount point. The userspace mount options (e.g., _netdev) will not be copied |
f1a7a86d | 439 | by |
96e47ad0 MK |
440 | .BR mount |
441 | and it's necessary to explicitly specify the options on the | |
442 | .B mount | |
443 | command line. | |
9ac77b8a | 444 | |
96e47ad0 | 445 | Since util-linux 2.27 |
bcdf0978 | 446 | .BR mount (8) |
96e47ad0 | 447 | permits changing the mount options by passing the |
bcdf0978 BS |
448 | relevant options along with |
449 | .BR \-\-bind . | |
450 | For example: | |
60a2a323 KZ |
451 | |
452 | .RS | |
453 | .br | |
1c4c6024 | 454 | .B mount \-o bind,ro foo foo |
60a2a323 KZ |
455 | .RE |
456 | ||
bcdf0978 | 457 | This feature is not supported by the Linux kernel; it is implemented in userspace |
3be5d977 MK |
458 | by an additional \fBmount\fR(2) remounting system call. |
459 | This solution is not atomic. | |
9ac77b8a | 460 | |
bcdf0978 | 461 | The alternative (classic) way to create a read-only bind mount is to use the remount |
9ac77b8a | 462 | operation, for example: |
60a2a323 KZ |
463 | |
464 | .RS | |
465 | .br | |
0d05f161 | 466 | .B mount \-\-bind |
60a2a323 KZ |
467 | .I olddir newdir |
468 | .br | |
fa177917 | 469 | .B mount \-o remount,bind,ro |
60a2a323 KZ |
470 | .I olddir newdir |
471 | .RE | |
d7890778 | 472 | |
bcdf0978 BS |
473 | Note that a read-only bind will create a read-only mountpoint (VFS entry), |
474 | but the original filesystem superblock will still be writable, meaning that the | |
d7890778 KZ |
475 | .I olddir |
476 | will be writable, but the | |
477 | .I newdir | |
478 | will be read-only. | |
9ac77b8a | 479 | |
fa177917 | 480 | It's also possible to change nosuid, nodev, noexec, noatime, nodiratime and |
96e47ad0 MK |
481 | relatime VFS entry flags via a "remount,bind" operation. |
482 | The other flags (for example | |
483 | filesystem-specific flags) are silently ignored. It's impossible to change mount | |
1c4c6024 | 484 | options recursively (for example with \fB\-o rbind,ro\fR). |
9b76b0e9 | 485 | |
96e47ad0 MK |
486 | Since util-linux 2.31, |
487 | .BR mount | |
488 | ignores the \fBbind\fR flag from | |
9b76b0e9 | 489 | .I /etc/fstab |
96e47ad0 MK |
490 | on a |
491 | .B remount | |
492 | operation | |
493 | (if "\-o remount" is specified on command line). | |
494 | This is necessary to fully control | |
495 | mount options on remount by command line. In previous versions the bind | |
9b76b0e9 KZ |
496 | flag has been always applied and it was impossible to re-define mount options |
497 | without interaction with the bind semantic. This | |
498 | .BR mount (8) | |
499 | behavior does not affect situations when "remount,bind" is specified in the | |
500 | .I /etc/fstab | |
501 | file. | |
60a2a323 | 502 | |
81421334 | 503 | .SS The move operation |
9f3d0fce | 504 | Move a |
60a2a323 | 505 | .B mounted tree |
9f3d0fce | 506 | to another place (atomically). The call is: |
3711f113 | 507 | |
60a2a323 KZ |
508 | .RS |
509 | .br | |
0d05f161 | 510 | .B mount \-\-move |
60a2a323 KZ |
511 | .I olddir newdir |
512 | .RE | |
3711f113 BS |
513 | |
514 | This will cause the contents which previously appeared under | |
515 | .I olddir | |
516 | to now be accessible under | |
517 | .IR newdir . | |
518 | The physical location of the files is not changed. | |
519 | Note that | |
60a2a323 KZ |
520 | .I olddir |
521 | has to be a mountpoint. | |
fcc0413a | 522 | |
3711f113 BS |
523 | Note also that moving a mount residing under a shared mount is invalid and |
524 | unsupported. Use | |
8a4c64e6 | 525 | .B findmnt \-o TARGET,PROPAGATION |
fcc0413a | 526 | to see the current propagation flags. |
60a2a323 | 527 | |
81421334 | 528 | .SS Shared subtree operations |
60a2a323 | 529 | Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared, |
3711f113 BS |
530 | private, slave or unbindable. A shared mount provides the ability to create mirrors |
531 | of that mount such that mounts and unmounts within any of the mirrors propagate | |
532 | to the other mirror. A slave mount receives propagation from its master, but | |
533 | not vice versa. A private mount carries no propagation abilities. An | |
60a2a323 | 534 | unbindable mount is a private mount which cannot be cloned through a bind |
3711f113 | 535 | operation. The detailed semantics are documented in |
46f057ed | 536 | .I Documentation/filesystems/sharedsubtree.txt |
96e47ad0 MK |
537 | file in the kernel source tree; see also |
538 | .BR mount_namespaces (7). | |
60a2a323 | 539 | |
3711f113 BS |
540 | Supported operations are: |
541 | ||
60a2a323 KZ |
542 | .RS |
543 | .nf | |
b06c1ca6 WP |
544 | .BI "mount \-\-make\-shared " mountpoint |
545 | .BI "mount \-\-make\-slave " mountpoint | |
546 | .BI "mount \-\-make\-private " mountpoint | |
547 | .BI "mount \-\-make\-unbindable " mountpoint | |
60a2a323 KZ |
548 | .fi |
549 | .RE | |
550 | ||
3711f113 | 551 | The following commands allow one to recursively change the type of all the |
60a2a323 KZ |
552 | mounts under a given mountpoint. |
553 | ||
554 | .RS | |
555 | .nf | |
b06c1ca6 WP |
556 | .BI "mount \-\-make\-rshared " mountpoint |
557 | .BI "mount \-\-make\-rslave " mountpoint | |
558 | .BI "mount \-\-make\-rprivate " mountpoint | |
559 | .BI "mount \-\-make\-runbindable " mountpoint | |
60a2a323 KZ |
560 | .fi |
561 | .RE | |
be6904b9 KZ |
562 | |
563 | .BR mount (8) | |
564 | .B does not read | |
565 | .BR fstab (5) | |
3711f113 BS |
566 | when a \fB\-\-make-\fR* operation is requested. All necessary information has to be |
567 | specified on the command line. | |
be6904b9 | 568 | |
96e47ad0 | 569 | Note that the Linux kernel does not allow changing multiple propagation flags |
3711f113 | 570 | with a single |
be6904b9 | 571 | .BR mount (2) |
267b44e6 KZ |
572 | system call, and the flags cannot be mixed with other mount options and operations. |
573 | ||
574 | Since util-linux 2.23 the \fBmount\fR command allows to do more propagation | |
575 | (topology) changes by one mount(8) call and do it also together with other | |
576 | mount operations. This feature is EXPERIMENTAL. The propagation flags are applied | |
577 | by additional \fBmount\fR(2) system calls when the preceding mount operations | |
578 | were successful. Note that this use case is not atomic. It is possible to | |
579 | specify the propagation flags in | |
be6904b9 KZ |
580 | .BR fstab (5) |
581 | as mount options | |
3711f113 BS |
582 | .RB ( private , |
583 | .BR slave , | |
584 | .BR shared , | |
585 | .BR unbindable , | |
586 | .BR rprivate , | |
587 | .BR rslave , | |
588 | .BR rshared , | |
589 | .BR runbindable ). | |
590 | ||
591 | For example: | |
592 | ||
be6904b9 KZ |
593 | .RS |
594 | .nf | |
0bb7e904 | 595 | .B mount \-\-make\-private \-\-make\-unbindable /dev/sda1 /foo |
be6904b9 KZ |
596 | .fi |
597 | .RE | |
598 | ||
3711f113 BS |
599 | is the same as: |
600 | ||
be6904b9 KZ |
601 | .RS |
602 | .nf | |
9a7dc841 | 603 | .B mount /dev/sda1 /foo |
0bb7e904 BIG |
604 | .B mount \-\-make\-private /foo |
605 | .B mount \-\-make\-unbindable /foo | |
be6904b9 KZ |
606 | .fi |
607 | .RE | |
60a2a323 | 608 | |
3711f113 | 609 | .SH COMMAND-LINE OPTIONS |
60a2a323 KZ |
610 | The full set of mount options used by an invocation of |
611 | .B mount | |
612 | is determined by first extracting the | |
613 | mount options for the filesystem from the | |
614 | .I fstab | |
615 | table, then applying any options specified by the | |
616 | .B \-o | |
617 | argument, and finally applying a | |
618 | .BR \-r " or " \-w | |
619 | option, when present. | |
620 | ||
96e47ad0 | 621 | The \fBmount\fR command does not pass all command-line options to the |
3711f113 | 622 | \fB/sbin/mount.\fIsuffix\fR mount helpers. The interface between \fBmount\fR |
81421334 | 623 | and the mount helpers is described below in the section \fBEXTERNAL HELPERS\fR. |
00d1cc1d | 624 | .sp |
3711f113 | 625 | Command-line options available for the |
60a2a323 | 626 | .B mount |
3711f113 | 627 | command are: |
00d1cc1d BS |
628 | .TP |
629 | .BR \-a , " \-\-all" | |
60a2a323 | 630 | Mount all filesystems (of the given types) mentioned in |
0d05f161 | 631 | .I fstab |
31e93a55 KZ |
632 | (except for those whose line contains the |
633 | .B noauto | |
3711f113 BS |
634 | keyword). The filesystems are mounted following their order in |
635 | .IR fstab . | |
96e47ad0 MK |
636 | The |
637 | .B mount | |
638 | command compares filesystem source, target (and fs root for bind | |
f49cf49b | 639 | mount or btrfs) to detect already mounted filesystems. The kernel table with |
96e47ad0 | 640 | already mounted filesystems is cached during \fBmount \-\-all\fR. This means |
cfd6b4dc MK |
641 | that all duplicated |
642 | .I fstab | |
643 | entries will be mounted. | |
302419e8 | 644 | .sp |
189a1bf3 KZ |
645 | The option \fB\-\-all\fR is possible to use for remount operation too. In this |
646 | case all filters (\fB\-t\fR and \fB\-O\fR) are applied to the table of already | |
647 | mounted filesystems. | |
648 | .sp | |
34333e52 | 649 | Since version 2.35 is possible to use the command line option \fB\-o\fR to |
cfd6b4dc MK |
650 | alter mount options from |
651 | .I fstab | |
652 | (see also \fB\-\-options\-mode\fR). | |
34333e52 | 653 | .sp |
f3af8329 | 654 | Note that it is a bad practice to use \fBmount \-a\fR for |
0bb7e904 | 655 | .I fstab |
302419e8 | 656 | checking. The recommended solution is \fBfindmnt \-\-verify\fR. |
00d1cc1d BS |
657 | .TP |
658 | .BR \-B , " \-\-bind" | |
659 | Remount a subtree somewhere else (so that its contents are available | |
81421334 | 660 | in both places). See above, under \fBBind mounts\fR. |
00d1cc1d | 661 | .TP |
b06c1ca6 | 662 | .BR \-c , " \-\-no\-canonicalize" |
96e47ad0 MK |
663 | Don't canonicalize paths. The |
664 | .B mount | |
665 | command canonicalizes all paths | |
666 | (from the command line or | |
cfd6b4dc MK |
667 | .IR fstab ) |
668 | by default. This option can be used | |
00d1cc1d BS |
669 | together with the |
670 | .B \-f | |
671 | flag for already canonicalized absolute paths. The option is designed for mount | |
1c4c6024 | 672 | helpers which call \fBmount \-i\fR. It is strongly recommended to not use this |
00d1cc1d BS |
673 | command-line option for normal mount operations. |
674 | .sp | |
675 | Note that \fBmount\fR(8) does not pass this option to the | |
676 | \fB/sbin/mount.\fItype\fR helpers. | |
677 | .TP | |
678 | .BR \-F , " \-\-fork" | |
60a2a323 KZ |
679 | (Used in conjunction with |
680 | .BR \-a .) | |
3711f113 | 681 | Fork off a new incarnation of \fBmount\fR for each device. |
60a2a323 KZ |
682 | This will do the mounts on different devices or different NFS servers |
683 | in parallel. | |
96e47ad0 MK |
684 | This has the advantage that it is faster; also NFS timeouts proceed in |
685 | parallel. | |
686 | A disadvantage is that the order of the mount operations is undefined. | |
60a2a323 KZ |
687 | Thus, you cannot use this option if you want to mount both |
688 | .I /usr | |
689 | and | |
690 | .IR /usr/spool . | |
691 | .IP "\fB\-f, \-\-fake\fP" | |
692 | Causes everything to be done except for the actual system call; if it's not | |
693 | obvious, this ``fakes'' mounting the filesystem. This option is useful in | |
694 | conjunction with the | |
695 | .B \-v | |
696 | flag to determine what the | |
697 | .B mount | |
3711f113 BS |
698 | command is trying to do. It can also be used to add entries for devices |
699 | that were mounted earlier with the \fB\-n\fR option. The \fB\-f\fR option | |
cfd6b4dc MK |
700 | checks for an existing record in |
701 | .I /etc/mtab | |
702 | and fails when the record already | |
3711f113 | 703 | exists (with a regular non-fake mount, this check is done by the kernel). |
b06c1ca6 | 704 | .IP "\fB\-i, \-\-internal\-only\fP" |
3711f113 | 705 | Don't call the \fB/sbin/mount.\fIfilesystem\fR helper even if it exists. |
00d1cc1d BS |
706 | .TP |
707 | .BR \-L , " \-\-label " \fIlabel | |
708 | Mount the partition that has the specified | |
709 | .IR label . | |
710 | .TP | |
b06c1ca6 | 711 | .BR \-l , " \-\-show\-labels" |
3711f113 | 712 | Add the labels in the mount output. \fBmount\fR must have |
aedd46f6 | 713 | permission to read the disk device (e.g.\& be set-user-ID root) for this to work. |
60a2a323 KZ |
714 | One can set such a label for ext2, ext3 or ext4 using the |
715 | .BR e2label (8) | |
716 | utility, or for XFS using | |
717 | .BR xfs_admin (8), | |
718 | or for reiserfs using | |
719 | .BR reiserfstune (8). | |
00d1cc1d BS |
720 | .TP |
721 | .BR \-M , " \-\-move" | |
81421334 BS |
722 | Move a subtree to some other place. See above, the subsection |
723 | \fBThe move operation\fR. | |
00d1cc1d | 724 | .TP |
b06c1ca6 | 725 | .BR \-n , " \-\-no\-mtab" |
60a2a323 KZ |
726 | Mount without writing in |
727 | .IR /etc/mtab . | |
728 | This is necessary for example when | |
729 | .I /etc | |
730 | is on a read-only filesystem. | |
00d1cc1d | 731 | .TP |
d45e8ef9 | 732 | .BR \-N , " \-\-namespace " \fIns |
96e47ad0 | 733 | Perform the mount operation in the mount namespace specified by \fIns\fR. |
d59766a6 VD |
734 | \fIns\fR is either PID of process running in that namespace |
735 | or special file representing that namespace. | |
b6cc1210 KZ |
736 | .sp |
737 | .BR mount (8) | |
cfd6b4dc MK |
738 | switches to the mount namespace when it reads |
739 | .IR /etc/fstab , | |
740 | writes | |
741 | .I /etc/mtab | |
742 | (or writes to | |
743 | .IR /run/mount ) | |
96e47ad0 | 744 | and calls the |
559ee54a | 745 | .BR mount (2) |
2a425c02 | 746 | system call, otherwise it runs in the original mount namespace. |
96e47ad0 MK |
747 | This means that the target namespace does not have |
748 | to contain any libraries or other requirements necessary to execute the | |
559ee54a | 749 | .BR mount (2) |
96e47ad0 | 750 | call. |
b6cc1210 | 751 | .sp |
2a425c02 | 752 | See \fBmount_namespaces\fR(7) for more information. |
d45e8ef9 | 753 | .TP |
b06c1ca6 | 754 | .BR \-O , " \-\-test\-opts " \fIopts |
00d1cc1d BS |
755 | Limit the set of filesystems to which the |
756 | .B \-a | |
757 | option applies. In this regard it is like the | |
758 | .B \-t | |
759 | option except that | |
760 | .B \-O | |
761 | is useless without | |
762 | .BR \-a . | |
763 | For example, the command: | |
764 | .RS | |
765 | .RS | |
766 | .sp | |
767 | .B "mount \-a \-O no_netdev" | |
768 | .sp | |
769 | .RE | |
770 | mounts all filesystems except those which have the option | |
771 | .I _netdev | |
772 | specified in the options field in the | |
773 | .I /etc/fstab | |
774 | file. | |
4593e075 | 775 | |
00d1cc1d BS |
776 | It is different from |
777 | .B \-t | |
778 | in that each option is matched exactly; a leading | |
779 | .B no | |
780 | at the beginning of one option does not negate the rest. | |
781 | ||
782 | The | |
783 | .B \-t | |
784 | and | |
785 | .B \-O | |
786 | options are cumulative in effect; that is, the command | |
787 | .RS | |
788 | .sp | |
789 | .B "mount \-a \-t ext2 \-O _netdev" | |
790 | .sp | |
791 | .RE | |
792 | mounts all ext2 filesystems with the _netdev option, not all filesystems | |
793 | that are either ext2 or have the _netdev option specified. | |
794 | .RE | |
795 | .TP | |
796 | .BR \-o , " \-\-options " \fIopts | |
797 | Use the specified mount options. The \fIopts\fR argument is | |
798 | a comma-separated list. For example: | |
799 | .RS | |
800 | .RS | |
801 | .sp | |
802 | .B "mount LABEL=mydisk \-o noatime,nodev,nosuid" | |
803 | .sp | |
804 | .RE | |
805 | ||
806 | For more details, see the | |
807 | .B FILESYSTEM-INDEPENDENT MOUNT OPTIONS | |
808 | and | |
809 | .B FILESYSTEM-SPECIFIC MOUNT OPTIONS | |
810 | sections. | |
811 | .RE | |
812 | ||
7238285b VD |
813 | .TP |
814 | .BR "\-\-options\-mode " \fImode | |
cfd6b4dc MK |
815 | Controls how to combine options from |
816 | .IR fstab / mtab | |
96e47ad0 | 817 | with options from the command line. |
7238285b VD |
818 | \fImode\fR can be one of |
819 | .BR ignore ", " append ", " prepend " or " replace . | |
96e47ad0 | 820 | For example, \fBappend\fR means that options from |
cfd6b4dc | 821 | .I fstab |
96e47ad0 MK |
822 | are appended to options from the command line. |
823 | The default value is \fBprepend\fR -- it means command line options are evaluated after | |
cfd6b4dc MK |
824 | .I fstab |
825 | options. | |
b8ec0cb4 | 826 | Note that the last option wins if there are conflicting ones. |
7238285b VD |
827 | |
828 | .TP | |
829 | .BR "\-\-options\-source " \fIsource | |
830 | Source of default options. | |
96e47ad0 | 831 | \fIsource\fR is a comma-separated list of |
7238285b VD |
832 | .BR fstab ", " mtab " and " disable . |
833 | \fBdisable\fR disables | |
834 | .BR fstab " and " mtab | |
835 | and disables \fB\-\-options\-source\-force\fR. | |
96e47ad0 | 836 | The default value is \fBfstab,mtab\fR. |
7238285b VD |
837 | |
838 | .TP | |
0bb7e904 | 839 | .B \-\-options\-source\-force |
cfd6b4dc MK |
840 | Use options from |
841 | .IR fstab / mtab | |
842 | even if both \fIdevice\fR and \fIdir\fR are specified. | |
7238285b | 843 | |
00d1cc1d BS |
844 | .TP |
845 | .BR \-R , " \-\-rbind" | |
846 | Remount a subtree and all possible submounts somewhere else (so that its | |
81421334 BS |
847 | contents are available in both places). See above, the subsection |
848 | \fBBind mounts\fR. | |
00d1cc1d | 849 | .TP |
b06c1ca6 | 850 | .BR \-r , " \-\-read\-only" |
3711f113 | 851 | Mount the filesystem read-only. A synonym is |
60a2a323 | 852 | .BR "\-o ro" . |
00d1cc1d | 853 | .sp |
60a2a323 | 854 | Note that, depending on the filesystem type, state and kernel behavior, the |
3711f113 BS |
855 | system may still write to the device. For example, ext3 and ext4 will replay the |
856 | journal if the filesystem is dirty. To prevent this kind of write access, you | |
857 | may want to mount an ext3 or ext4 filesystem with the \fBro,noload\fR mount | |
858 | options or set the block device itself to read-only mode, see the | |
859 | .BR blockdev (8) | |
860 | command. | |
00d1cc1d BS |
861 | .TP |
862 | .B \-s | |
863 | Tolerate sloppy mount options rather than failing. This will ignore mount | |
864 | options not supported by a filesystem type. Not all filesystems support this | |
865 | option. Currently it's supported by the \fBmount.nfs\fR mount helper only. | |
866 | .TP | |
867 | .BI \-\-source " device" | |
96e47ad0 MK |
868 | If only one argument for the mount command is given, then the argument might be |
869 | interpreted as the target (mountpoint) or source (device). | |
870 | This option allows you to | |
00d1cc1d BS |
871 | explicitly define that the argument is the mount source. |
872 | .TP | |
873 | .BI \-\-target " directory" | |
96e47ad0 MK |
874 | If only one argument for the mount command is given, then the argument might be |
875 | interpreted as the target (mountpoint) or source (device). | |
876 | This option allows you to | |
00d1cc1d BS |
877 | explicitly define that the argument is the mount target. |
878 | .TP | |
f2cb9359 | 879 | .BI \-\-target\-prefix " directory" |
96e47ad0 MK |
880 | Prepend the specified directory to all mount targets. |
881 | This option allows to follow | |
cfd6b4dc MK |
882 | .IR fstab , |
883 | but mount operations is done on another place, for example: | |
f2cb9359 KZ |
884 | .RS |
885 | .RS | |
886 | .sp | |
887 | .B "mount \-\-all \-\-target\-prefix /chroot \-o X\-mount.mkdir | |
888 | .sp | |
889 | .RE | |
cfd6b4dc MK |
890 | mounts all from system |
891 | .I fstab | |
892 | to | |
893 | .IR /chroot , | |
96e47ad0 | 894 | all missing mountpoint are created |
cfd6b4dc MK |
895 | (due to X-mount.mkdir). See also \fB\-\-fstab\fP to use an alternative |
896 | .IR fstab . | |
f2cb9359 KZ |
897 | .RE |
898 | .TP | |
00d1cc1d | 899 | .BR \-T , " \-\-fstab " \fIpath |
cfd6b4dc MK |
900 | Specifies an alternative |
901 | .I fstab | |
96e47ad0 MK |
902 | file. |
903 | If \fIpath\fP is a directory, then the files | |
c633953c | 904 | in the directory are sorted by |
3711f113 | 905 | .BR strverscmp (3); |
cfd6b4dc MK |
906 | files that start with "."\& or without an |
907 | .I \&.fstab | |
908 | extension are ignored. The option | |
3711f113 BS |
909 | can be specified more than once. This option is mostly designed for initramfs |
910 | or chroot scripts where additional configuration is specified beyond standard | |
c633953c | 911 | system configuration. |
00d1cc1d | 912 | .sp |
3711f113 | 913 | Note that \fBmount\fR(8) does not pass the option \fB\-\-fstab\fP to the |
cfd6b4dc MK |
914 | \fB/sbin/mount.\fItype\fR helpers, meaning that the alternative |
915 | .I fstab | |
916 | files will be | |
3711f113 | 917 | invisible for the helpers. This is no problem for normal mounts, but user |
cfd6b4dc MK |
918 | (non-root) mounts always require |
919 | .I fstab | |
920 | to verify the user's rights. | |
00d1cc1d BS |
921 | .TP |
922 | .BR \-t , " \-\-types " \fIfstype | |
60a2a323 KZ |
923 | The argument following the |
924 | .B \-t | |
925 | is used to indicate the filesystem type. The filesystem types which are | |
00d1cc1d | 926 | currently supported depend on the running kernel. See |
e9b6e76a | 927 | .I /proc/filesystems |
60a2a323 | 928 | and |
1c4c6024 | 929 | .I /lib/modules/$(uname \-r)/kernel/fs |
00d1cc1d | 930 | for a complete list of the filesystems. The most common are ext2, ext3, ext4, |
e9b6e76a | 931 | xfs, btrfs, vfat, sysfs, proc, nfs and cifs. |
00d1cc1d | 932 | .sp |
60a2a323 KZ |
933 | The programs |
934 | .B mount | |
935 | and | |
936 | .B umount | |
3711f113 BS |
937 | support filesystem subtypes. The subtype is defined by a '.subtype' suffix. For |
938 | example 'fuse.sshfs'. It's recommended to use subtype notation rather than add | |
60a2a323 | 939 | any prefix to the mount source (for example 'sshfs#example.com' is |
ef75bc88 | 940 | deprecated). |
60a2a323 | 941 | |
60a2a323 KZ |
942 | If no |
943 | .B \-t | |
944 | option is given, or if the | |
945 | .B auto | |
96e47ad0 MK |
946 | type is specified, |
947 | .B mount | |
948 | will try to guess the desired type. | |
60a2a323 KZ |
949 | Mount uses the blkid library for guessing the filesystem |
950 | type; if that does not turn up anything that looks familiar, | |
96e47ad0 MK |
951 | .B mount |
952 | will try to read the file | |
60a2a323 KZ |
953 | .IR /etc/filesystems , |
954 | or, if that does not exist, | |
955 | .IR /proc/filesystems . | |
956 | All of the filesystem types listed there will be tried, | |
81421334 | 957 | except for those that are labeled "nodev" (e.g.\& |
60a2a323 KZ |
958 | .IR devpts , |
959 | .I proc | |
960 | and | |
961 | .IR nfs ). | |
962 | If | |
963 | .I /etc/filesystems | |
3711f113 | 964 | ends in a line with a single *, mount will read |
60a2a323 | 965 | .I /proc/filesystems |
3711f113 BS |
966 | afterwards. While trying, all filesystem types will be |
967 | mounted with the mount option \fBsilent\fR. | |
00d1cc1d | 968 | .sp |
60a2a323 KZ |
969 | The |
970 | .B auto | |
971 | type may be useful for user-mounted floppies. | |
972 | Creating a file | |
973 | .I /etc/filesystems | |
974 | can be useful to change the probe order (e.g., to try vfat before msdos | |
975 | or ext3 before ext2) or if you use a kernel module autoloader. | |
00d1cc1d | 976 | .sp |
3711f113 | 977 | More than one type may be specified in a comma-separated |
96e47ad0 | 978 | list, for the |
e9b6e76a | 979 | .B \-t |
96e47ad0 | 980 | option as well as in an |
e9b6e76a | 981 | .I /etc/fstab |
96e47ad0 | 982 | entry. The list of filesystem types for the |
00d1cc1d | 983 | .B \-t |
96e47ad0 | 984 | option can be prefixed with |
60a2a323 KZ |
985 | .B no |
986 | to specify the filesystem types on which no action should be taken. | |
e9b6e76a KZ |
987 | The prefix |
988 | .B no | |
00d1cc1d | 989 | has no effect when specified in an |
e9b6e76a KZ |
990 | .I /etc/fstab |
991 | entry. | |
00d1cc1d | 992 | .sp |
e9b6e76a KZ |
993 | The prefix |
994 | .B no | |
995 | can be meaningful with the | |
60a2a323 | 996 | .B \-a |
e9b6e76a | 997 | option. For example, the command |
60a2a323 KZ |
998 | .RS |
999 | .RS | |
1000 | .sp | |
6070a985 | 1001 | .B "mount \-a \-t nomsdos,smbfs" |
60a2a323 KZ |
1002 | .sp |
1003 | .RE | |
1004 | mounts all filesystems except those of type | |
1005 | .I msdos | |
1006 | and | |
6070a985 BS |
1007 | .IR smbfs . |
1008 | .sp | |
e9b6e76a KZ |
1009 | For most types all the |
1010 | .B mount | |
1011 | program has to do is issue a simple | |
42632a90 | 1012 | .BR mount (2) |
e9b6e76a KZ |
1013 | system call, and no detailed knowledge of the filesystem type is required. |
1014 | For a few types however (like nfs, nfs4, cifs, smbfs, ncpfs) an ad hoc code is | |
1015 | necessary. The nfs, nfs4, cifs, smbfs, and ncpfs filesystems | |
1016 | have a separate mount program. In order to make it possible to | |
1017 | treat all types in a uniform way, \fBmount\fR will execute the program | |
1018 | .BI /sbin/mount. type | |
1019 | (if that exists) when called with type | |
1020 | .IR type . | |
1021 | Since different versions of the | |
1022 | .B smbmount | |
1023 | program have different calling conventions, | |
1024 | .B /sbin/mount.smbfs | |
1025 | may have to be a shell script that sets up the desired call. | |
60a2a323 | 1026 | .RE |
00d1cc1d BS |
1027 | .TP |
1028 | .BR \-U , " \-\-uuid " \fIuuid | |
1029 | Mount the partition that has the specified | |
1030 | .IR uuid . | |
1031 | .TP | |
1032 | .BR \-v , " \-\-verbose" | |
1033 | Verbose mode. | |
1034 | .TP | |
b06c1ca6 | 1035 | .BR \-w , " \-\-rw" , " \-\-read\-write" |
96e47ad0 MK |
1036 | Mount the filesystem read/write. Read-write is the kernel default and the |
1037 | .BR mount | |
11b916cd KZ |
1038 | default is to try read-only if the previous mount syscall with read-write flags |
1039 | on write-protected devices of filesystems failed. | |
1040 | .sp | |
1041 | A synonym is | |
00d1cc1d | 1042 | .BR "\-o rw" . |
6dede2f2 | 1043 | |
96e47ad0 | 1044 | Note that specifying \fB\-w\fR on the command line forces \fBmount\fR to never |
11b916cd KZ |
1045 | try read-only mount on write-protected devices or already mounted read-only |
1046 | filesystems. | |
00d1cc1d BS |
1047 | .TP |
1048 | .BR \-V , " \-\-version" | |
1049 | Display version information and exit. | |
1050 | .TP | |
1051 | .BR \-h , " \-\-help" | |
1052 | Display help text and exit. | |
60a2a323 | 1053 | |
3711f113 | 1054 | .SH FILESYSTEM-INDEPENDENT MOUNT OPTIONS |
60a2a323 KZ |
1055 | Some of these options are only useful when they appear in the |
1056 | .I /etc/fstab | |
1057 | file. | |
1058 | ||
1059 | Some of these options could be enabled or disabled by default | |
3711f113 | 1060 | in the system kernel. To check the current setting see the options |
cfd6b4dc MK |
1061 | in |
1062 | .IR /proc/mounts . | |
1063 | Note that filesystems also have per-filesystem | |
58d1d54d KZ |
1064 | specific default mount options (see for example \fBtune2fs \-l\fP |
1065 | output for extN filesystems). | |
60a2a323 KZ |
1066 | |
1067 | The following options apply to any filesystem that is being | |
0d05f161 | 1068 | mounted (but not every filesystem actually honors them \(en e.g.\&, the |
60a2a323 | 1069 | .B sync |
248be5c9 | 1070 | option today has an effect only for ext2, ext3, ext4, fat, vfat, ufs and xfs): |
60a2a323 KZ |
1071 | |
1072 | .TP | |
1073 | .B async | |
3711f113 | 1074 | All I/O to the filesystem should be done asynchronously. (See also the |
60a2a323 KZ |
1075 | .B sync |
1076 | option.) | |
1077 | .TP | |
1078 | .B atime | |
81421334 BS |
1079 | Do not use the \fBnoatime\fR feature, so the inode access time is controlled |
1080 | by kernel defaults. See also the descriptions of the \fB\%relatime\fR and | |
60a2a323 | 1081 | .B strictatime |
60a2a323 KZ |
1082 | mount options. |
1083 | .TP | |
1084 | .B noatime | |
81421334 BS |
1085 | Do not update inode access times on this filesystem (e.g.\& for faster |
1086 | access on the news spool to speed up news servers). This works for all | |
1087 | inode types (directories too), so it implies \fB\%nodiratime\fR. | |
60a2a323 KZ |
1088 | .TP |
1089 | .B auto | |
1090 | Can be mounted with the | |
1091 | .B \-a | |
1092 | option. | |
1093 | .TP | |
1094 | .B noauto | |
1095 | Can only be mounted explicitly (i.e., the | |
1096 | .B \-a | |
1097 | option will not cause the filesystem to be mounted). | |
1098 | .TP | |
81421334 BS |
1099 | .na |
1100 | .BR context=\fIcontext ", " fscontext=\fIcontext ", " defcontext=\fIcontext ", and " \%rootcontext=\fIcontext | |
1101 | .ad | |
60a2a323 | 1102 | The |
0d05f161 | 1103 | .B context= |
60a2a323 KZ |
1104 | option is useful when mounting filesystems that do not support |
1105 | extended attributes, such as a floppy or hard disk formatted with VFAT, or | |
d901e427 | 1106 | systems that are not normally running under SELinux, such as an ext3 or ext4 formatted |
3711f113 | 1107 | disk from a non-SELinux workstation. You can also use |
0d05f161 | 1108 | .B context= |
3711f113 BS |
1109 | on filesystems you do not trust, such as a floppy. It also helps in compatibility with |
1110 | xattr-supporting filesystems on earlier 2.4.<x> kernel versions. Even where | |
60a2a323 KZ |
1111 | xattrs are supported, you can save time not having to label every file by |
1112 | assigning the entire disk one security context. | |
1113 | ||
1114 | A commonly used option for removable media is | |
81421334 | 1115 | .BR \%context="system_u:object_r:removable_t" . |
60a2a323 KZ |
1116 | |
1117 | Two other options are | |
0d05f161 | 1118 | .B fscontext= |
60a2a323 KZ |
1119 | and |
1120 | .BR defcontext= , | |
96e47ad0 MK |
1121 | both of which are mutually exclusive of the |
1122 | .B context= | |
1123 | option. This means you | |
60a2a323 KZ |
1124 | can use fscontext and defcontext with each other, but neither can be used with |
1125 | context. | |
1126 | ||
1127 | The | |
0d05f161 | 1128 | .B fscontext= |
60a2a323 | 1129 | option works for all filesystems, regardless of their xattr |
3711f113 BS |
1130 | support. The fscontext option sets the overarching filesystem label to a |
1131 | specific security context. This filesystem label is separate from the | |
1132 | individual labels on the files. It represents the entire filesystem for | |
60a2a323 KZ |
1133 | certain kinds of permission checks, such as during mount or file creation. |
1134 | Individual file labels are still obtained from the xattrs on the files | |
3711f113 | 1135 | themselves. The context option actually sets the aggregate context that |
60a2a323 KZ |
1136 | fscontext provides, in addition to supplying the same label for individual |
1137 | files. | |
1138 | ||
1139 | You can set the default security context for unlabeled files using | |
0d05f161 | 1140 | .B defcontext= |
3711f113 | 1141 | option. This overrides the value set for unlabeled files in the policy and requires a |
60a2a323 KZ |
1142 | filesystem that supports xattr labeling. |
1143 | ||
1144 | The | |
0d05f161 | 1145 | .B rootcontext= |
60a2a323 | 1146 | option allows you to explicitly label the root inode of a FS being mounted |
60c02107 | 1147 | before that FS or inode becomes visible to userspace. This was found to be |
96e47ad0 | 1148 | useful for things like stateless Linux. |
60a2a323 | 1149 | |
60c02107 BS |
1150 | Note that the kernel rejects any remount request that includes the context |
1151 | option, \fBeven\fP when unchanged from the current context. | |
60a2a323 | 1152 | |
60c02107 BS |
1153 | .BR "Warning: the \fIcontext\fP value might contain commas" , |
1154 | in which case the value has to be properly quoted, otherwise | |
60a2a323 | 1155 | .BR mount (8) |
60c02107 BS |
1156 | will interpret the comma as a separator between mount options. Don't forget that |
1157 | the shell strips off quotes and thus | |
1158 | .BR "double quoting is required" . | |
1159 | For example: | |
60a2a323 KZ |
1160 | .RS |
1161 | .RS | |
1162 | .sp | |
0d05f161 BIG |
1163 | .nf |
1164 | .B mount \-t tmpfs none /mnt \-o \e | |
81421334 | 1165 | .B \ \ 'context="system_u:object_r:tmp_t:s0:c127,c456",noexec' |
0d05f161 | 1166 | .fi |
60a2a323 KZ |
1167 | .sp |
1168 | .RE | |
60a2a323 | 1169 | For more details, see |
60c02107 | 1170 | .BR selinux (8). |
60a2a323 KZ |
1171 | .RE |
1172 | ||
1173 | .TP | |
1174 | .B defaults | |
3711f113 BS |
1175 | Use the default options: |
1176 | .BR rw ", " suid ", " dev ", " exec ", " auto ", " nouser ", and " async . | |
58d1d54d | 1177 | |
96e47ad0 | 1178 | Note that the real set of all default mount options depends on the kernel |
3711f113 | 1179 | and filesystem type. See the beginning of this section for more details. |
60a2a323 KZ |
1180 | .TP |
1181 | .B dev | |
1182 | Interpret character or block special devices on the filesystem. | |
1183 | .TP | |
1184 | .B nodev | |
96e47ad0 | 1185 | Do not interpret character or block special devices on the filesystem. |
60a2a323 KZ |
1186 | .TP |
1187 | .B diratime | |
3711f113 | 1188 | Update directory inode access times on this filesystem. This is the default. |
81421334 | 1189 | (This option is ignored when \fBnoatime\fR is set.) |
60a2a323 KZ |
1190 | .TP |
1191 | .B nodiratime | |
81421334 BS |
1192 | Do not update directory inode access times on this filesystem. |
1193 | (This option is implied when \fBnoatime\fR is set.) | |
60a2a323 KZ |
1194 | .TP |
1195 | .B dirsync | |
1196 | All directory updates within the filesystem should be done synchronously. | |
1197 | This affects the following system calls: creat, link, unlink, symlink, | |
1198 | mkdir, rmdir, mknod and rename. | |
1199 | .TP | |
1200 | .B exec | |
1201 | Permit execution of binaries. | |
1202 | .TP | |
1203 | .B noexec | |
3711f113 | 1204 | Do not permit direct execution of any binaries on the mounted filesystem. |
60a2a323 KZ |
1205 | .TP |
1206 | .B group | |
00d1cc1d BS |
1207 | Allow an ordinary user to mount the filesystem if one |
1208 | of that user's groups matches the group of the device. | |
60a2a323 KZ |
1209 | This option implies the options |
1210 | .BR nosuid " and " nodev | |
1211 | (unless overridden by subsequent options, as in the option line | |
1212 | .BR group,dev,suid ). | |
1213 | .TP | |
1214 | .B iversion | |
1215 | Every time the inode is modified, the i_version field will be incremented. | |
1216 | .TP | |
1217 | .B noiversion | |
1218 | Do not increment the i_version inode field. | |
1219 | .TP | |
1220 | .B mand | |
3711f113 | 1221 | Allow mandatory locks on this filesystem. See |
60a2a323 KZ |
1222 | .BR fcntl (2). |
1223 | .TP | |
1224 | .B nomand | |
1225 | Do not allow mandatory locks on this filesystem. | |
1226 | .TP | |
1227 | .B _netdev | |
1228 | The filesystem resides on a device that requires network access | |
1229 | (used to prevent the system from attempting to mount these filesystems | |
1230 | until the network has been enabled on the system). | |
1231 | .TP | |
1232 | .B nofail | |
1233 | Do not report errors for this device if it does not exist. | |
1234 | .TP | |
1235 | .B relatime | |
1236 | Update inode access times relative to modify or change time. Access | |
1237 | time is only updated if the previous access time was earlier than the | |
81421334 | 1238 | current modify or change time. (Similar to \fB\%noatime\fR, but it doesn't |
3711f113 BS |
1239 | break \fBmutt\fR or other applications that need to know if a file has been |
1240 | read since the last time it was modified.) | |
60a2a323 KZ |
1241 | |
1242 | Since Linux 2.6.30, the kernel defaults to the behavior provided by this | |
1243 | option (unless | |
81421334 | 1244 | .B \%noatime |
3711f113 | 1245 | was specified), and the |
81421334 | 1246 | .B \%strictatime |
3711f113 BS |
1247 | option is required to obtain traditional semantics. In addition, since Linux |
1248 | 2.6.30, the file's last access time is always updated if it is more than 1 | |
60a2a323 KZ |
1249 | day old. |
1250 | .TP | |
1251 | .B norelatime | |
3711f113 | 1252 | Do not use the |
60a2a323 | 1253 | .B relatime |
3711f113 | 1254 | feature. See also the |
60a2a323 KZ |
1255 | .B strictatime |
1256 | mount option. | |
1257 | .TP | |
1258 | .B strictatime | |
3711f113 BS |
1259 | Allows to explicitly request full atime updates. This makes it |
1260 | possible for the kernel to default to | |
81421334 | 1261 | .B \%relatime |
60a2a323 | 1262 | or |
81421334 | 1263 | .B \%noatime |
3711f113 | 1264 | but still allow userspace to override it. For more details about the default |
cfd6b4dc MK |
1265 | system mount options see |
1266 | .IR /proc/mounts . | |
60a2a323 KZ |
1267 | .TP |
1268 | .B nostrictatime | |
ee312c65 | 1269 | Use the kernel's default behavior for inode access time updates. |
60a2a323 | 1270 | .TP |
8c7f073a KZ |
1271 | .B lazytime |
1272 | Only update times (atime, mtime, ctime) on the in-memory version of the file inode. | |
1273 | ||
1274 | This mount option significantly reduces writes to the inode table for | |
1275 | workloads that perform frequent random writes to preallocated files. | |
8c7f073a KZ |
1276 | |
1277 | The on-disk timestamps are updated only when: | |
8c7f073a | 1278 | .RS |
96e47ad0 MK |
1279 | .IP - 2 |
1280 | the inode needs to be updated for some change unrelated to file timestamps | |
1281 | .IP - | |
1282 | the application employs | |
8c7f073a KZ |
1283 | .BR fsync (2), |
1284 | .BR syncfs (2), | |
1285 | or | |
1286 | .BR sync (2) | |
96e47ad0 MK |
1287 | .IP - |
1288 | an undeleted inode is evicted from memory | |
1289 | .IP - | |
1290 | more than 24 hours have passed since the i-node was written to disk. | |
8c7f073a KZ |
1291 | .RE |
1292 | .sp | |
1293 | .TP | |
1294 | .B nolazytime | |
c4417ee9 | 1295 | Do not use the lazytime feature. |
8c7f073a | 1296 | .TP |
60a2a323 | 1297 | .B suid |
9de7fe4a PW |
1298 | Honor set-user-ID and set-group-ID bits or file capabilities when |
1299 | executing programs from this filesystem. | |
60a2a323 KZ |
1300 | .TP |
1301 | .B nosuid | |
9de7fe4a PW |
1302 | Do not honor set-user-ID and set-group-ID bits or file capabilities when |
1303 | executing programs from this filesystem. | |
60a2a323 KZ |
1304 | .TP |
1305 | .B silent | |
1306 | Turn on the silent flag. | |
1307 | .TP | |
1308 | .B loud | |
1309 | Turn off the silent flag. | |
1310 | .TP | |
1311 | .B owner | |
00d1cc1d BS |
1312 | Allow an ordinary user to mount the filesystem if that |
1313 | user is the owner of the device. | |
60a2a323 KZ |
1314 | This option implies the options |
1315 | .BR nosuid " and " nodev | |
1316 | (unless overridden by subsequent options, as in the option line | |
1317 | .BR owner,dev,suid ). | |
1318 | .TP | |
1319 | .B remount | |
1320 | Attempt to remount an already-mounted filesystem. This is commonly | |
1321 | used to change the mount flags for a filesystem, especially to make a | |
3711f113 | 1322 | readonly filesystem writable. It does not change device or mount point. |
60a2a323 | 1323 | |
9b76b0e9 KZ |
1324 | The remount operation together with the |
1325 | .B bind | |
96e47ad0 | 1326 | flag has special semantics. See above, the subsection \fBBind mounts\fR. |
9b76b0e9 | 1327 | |
96e47ad0 MK |
1328 | The remount functionality follows the standard way the |
1329 | .B mount | |
1330 | command works | |
cfd6b4dc MK |
1331 | with options from |
1332 | .IR fstab . | |
1333 | This means that \fBmount\fR does not read | |
1334 | .I fstab | |
1335 | (or | |
1336 | .IR mtab ) | |
1337 | only when both | |
0d05f161 | 1338 | .I device |
60a2a323 | 1339 | and |
0d05f161 | 1340 | .I dir |
3711f113 | 1341 | are specified. |
81421334 BS |
1342 | .sp |
1343 | .in +4 | |
0d05f161 | 1344 | .B "mount \-o remount,rw /dev/foo /dir" |
81421334 BS |
1345 | .in |
1346 | .sp | |
60a2a323 | 1347 | After this call all old mount options are replaced and arbitrary stuff from |
cfd6b4dc MK |
1348 | .I fstab |
1349 | (or | |
1350 | .IR mtab ) | |
1351 | is ignored, except the loop= option which is internally | |
24983035 | 1352 | generated and maintained by the mount command. |
81421334 BS |
1353 | .sp |
1354 | .in +4 | |
0d05f161 | 1355 | .B "mount \-o remount,rw /dir" |
81421334 BS |
1356 | .in |
1357 | .sp | |
cfd6b4dc MK |
1358 | After this call, mount reads |
1359 | .I fstab | |
1360 | and merges these options with | |
81421334 | 1361 | the options from the command line (\fB\-o\fR). |
cfd6b4dc MK |
1362 | If no mountpoint is found in |
1363 | .IR fstab , | |
1364 | then a remount with unspecified source is | |
24983035 | 1365 | allowed. |
c22fc041 | 1366 | .sp |
96e47ad0 MK |
1367 | .B mount |
1368 | allows the use of \fB\-\-all\fR to remount all already mounted filesystems | |
c22fc041 KZ |
1369 | which match a specified filter (\fB\-O\fR and \fB\-t\fR). For example: |
1370 | .sp | |
1371 | .in +4 | |
1c4c6024 | 1372 | .B "mount \-\-all \-o remount,ro \-t vfat" |
c22fc041 KZ |
1373 | .in |
1374 | .sp | |
96e47ad0 MK |
1375 | remounts all already mounted vfat filesystems in read-only mode. Each of the |
1376 | filesystems is remounted by "mount \-o remount,ro /dir" semantic. | |
1377 | This means the | |
1378 | .B mount | |
1379 | command reads | |
cfd6b4dc MK |
1380 | .I fstab |
1381 | or | |
1382 | .I mtab | |
1383 | and merges these options with the options | |
c22fc041 | 1384 | from the command line. |
60a2a323 KZ |
1385 | .TP |
1386 | .B ro | |
1387 | Mount the filesystem read-only. | |
1388 | .TP | |
1389 | .B rw | |
1390 | Mount the filesystem read-write. | |
1391 | .TP | |
1392 | .B sync | |
3711f113 BS |
1393 | All I/O to the filesystem should be done synchronously. In the case of |
1394 | media with a limited number of write cycles | |
1395 | (e.g.\& some flash drives), \fBsync\fR may cause life-cycle shortening. | |
60a2a323 KZ |
1396 | .TP |
1397 | .B user | |
1398 | Allow an ordinary user to mount the filesystem. | |
cfd6b4dc MK |
1399 | The name of the mounting user is written to the |
1400 | .I mtab | |
1401 | file (or to the private | |
1402 | libmount file in | |
1403 | .I /run/mount | |
1404 | on systems without a regular | |
1405 | .IR mtab ) | |
1406 | so that this | |
00d1cc1d | 1407 | same user can unmount the filesystem again. |
60a2a323 KZ |
1408 | This option implies the options |
1409 | .BR noexec ", " nosuid ", and " nodev | |
1410 | (unless overridden by subsequent options, as in the option line | |
1411 | .BR user,exec,dev,suid ). | |
1412 | .TP | |
1413 | .B nouser | |
00d1cc1d | 1414 | Forbid an ordinary user to mount the filesystem. |
08626e33 | 1415 | This is the default; it does not imply any other options. |
60a2a323 KZ |
1416 | .TP |
1417 | .B users | |
00d1cc1d BS |
1418 | Allow any user to mount and to unmount the filesystem, even |
1419 | when some other ordinary user mounted it. | |
60a2a323 KZ |
1420 | This option implies the options |
1421 | .BR noexec ", " nosuid ", and " nodev | |
1422 | (unless overridden by subsequent options, as in the option line | |
1423 | .BR users,exec,dev,suid ). | |
f3242e06 | 1424 | .TP |
0a14cc8b KZ |
1425 | .B X-* |
1426 | All options prefixed with "X-" are interpreted as comments or as userspace | |
cfd6b4dc | 1427 | application-specific options. |
96e47ad0 | 1428 | These options are not stored in user space (e.g., |
cfd6b4dc MK |
1429 | .I mtab |
1430 | file), | |
00d1cc1d | 1431 | nor sent to the mount.\fItype\fR helpers nor to the |
0d05f161 | 1432 | .BR mount (2) |
0a14cc8b | 1433 | system call. The suggested format is \fBX-\fIappname\fR.\fIoption\fR. |
83601b1a | 1434 | .TP |
0a14cc8b | 1435 | .B x-* |
96e47ad0 MK |
1436 | The same as \fBX-*\fR options, but stored permanently in user space. |
1437 | This means the options are also available for | |
1438 | .B umount | |
1439 | or other operations. Note | |
1440 | that maintaining mount options in user space is tricky, | |
1441 | because it's necessary use | |
1442 | libmount-based tools and there is no guarantee that the options will be always | |
0a14cc8b | 1443 | available (for example after a move mount operation or in unshared namespace). |
5c493bd9 | 1444 | |
0a14cc8b | 1445 | Note that before util-linux v2.30 the x-* options have not been maintained by |
96e47ad0 MK |
1446 | libmount and stored in user space (functionality was the same as for X-* now), |
1447 | but due to the growing number of use-cases (in initrd, systemd etc.) the | |
1448 | functionality has been extended to keep existing | |
cfd6b4dc MK |
1449 | .I fstab |
1450 | configurations usable | |
0a14cc8b | 1451 | without a change. |
701c6961 | 1452 | .TP |
0a14cc8b | 1453 | .BR X-mount.mkdir [ = \fImode\fR ] |
88f04bf9 KZ |
1454 | Allow to make a target directory (mountpoint) if it does not exit yet. |
1455 | The optional argument | |
3711f113 BS |
1456 | .I mode |
1457 | specifies the filesystem access mode used for | |
0d05f161 | 1458 | .BR mkdir (2) |
3711f113 | 1459 | in octal notation. The default mode is 0755. This functionality is supported |
6b0094d0 | 1460 | only for root users or when mount executed without suid permissions. The option |
88f04bf9 | 1461 | is also supported as x-mount.mkdir, this notation is deprecated since v2.30. |
60a2a323 | 1462 | |
5a829806 | 1463 | .SH FILESYSTEM-SPECIFIC MOUNT OPTIONS |
b3222042 MK |
1464 | This section lists options that are specific to particular filesystems. |
1465 | Where possible, you should first consult filesystem-specific manual pages | |
1466 | for details. | |
1467 | Some of those pages are listed in the following table. | |
1468 | .TS | |
1469 | lb lb | |
1470 | l l. | |
1471 | Filesystem(s) Manual page | |
1472 | btrfs \fBbtrfs\fP(5) | |
1473 | cifs \fBmount.cifs\fP(8) | |
1474 | ext2, ext3, ext4 \fBext4\fP(5) | |
1475 | fuse \fBfuse\fP(8) | |
1476 | nfs \fBnfs\fP(5) | |
1477 | tmpfs \fBtmpfs\fP(5) | |
1478 | xfs \fBxfs\fP(5) | |
1479 | .TE | |
1480 | .PP | |
1481 | Note that some of the pages listed above might be available only | |
1482 | after you install the respective userland tools. | |
1483 | .PP | |
60a2a323 | 1484 | The following options apply only to certain filesystems. |
b3222042 MK |
1485 | We sort them by filesystem. |
1486 | All options follow the | |
60a2a323 KZ |
1487 | .B \-o |
1488 | flag. | |
b3222042 | 1489 | .PP |
60a2a323 | 1490 | What options are supported depends a bit on the running kernel. |
b3222042 MK |
1491 | Further information may be available in fileystem-specific |
1492 | files in the kernel source subdirectory | |
60a2a323 | 1493 | .IR Documentation/filesystems . |
b3222042 | 1494 | .\" |
81421334 | 1495 | .SS "Mount options for adfs" |
60a2a323 | 1496 | .TP |
0d05f161 | 1497 | \fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP |
60a2a323 KZ |
1498 | Set the owner and group of the files in the filesystem (default: uid=gid=0). |
1499 | .TP | |
0d05f161 | 1500 | \fBownmask=\fP\,\fIvalue\fP and \fBothmask=\fP\,\fIvalue\fP |
60a2a323 KZ |
1501 | Set the permission mask for ADFS 'owner' permissions and 'other' permissions, |
1502 | respectively (default: 0700 and 0077, respectively). | |
1503 | See also | |
5fdb0866 | 1504 | .IR /usr/src/linux/Documentation/filesystems/adfs.rst . |
81421334 BS |
1505 | |
1506 | .SS "Mount options for affs" | |
60a2a323 | 1507 | .TP |
0d05f161 | 1508 | \fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP |
60a2a323 KZ |
1509 | Set the owner and group of the root of the filesystem (default: uid=gid=0, |
1510 | but with option | |
1511 | .B uid | |
1512 | or | |
1513 | .B gid | |
a72fa61a | 1514 | without specified value, the UID and GID of the current process are taken). |
60a2a323 | 1515 | .TP |
0d05f161 | 1516 | \fBsetuid=\fP\,\fIvalue\fP and \fBsetgid=\fP\,\fIvalue\fP |
60a2a323 KZ |
1517 | Set the owner and group of all files. |
1518 | .TP | |
1519 | .BI mode= value | |
1520 | Set the mode of all files to | |
1521 | .IR value " & 0777" | |
1522 | disregarding the original permissions. | |
1523 | Add search permission to directories that have read permission. | |
1524 | The value is given in octal. | |
1525 | .TP | |
1526 | .B protect | |
1527 | Do not allow any changes to the protection bits on the filesystem. | |
1528 | .TP | |
1529 | .B usemp | |
a72fa61a | 1530 | Set UID and GID of the root of the filesystem to the UID and GID |
60a2a323 | 1531 | of the mount point upon the first sync or umount, and then |
3711f113 | 1532 | clear this option. Strange... |
60a2a323 KZ |
1533 | .TP |
1534 | .B verbose | |
1535 | Print an informational message for each successful mount. | |
1536 | .TP | |
1537 | .BI prefix= string | |
1538 | Prefix used before volume name, when following a link. | |
1539 | .TP | |
1540 | .BI volume= string | |
1541 | Prefix (of length at most 30) used before '/' when following a symbolic link. | |
1542 | .TP | |
1543 | .BI reserved= value | |
1544 | (Default: 2.) Number of unused blocks at the start of the device. | |
1545 | .TP | |
1546 | .BI root= value | |
1547 | Give explicitly the location of the root block. | |
1548 | .TP | |
1549 | .BI bs= value | |
3711f113 | 1550 | Give blocksize. Allowed values are 512, 1024, 2048, 4096. |
60a2a323 KZ |
1551 | .TP |
1552 | .BR grpquota | noquota | quota | usrquota | |
1553 | These options are accepted but ignored. | |
1554 | (However, quota utilities may react to such strings in | |
1555 | .IR /etc/fstab .) | |
81421334 | 1556 | |
81421334 | 1557 | .SS "Mount options for debugfs" |
60a2a323 KZ |
1558 | The debugfs filesystem is a pseudo filesystem, traditionally mounted on |
1559 | .IR /sys/kernel/debug . | |
1560 | .\" or just /debug | |
1561 | .\" present since 2.6.11 | |
88633047 DR |
1562 | As of kernel version 3.4, debugfs has the following options: |
1563 | .TP | |
1564 | .BI uid= n ", gid=" n | |
1565 | Set the owner and group of the mountpoint. | |
1566 | .TP | |
1567 | .BI mode= value | |
1568 | Sets the mode of the mountpoint. | |
81421334 BS |
1569 | |
1570 | .SS "Mount options for devpts" | |
60a2a323 KZ |
1571 | The devpts filesystem is a pseudo filesystem, traditionally mounted on |
1572 | .IR /dev/pts . | |
1573 | In order to acquire a pseudo terminal, a process opens | |
1574 | .IR /dev/ptmx ; | |
1575 | the number of the pseudo terminal is then made available to the process | |
1576 | and the pseudo terminal slave can be accessed as | |
1577 | .IR /dev/pts/ <number>. | |
1578 | .TP | |
0d05f161 | 1579 | \fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP |
96e47ad0 | 1580 | This sets the owner or the group of newly created pseudo terminals to |
3711f113 | 1581 | the specified values. When nothing is specified, they will |
60a2a323 KZ |
1582 | be set to the UID and GID of the creating process. |
1583 | For example, if there is a tty group with GID 5, then | |
1584 | .B gid=5 | |
96e47ad0 | 1585 | will cause newly created pseudo terminals to belong to the tty group. |
60a2a323 KZ |
1586 | .TP |
1587 | .BI mode= value | |
96e47ad0 | 1588 | Set the mode of newly created pseudo terminals to the specified value. |
60a2a323 KZ |
1589 | The default is 0600. |
1590 | A value of | |
1591 | .B mode=620 | |
1592 | and | |
1593 | .B gid=5 | |
96e47ad0 | 1594 | makes "mesg y" the default on newly created pseudo terminals. |
60a2a323 KZ |
1595 | .TP |
1596 | \fBnewinstance | |
96e47ad0 MK |
1597 | Create a private instance of the devpts filesystem, such that |
1598 | indices of pseudo terminals allocated in this new instance are | |
60a2a323 KZ |
1599 | independent of indices created in other instances of devpts. |
1600 | ||
1601 | All mounts of devpts without this | |
1602 | .B newinstance | |
96e47ad0 | 1603 | option share the same set of pseudo terminal indices (i.e., legacy mode). |
60a2a323 KZ |
1604 | Each mount of devpts with the |
1605 | .B newinstance | |
96e47ad0 | 1606 | option has a private set of pseudo terminal indices. |
60a2a323 KZ |
1607 | |
1608 | This option is mainly used to support containers in the | |
96e47ad0 | 1609 | Linux kernel. It is implemented in Linux kernel versions |
60a2a323 KZ |
1610 | starting with 2.6.29. Further, this mount option is valid |
1611 | only if CONFIG_DEVPTS_MULTIPLE_INSTANCES is enabled in the | |
1612 | kernel configuration. | |
1613 | ||
1614 | To use this option effectively, | |
0d05f161 | 1615 | .I /dev/ptmx |
60a2a323 | 1616 | must be a symbolic link to |
96e47ad0 | 1617 | .IR pts/ptmx . |
60a2a323 | 1618 | See |
0d05f161 | 1619 | .I Documentation/filesystems/devpts.txt |
96e47ad0 | 1620 | in the Linux kernel source tree for details. |
60a2a323 KZ |
1621 | .TP |
1622 | .BI ptmxmode= value | |
1623 | ||
1624 | Set the mode for the new | |
0d05f161 | 1625 | .I ptmx |
60a2a323 KZ |
1626 | device node in the devpts filesystem. |
1627 | ||
1628 | With the support for multiple instances of devpts (see | |
1629 | .B newinstance | |
1630 | option above), each instance has a private | |
0d05f161 | 1631 | .I ptmx |
60a2a323 | 1632 | node in the root of the devpts filesystem (typically |
0d05f161 | 1633 | .IR /dev/pts/ptmx ). |
60a2a323 KZ |
1634 | |
1635 | For compatibility with older versions of the kernel, the | |
1636 | default mode of the new | |
0d05f161 | 1637 | .I ptmx |
60a2a323 KZ |
1638 | node is 0000. |
1639 | .BI ptmxmode= value | |
1640 | specifies a more useful mode for the | |
0d05f161 | 1641 | .I ptmx |
60a2a323 KZ |
1642 | node and is highly recommended when the |
1643 | .B newinstance | |
1644 | option is specified. | |
1645 | ||
96e47ad0 | 1646 | This option is only implemented in Linux kernel versions |
3711f113 | 1647 | starting with 2.6.29. Further, this option is valid only if |
60a2a323 KZ |
1648 | CONFIG_DEVPTS_MULTIPLE_INSTANCES is enabled in the kernel |
1649 | configuration. | |
1650 | ||
81421334 | 1651 | .SS "Mount options for fat" |
60a2a323 KZ |
1652 | (Note: |
1653 | .I fat | |
1654 | is not a separate filesystem, but a common part of the | |
1655 | .IR msdos , | |
1656 | .I umsdos | |
1657 | and | |
1658 | .I vfat | |
1659 | filesystems.) | |
1660 | .TP | |
1661 | .BR blocksize= { 512 | 1024 | 2048 } | |
3711f113 | 1662 | Set blocksize (default 512). This option is obsolete. |
60a2a323 | 1663 | .TP |
0d05f161 | 1664 | \fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP |
60a2a323 | 1665 | Set the owner and group of all files. |
a72fa61a | 1666 | (Default: the UID and GID of the current process.) |
60a2a323 KZ |
1667 | .TP |
1668 | .BI umask= value | |
1669 | Set the umask (the bitmask of the permissions that are | |
1670 | .B not | |
3711f113 | 1671 | present). The default is the umask of the current process. |
60a2a323 KZ |
1672 | The value is given in octal. |
1673 | .TP | |
1674 | .BI dmask= value | |
1675 | Set the umask applied to directories only. | |
1676 | The default is the umask of the current process. | |
1677 | The value is given in octal. | |
60a2a323 KZ |
1678 | .TP |
1679 | .BI fmask= value | |
1680 | Set the umask applied to regular files only. | |
1681 | The default is the umask of the current process. | |
1682 | The value is given in octal. | |
60a2a323 KZ |
1683 | .TP |
1684 | .BI allow_utime= value | |
1685 | This option controls the permission check of mtime/atime. | |
1686 | .RS | |
1687 | .TP | |
1688 | .B 20 | |
1689 | If current process is in group of file's group ID, you can change timestamp. | |
1690 | .TP | |
1691 | .B 2 | |
1692 | Other users can change timestamp. | |
1693 | .PP | |
1694 | The default is set from `dmask' option. (If the directory is writable, | |
8323d9fd | 1695 | .BR utime (2) |
3711f113 | 1696 | is also allowed. I.e.\& \s+3~\s0dmask & 022) |
60a2a323 KZ |
1697 | |
1698 | Normally | |
8323d9fd | 1699 | .BR utime (2) |
96e47ad0 MK |
1700 | checks that the current process is owner of the file, or that it has the |
1701 | .B CAP_FOWNER | |
1702 | capability. But FAT filesystems don't have UID/GID on disk, so the | |
3711f113 | 1703 | normal check is too inflexible. With this option you can relax it. |
60a2a323 KZ |
1704 | .RE |
1705 | .TP | |
1706 | .BI check= value | |
b9c3b903 | 1707 | Three different levels of pickiness can be chosen: |
60a2a323 KZ |
1708 | .RS |
1709 | .TP | |
1710 | .BR r [ elaxed ] | |
1711 | Upper and lower case are accepted and equivalent, long name parts are | |
fb724eef | 1712 | truncated (e.g.\& |
60a2a323 KZ |
1713 | .I verylongname.foobar |
1714 | becomes | |
1715 | .IR verylong.foo ), | |
1716 | leading and embedded spaces are accepted in each name part (name and extension). | |
1717 | .TP | |
1718 | .BR n [ ormal ] | |
1719 | Like "relaxed", but many special characters (*, ?, <, spaces, etc.) are | |
1720 | rejected. This is the default. | |
1721 | .TP | |
1722 | .BR s [ trict ] | |
3711f113 BS |
1723 | Like "normal", but names that contain long parts or special characters |
1724 | that are sometimes used on Linux but are not accepted by MS-DOS | |
1725 | (+, =, etc.) are rejected. | |
60a2a323 KZ |
1726 | .RE |
1727 | .TP | |
1728 | .BI codepage= value | |
1729 | Sets the codepage for converting to shortname characters on FAT | |
3711f113 | 1730 | and VFAT filesystems. By default, codepage 437 is used. |
60a2a323 | 1731 | .TP |
3711f113 | 1732 | .BI conv= mode |
96e47ad0 | 1733 | This option is obsolete and may fail or be ignored. |
60a2a323 KZ |
1734 | .TP |
1735 | .BI cvf_format= module | |
1736 | Forces the driver to use the CVF (Compressed Volume File) module | |
1737 | .RI cvf_ module | |
3711f113 | 1738 | instead of auto-detection. If the kernel supports kmod, the |
60a2a323 KZ |
1739 | cvf_format=xxx option also controls on-demand CVF module loading. |
1740 | This option is obsolete. | |
1741 | .TP | |
1742 | .BI cvf_option= option | |
3711f113 | 1743 | Option passed to the CVF module. This option is obsolete. |
60a2a323 KZ |
1744 | .TP |
1745 | .B debug | |
1746 | Turn on the | |
1747 | .I debug | |
1748 | flag. A version string and a list of filesystem parameters will be | |
1749 | printed (these data are also printed if the parameters appear to be | |
1750 | inconsistent). | |
1751 | .TP | |
ec34526a SM |
1752 | .B discard |
1753 | If set, causes discard/TRIM commands to be issued to the block device | |
3711f113 | 1754 | when blocks are freed. This is useful for SSD devices and |
f036b4c7 | 1755 | sparse/thinly-provisioned LUNs. |
ec34526a | 1756 | .TP |
3c1f7603 JK |
1757 | .B dos1xfloppy |
1758 | If set, use a fallback default BIOS Parameter Block configuration, determined | |
81421334 | 1759 | by backing device size. These static parameters match defaults assumed by DOS |
3c1f7603 JK |
1760 | 1.x for 160 kiB, 180 kiB, 320 kiB, and 360 kiB floppies and floppy images. |
1761 | .TP | |
1762 | .BR errors= { panic | continue | remount-ro } | |
1763 | Specify FAT behavior on critical errors: panic, continue without doing | |
1764 | anything, or remount the partition in read-only mode (default behavior). | |
1765 | .TP | |
1766 | .BR fat= { 12 | 16 | 32 } | |
60a2a323 KZ |
1767 | Specify a 12, 16 or 32 bit fat. This overrides |
1768 | the automatic FAT type detection routine. Use with caution! | |
1769 | .TP | |
1770 | .BI iocharset= value | |
1771 | Character set to use for converting between 8 bit characters | |
3711f113 | 1772 | and 16 bit Unicode characters. The default is iso8859-1. |
60a2a323 KZ |
1773 | Long filenames are stored on disk in Unicode format. |
1774 | .TP | |
3c1f7603 JK |
1775 | .BR nfs= { stale_rw | nostale_ro } |
1776 | Enable this only if you want to export the FAT filesystem over NFS. | |
1777 | ||
1778 | .BR stale_rw : | |
1779 | This option maintains an index (cache) of directory inodes which is used by the | |
81421334 | 1780 | nfs-related code to improve look-ups. Full file operations (read/write) over |
3c1f7603 JK |
1781 | NFS are supported but with cache eviction at NFS server, this could result in |
1782 | spurious | |
1783 | .B ESTALE | |
1784 | errors. | |
1785 | ||
1786 | .BR nostale_ro : | |
d35df4db | 1787 | This option bases the inode number and file handle |
3c1f7603 JK |
1788 | on the on-disk location of a file in the FAT directory entry. |
1789 | This ensures that | |
1790 | .B ESTALE | |
1791 | will not be returned after a file is | |
81421334 | 1792 | evicted from the inode cache. However, it means that operations |
d35df4db | 1793 | such as rename, create and unlink could cause file handles that |
3c1f7603 | 1794 | previously pointed at one file to point at a different file, |
81421334 | 1795 | potentially causing data corruption. For this reason, this |
3c1f7603 JK |
1796 | option also mounts the filesystem readonly. |
1797 | ||
1c4c6024 | 1798 | To maintain backward compatibility, '\-o nfs' is also accepted, |
3c1f7603 JK |
1799 | defaulting to |
1800 | .BR stale_rw . | |
ec34526a | 1801 | .TP |
0bb7e904 | 1802 | .B tz=UTC |
60a2a323 KZ |
1803 | This option disables the conversion of timestamps |
1804 | between local time (as used by Windows on FAT) and UTC | |
1805 | (which Linux uses internally). This is particularly | |
1806 | useful when mounting devices (like digital cameras) | |
1807 | that are set to UTC in order to avoid the pitfalls of | |
1808 | local time. | |
1809 | .TP | |
b7b16b0b JK |
1810 | .BI time_offset= minutes |
1811 | Set offset for conversion of timestamps from local time used by FAT to UTC. | |
1812 | I.e., | |
1813 | .I minutes | |
6627bc79 | 1814 | will be subtracted from each timestamp to convert it to UTC used |
81421334 | 1815 | internally by Linux. This is useful when the time zone set in the kernel via |
b7b16b0b | 1816 | .BR settimeofday (2) |
81421334 | 1817 | is not the time zone used by the filesystem. Note |
b7b16b0b JK |
1818 | that this option still does not provide correct time stamps in all cases in |
1819 | presence of DST - time stamps in a different DST setting will be off by one | |
1820 | hour. | |
1821 | .TP | |
60a2a323 KZ |
1822 | .B quiet |
1823 | Turn on the | |
1824 | .I quiet | |
1825 | flag. Attempts to chown or chmod files do not return errors, | |
3711f113 | 1826 | although they fail. Use with caution! |
60a2a323 | 1827 | .TP |
3c1f7603 | 1828 | .B rodir |
81421334 | 1829 | FAT has the ATTR_RO (read-only) attribute. On Windows, the ATTR_RO of the |
3c1f7603 | 1830 | directory will just be ignored, and is used only by applications as a flag |
81421334 | 1831 | (e.g.\& it's set for the customized folder). |
3c1f7603 JK |
1832 | |
1833 | If you want to use ATTR_RO as read-only flag even for the directory, set this | |
1834 | option. | |
1835 | .TP | |
60a2a323 KZ |
1836 | .B showexec |
1837 | If set, the execute permission bits of the file will be allowed only if | |
3711f113 | 1838 | the extension part of the name is \&.EXE, \&.COM, or \&.BAT. Not set by default. |
60a2a323 KZ |
1839 | .TP |
1840 | .B sys_immutable | |
1841 | If set, ATTR_SYS attribute on FAT is handled as IMMUTABLE flag on Linux. | |
1842 | Not set by default. | |
1843 | .TP | |
1844 | .B flush | |
1845 | If set, the filesystem will try to flush to disk more early than normal. | |
1846 | Not set by default. | |
1847 | .TP | |
1848 | .B usefree | |
3711f113 | 1849 | Use the "free clusters" value stored on FSINFO. It'll |
60a2a323 | 1850 | be used to determine number of free clusters without |
3711f113 | 1851 | scanning disk. But it's not used by default, because |
60a2a323 | 1852 | recent Windows don't update it correctly in some |
3711f113 | 1853 | case. If you are sure the "free clusters" on FSINFO is |
60a2a323 KZ |
1854 | correct, by this option you can avoid scanning disk. |
1855 | .TP | |
1856 | .BR dots ", " nodots ", " dotsOK= [ yes | no ] | |
1857 | Various misguided attempts to force Unix or DOS conventions | |
1858 | onto a FAT filesystem. | |
1859 | ||
81421334 | 1860 | .SS "Mount options for hfs" |
60a2a323 KZ |
1861 | .TP |
1862 | .BI creator= cccc ", type=" cccc | |
1863 | Set the creator/type values as shown by the MacOS finder | |
1864 | used for creating new files. Default values: '????'. | |
1865 | .TP | |
1866 | .BI uid= n ", gid=" n | |
1867 | Set the owner and group of all files. | |
a72fa61a | 1868 | (Default: the UID and GID of the current process.) |
60a2a323 KZ |
1869 | .TP |
1870 | .BI dir_umask= n ", file_umask=" n ", umask=" n | |
1871 | Set the umask used for all directories, all regular files, or all | |
1872 | files and directories. Defaults to the umask of the current process. | |
1873 | .TP | |
1874 | .BI session= n | |
1875 | Select the CDROM session to mount. | |
1876 | Defaults to leaving that decision to the CDROM driver. | |
1877 | This option will fail with anything but a CDROM as underlying device. | |
1878 | .TP | |
1879 | .BI part= n | |
1880 | Select partition number n from the device. | |
1881 | Only makes sense for CDROMs. | |
1882 | Defaults to not parsing the partition table at all. | |
1883 | .TP | |
1884 | .B quiet | |
1885 | Don't complain about invalid mount options. | |
1886 | ||
81421334 | 1887 | .SS "Mount options for hpfs" |
60a2a323 | 1888 | .TP |
0d05f161 | 1889 | \fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP |
a72fa61a | 1890 | Set the owner and group of all files. (Default: the UID and GID |
60a2a323 KZ |
1891 | of the current process.) |
1892 | .TP | |
1893 | .BI umask= value | |
1894 | Set the umask (the bitmask of the permissions that are | |
1895 | .B not | |
3711f113 | 1896 | present). The default is the umask of the current process. |
60a2a323 KZ |
1897 | The value is given in octal. |
1898 | .TP | |
1899 | .BR case= { lower | asis } | |
1900 | Convert all files names to lower case, or leave them. | |
1901 | (Default: | |
1902 | .BR case=lower .) | |
1903 | .TP | |
9f3d0fce RM |
1904 | .BI conv= mode |
1905 | This option is obsolete and may fail or being ignored. | |
60a2a323 KZ |
1906 | .TP |
1907 | .B nocheck | |
1908 | Do not abort mounting when certain consistency checks fail. | |
1909 | ||
81421334 | 1910 | .SS "Mount options for iso9660" |
60a2a323 | 1911 | ISO 9660 is a standard describing a filesystem structure to be used |
3711f113 | 1912 | on CD-ROMs. (This filesystem type is also seen on some DVDs. See also the |
60a2a323 KZ |
1913 | .I udf |
1914 | filesystem.) | |
1915 | ||
1916 | Normal | |
1917 | .I iso9660 | |
b9c3b903 | 1918 | filenames appear in an 8.3 format (i.e., DOS-like restrictions on filename |
60a2a323 KZ |
1919 | length), and in addition all characters are in upper case. Also there is |
1920 | no field for file ownership, protection, number of links, provision for | |
1921 | block/character devices, etc. | |
1922 | ||
1923 | Rock Ridge is an extension to iso9660 that provides all of these UNIX-like | |
1924 | features. Basically there are extensions to each directory record that | |
1925 | supply all of the additional information, and when Rock Ridge is in use, | |
1926 | the filesystem is indistinguishable from a normal UNIX filesystem (except | |
1927 | that it is read-only, of course). | |
1928 | .TP | |
1929 | .B norock | |
3711f113 | 1930 | Disable the use of Rock Ridge extensions, even if available. Cf.\& |
60a2a323 KZ |
1931 | .BR map . |
1932 | .TP | |
1933 | .B nojoliet | |
3711f113 | 1934 | Disable the use of Microsoft Joliet extensions, even if available. Cf.\& |
60a2a323 KZ |
1935 | .BR map . |
1936 | .TP | |
1937 | .BR check= { r [ elaxed ]| s [ trict ]} | |
1938 | With | |
1939 | .BR check=relaxed , | |
1940 | a filename is first converted to lower case before doing the lookup. | |
1941 | This is probably only meaningful together with | |
1942 | .B norock | |
1943 | and | |
1944 | .BR map=normal . | |
1945 | (Default: | |
1946 | .BR check=strict .) | |
1947 | .TP | |
0d05f161 | 1948 | \fBuid=\fP\,\fIvalue\fP and \fBgid=\fP\,\fIvalue\fP |
60a2a323 KZ |
1949 | Give all files in the filesystem the indicated user or group id, |
1950 | possibly overriding the information found in the Rock Ridge extensions. | |
1951 | (Default: | |
1952 | .BR uid=0,gid=0 .) | |
1953 | .TP | |
1954 | .BR map= { n [ ormal ]| o [ ff ]| a [ corn ]} | |
1955 | For non-Rock Ridge volumes, normal name translation maps upper | |
1956 | to lower case ASCII, drops a trailing `;1', and converts `;' to `.'. | |
1957 | With | |
1958 | .B map=off | |
3711f113 | 1959 | no name translation is done. See |
60a2a323 KZ |
1960 | .BR norock . |
1961 | (Default: | |
1962 | .BR map=normal .) | |
1963 | .B map=acorn | |
1964 | is like | |
0d05f161 | 1965 | .B map=normal |
60a2a323 KZ |
1966 | but also apply Acorn extensions if present. |
1967 | .TP | |
1968 | .BI mode= value | |
1969 | For non-Rock Ridge volumes, give all files the indicated mode. | |
9167f4c2 | 1970 | (Default: read and execute permission for everybody.) |
9f3d0fce | 1971 | Octal mode values require a leading 0. |
60a2a323 KZ |
1972 | .TP |
1973 | .B unhide | |
1974 | Also show hidden and associated files. | |
1975 | (If the ordinary files and the associated or hidden files have | |
1976 | the same filenames, this may make the ordinary files inaccessible.) | |
1977 | .TP | |
1978 | .BR block= { 512 | 1024 | 2048 } | |
1979 | Set the block size to the indicated value. | |
1980 | (Default: | |
1981 | .BR block=1024 .) | |
1982 | .TP | |
9f3d0fce RM |
1983 | .BI conv= mode |
1984 | This option is obsolete and may fail or being ignored. | |
60a2a323 KZ |
1985 | .TP |
1986 | .B cruft | |
1987 | If the high byte of the file length contains other garbage, | |
1988 | set this mount option to ignore the high order bits of the file length. | |
fb724eef | 1989 | This implies that a file cannot be larger than 16\ MB. |
60a2a323 KZ |
1990 | .TP |
1991 | .BI session= x | |
9f3d0fce | 1992 | Select number of session on multisession CD. |
60a2a323 KZ |
1993 | .TP |
1994 | .BI sbsector= xxx | |
9f3d0fce | 1995 | Session begins from sector xxx. |
60a2a323 KZ |
1996 | .LP |
1997 | The following options are the same as for vfat and specifying them only makes | |
1998 | sense when using discs encoded using Microsoft's Joliet extensions. | |
1999 | .TP | |
2000 | .BI iocharset= value | |
2001 | Character set to use for converting 16 bit Unicode characters on CD | |
3711f113 | 2002 | to 8 bit characters. The default is iso8859-1. |
60a2a323 KZ |
2003 | .TP |
2004 | .B utf8 | |
2005 | Convert 16 bit Unicode characters on CD to UTF-8. | |
2006 | ||
81421334 | 2007 | .SS "Mount options for jfs" |
60a2a323 KZ |
2008 | .TP |
2009 | .BI iocharset= name | |
2010 | Character set to use for converting from Unicode to ASCII. The default is | |
2011 | to do no conversion. Use | |
2012 | .B iocharset=utf8 | |
2013 | for UTF8 translations. This requires CONFIG_NLS_UTF8 to be set in | |
2014 | the kernel | |
2015 | .I ".config" | |
2016 | file. | |
2017 | .TP | |
2018 | .BI resize= value | |
2019 | Resize the volume to | |
2020 | .I value | |
3711f113 BS |
2021 | blocks. JFS only supports growing a volume, not shrinking it. This option |
2022 | is only valid during a remount, when the volume is mounted read-write. The | |
60a2a323 KZ |
2023 | .B resize |
2024 | keyword with no value will grow the volume to the full size of the partition. | |
2025 | .TP | |
2026 | .B nointegrity | |
2027 | Do not write to the journal. The primary use of this option is to allow | |
3711f113 | 2028 | for higher performance when restoring a volume from backup media. The |
f036b4c7 | 2029 | integrity of the volume is not guaranteed if the system abnormally ends. |
60a2a323 KZ |
2030 | .TP |
2031 | .B integrity | |
2032 | Default. Commit metadata changes to the journal. Use this option to remount | |
2033 | a volume where the | |
2034 | .B nointegrity | |
2035 | option was previously specified in order to restore normal behavior. | |
2036 | .TP | |
2037 | .BR errors= { continue | remount-ro | panic } | |
ee312c65 | 2038 | Define the behavior when an error is encountered. |
60a2a323 KZ |
2039 | (Either ignore errors and just mark the filesystem erroneous and continue, |
2040 | or remount the filesystem read-only, or panic and halt the system.) | |
2041 | .TP | |
2042 | .BR noquota | quota | usrquota | grpquota | |
2043 | These options are accepted but ignored. | |
2044 | ||
81421334 | 2045 | .SS "Mount options for msdos" |
60a2a323 KZ |
2046 | See mount options for fat. |
2047 | If the | |
2048 | .I msdos | |
2049 | filesystem detects an inconsistency, it reports an error and sets the file | |
3711f113 | 2050 | system read-only. The filesystem can be made writable again by remounting |
60a2a323 KZ |
2051 | it. |
2052 | ||
81421334 | 2053 | .SS "Mount options for ncpfs" |
60a2a323 KZ |
2054 | Just like |
2055 | .IR nfs ", the " ncpfs | |
2056 | implementation expects a binary argument (a | |
2057 | .IR "struct ncp_mount_data" ) | |
3711f113 | 2058 | to the mount system call. This argument is constructed by |
60a2a323 KZ |
2059 | .BR ncpmount (8) |
2060 | and the current version of | |
2061 | .B mount | |
2062 | (2.12) does not know anything about ncpfs. | |
2063 | ||
81421334 | 2064 | .SS "Mount options for ntfs" |
60a2a323 KZ |
2065 | .TP |
2066 | .BI iocharset= name | |
2067 | Character set to use when returning file names. | |
2068 | Unlike VFAT, NTFS suppresses names that contain | |
3711f113 | 2069 | nonconvertible characters. Deprecated. |
60a2a323 KZ |
2070 | .TP |
2071 | .BI nls= name | |
2072 | New name for the option earlier called | |
2073 | .IR iocharset . | |
60a2a323 | 2074 | .TP |
0d05f161 | 2075 | .B utf8 |
60a2a323 KZ |
2076 | Use UTF-8 for converting file names. |
2077 | .TP | |
2078 | .BR uni_xlate= { 0 | 1 | 2 } | |
2079 | For 0 (or `no' or `false'), do not use escape sequences | |
2080 | for unknown Unicode characters. | |
2081 | For 1 (or `yes' or `true') or 2, use vfat-style 4-byte escape sequences | |
3711f113 | 2082 | starting with ":". Here 2 give a little-endian encoding |
60a2a323 KZ |
2083 | and 1 a byteswapped bigendian encoding. |
2084 | .TP | |
2085 | .B posix=[0|1] | |
2086 | If enabled (posix=1), the filesystem distinguishes between | |
3711f113 BS |
2087 | upper and lower case. The 8.3 alias names are presented as |
2088 | hard links instead of being suppressed. This option is obsolete. | |
60a2a323 | 2089 | .TP |
0d05f161 | 2090 | \fBuid=\fP\,\fIvalue\fP, \fBgid=\fP\,\fIvalue\fP and \fBumask=\fP\,\fIvalue\fP |
60a2a323 KZ |
2091 | Set the file permission on the filesystem. |
2092 | The umask value is given in octal. | |
2093 | By default, the files are owned by root and not readable by somebody else. | |
2094 | ||
81421334 | 2095 | .SS "Mount options for overlay" |
7054d8a6 | 2096 | Since Linux 3.18 the overlay pseudo filesystem implements a union mount for |
49b7f95e | 2097 | other filesystems. |
7054d8a6 OA |
2098 | |
2099 | An overlay filesystem combines two filesystems - an \fBupper\fR filesystem and | |
2100 | a \fBlower\fR filesystem. When a name exists in both filesystems, the object | |
2101 | in the upper filesystem is visible while the object in the lower filesystem is | |
2102 | either hidden or, in the case of directories, merged with the upper object. | |
2103 | ||
2104 | The lower filesystem can be any filesystem supported by Linux and does not need | |
2105 | to be writable. The lower filesystem can even be another overlayfs. The upper | |
2106 | filesystem will normally be writable and if it is it must support the creation | |
49b7f95e | 2107 | of trusted.* extended attributes, and must provide a valid d_type in readdir |
7054d8a6 | 2108 | responses, so NFS is not suitable. |
49b7f95e | 2109 | |
7054d8a6 OA |
2110 | A read-only overlay of two read-only filesystems may use any filesystem type. |
2111 | The options \fBlowerdir\fR and \fBupperdir\fR are combined into a merged | |
2112 | directory by using: | |
2113 | ||
2114 | .RS | |
2115 | .br | |
bed9c1f5 BS |
2116 | .nf |
2117 | .B "mount \-t overlay overlay \e" | |
2118 | .B " \-olowerdir=/lower,upperdir=/upper,workdir=/work /merged" | |
2119 | .fi | |
7054d8a6 OA |
2120 | .br |
2121 | .RE | |
2122 | ||
2123 | .TP | |
2124 | .BI lowerdir= directory | |
2125 | Any filesystem, does not need to be on a writable filesystem. | |
2126 | .TP | |
2127 | .BI upperdir= directory | |
2128 | The upperdir is normally on a writable filesystem. | |
2129 | .TP | |
2130 | .BI workdir= directory | |
2131 | The workdir needs to be an empty directory on the same filesystem as upperdir. | |
2132 | ||
81421334 | 2133 | .SS "Mount options for reiserfs" |
60a2a323 KZ |
2134 | Reiserfs is a journaling filesystem. |
2135 | .TP | |
0d05f161 | 2136 | .B conv |
60a2a323 | 2137 | Instructs version 3.6 reiserfs software to mount a version 3.5 filesystem, |
3711f113 | 2138 | using the 3.6 format for newly created objects. This filesystem will no |
60a2a323 KZ |
2139 | longer be compatible with reiserfs 3.5 tools. |
2140 | .TP | |
2141 | .BR hash= { rupasov | tea | r5 | detect } | |
2142 | Choose which hash function reiserfs will use to find files within directories. | |
2143 | .RS | |
2144 | .TP | |
2145 | .B rupasov | |
81421334 | 2146 | A hash invented by Yury Yu.\& Rupasov. It is fast and preserves locality, |
60a2a323 KZ |
2147 | mapping lexicographically close file names to close hash values. |
2148 | This option should not be used, as it causes a high probability of hash | |
2149 | collisions. | |
2150 | .TP | |
2151 | .B tea | |
2152 | A Davis-Meyer function implemented by Jeremy Fitzhardinge. | |
2153 | It uses hash permuting bits in the name. It gets high randomness | |
2154 | and, therefore, low probability of hash collisions at some CPU cost. | |
2155 | This may be used if EHASHCOLLISION errors are experienced with the r5 hash. | |
2156 | .TP | |
2157 | .B r5 | |
3711f113 | 2158 | A modified version of the rupasov hash. It is used by default and is |
60a2a323 KZ |
2159 | the best choice unless the filesystem has huge directories and |
2160 | unusual file-name patterns. | |
2161 | .TP | |
2162 | .B detect | |
2163 | Instructs | |
0d05f161 | 2164 | .I mount |
60a2a323 | 2165 | to detect which hash function is in use by examining |
fb724eef | 2166 | the filesystem being mounted, and to write this information into |
3711f113 | 2167 | the reiserfs superblock. This is only useful on the first mount of |
60a2a323 KZ |
2168 | an old format filesystem. |
2169 | .RE | |
2170 | .TP | |
0d05f161 | 2171 | .B hashed_relocation |
3711f113 | 2172 | Tunes the block allocator. This may provide performance improvements |
60a2a323 KZ |
2173 | in some situations. |
2174 | .TP | |
0d05f161 | 2175 | .B no_unhashed_relocation |
3711f113 | 2176 | Tunes the block allocator. This may provide performance improvements |
60a2a323 KZ |
2177 | in some situations. |
2178 | .TP | |
0d05f161 | 2179 | .B noborder |
81421334 | 2180 | Disable the border allocator algorithm invented by Yury Yu.\& Rupasov. |
60a2a323 KZ |
2181 | This may provide performance improvements in some situations. |
2182 | .TP | |
0d05f161 | 2183 | .B nolog |
3711f113 | 2184 | Disable journaling. This will provide slight performance improvements in |
60a2a323 | 2185 | some situations at the cost of losing reiserfs's fast recovery from crashes. |
f036b4c7 MF |
2186 | Even with this option turned on, reiserfs still performs all journaling |
2187 | operations, save for actual writes into its journaling area. Implementation | |
60a2a323 | 2188 | of |
0d05f161 | 2189 | .I nolog |
60a2a323 KZ |
2190 | is a work in progress. |
2191 | .TP | |
0d05f161 | 2192 | .B notail |
60a2a323 | 2193 | By default, reiserfs stores small files and `file tails' directly into its |
3711f113 | 2194 | tree. This confuses some utilities such as |
60a2a323 KZ |
2195 | .BR LILO (8). |
2196 | This option is used to disable packing of files into the tree. | |
2197 | .TP | |
0d05f161 | 2198 | .B replayonly |
60a2a323 | 2199 | Replay the transactions which are in the journal, but do not actually |
3711f113 | 2200 | mount the filesystem. Mainly used by |
60a2a323 KZ |
2201 | .IR reiserfsck . |
2202 | .TP | |
2203 | .BI resize= number | |
2204 | A remount option which permits online expansion of reiserfs partitions. | |
2205 | Instructs reiserfs to assume that the device has | |
2206 | .I number | |
2207 | blocks. | |
2208 | This option is designed for use with devices which are under logical | |
2209 | volume management (LVM). | |
2210 | There is a special | |
2211 | .I resizer | |
2212 | utility which can be obtained from | |
2213 | .IR ftp://ftp.namesys.com/pub/reiserfsprogs . | |
2214 | .TP | |
0d05f161 | 2215 | .B user_xattr |
3711f113 | 2216 | Enable Extended User Attributes. See the |
dbeb1d73 | 2217 | .BR attr (1) |
60a2a323 KZ |
2218 | manual page. |
2219 | .TP | |
0d05f161 | 2220 | .B acl |
3711f113 | 2221 | Enable POSIX Access Control Lists. See the |
60a2a323 KZ |
2222 | .BR acl (5) |
2223 | manual page. | |
2224 | .TP | |
fb724eef | 2225 | .BR barrier=none " / " barrier=flush " |
94b559e0 | 2226 | This disables / enables the use of write barriers in the journaling code. |
3711f113 | 2227 | barrier=none disables, barrier=flush enables (default). This also requires an |
94b559e0 RM |
2228 | IO stack which can support barriers, and if reiserfs gets an error on a barrier |
2229 | write, it will disable barriers again with a warning. Write barriers enforce | |
60a2a323 | 2230 | proper on-disk ordering of journal commits, making volatile disk write caches |
94b559e0 RM |
2231 | safe to use, at some performance penalty. If your disks are battery-backed in |
2232 | one way or another, disabling barriers may safely improve performance. | |
60a2a323 | 2233 | |
81421334 | 2234 | .SS "Mount options for ubifs" |
49b7f95e BS |
2235 | UBIFS is a flash filesystem which works on top of UBI volumes. Note that |
2236 | \fBatime\fR is not supported and is always turned off. | |
60a2a323 KZ |
2237 | .TP |
2238 | The device name may be specified as | |
96e47ad0 | 2239 | .PP |
60a2a323 KZ |
2240 | .RS |
2241 | .B ubiX_Y | |
2242 | UBI device number | |
2243 | .BR X , | |
2244 | volume number | |
2245 | .B Y | |
2246 | .TP | |
2247 | .B ubiY | |
2248 | UBI device number | |
2249 | .BR 0 , | |
2250 | volume number | |
2251 | .B Y | |
2252 | .TP | |
2253 | .B ubiX:NAME | |
2254 | UBI device number | |
2255 | .BR X , | |
2256 | volume with name | |
2257 | .B NAME | |
2258 | .TP | |
2259 | .B ubi:NAME | |
2260 | UBI device number | |
2261 | .BR 0 , | |
2262 | volume with name | |
2263 | .B NAME | |
2264 | .RE | |
96e47ad0 | 2265 | .PP |
60a2a323 KZ |
2266 | Alternative |
2267 | .B ! | |
2268 | separator may be used instead of | |
2269 | .BR : . | |
2270 | .TP | |
2271 | The following mount options are available: | |
2272 | .TP | |
0d05f161 | 2273 | .B bulk_read |
96e47ad0 | 2274 | Enable bulk-read. VFS read-ahead is disabled because it slows down the filesystem. Bulk-Read is an internal optimization. Some flashes may read faster if |
3711f113 | 2275 | the data are read at one go, rather than at several read requests. For |
60a2a323 KZ |
2276 | example, OneNAND can do "read-while-load" if it reads more than one NAND page. |
2277 | .TP | |
0d05f161 | 2278 | .B no_bulk_read |
3711f113 | 2279 | Do not bulk-read. This is the default. |
60a2a323 | 2280 | .TP |
0d05f161 | 2281 | .B chk_data_crc |
3711f113 | 2282 | Check data CRC-32 checksums. This is the default. |
60a2a323 | 2283 | .TP |
0d05f161 | 2284 | .BR no_chk_data_crc . |
3711f113 | 2285 | Do not check data CRC-32 checksums. With this option, the filesystem does not |
60a2a323 | 2286 | check CRC-32 checksum for data, but it does check it for the internal indexing |
3711f113 | 2287 | information. This option only affects reading, not writing. CRC-32 is always |
60a2a323 KZ |
2288 | calculated when writing the data. |
2289 | .TP | |
2290 | .BR compr= { none | lzo | zlib } | |
3711f113 | 2291 | Select the default compressor which is used when new files are written. It is |
60a2a323 KZ |
2292 | still possible to read compressed files if mounted with the |
2293 | .B none | |
2294 | option. | |
2295 | ||
81421334 | 2296 | .SS "Mount options for udf" |
bde5d1aa SK |
2297 | UDF is the "Universal Disk Format" filesystem defined by OSTA, the Optical |
2298 | Storage Technology Association, and is often used for DVD-ROM, frequently | |
2299 | in the form of a hybrid UDF/ISO-9660 filesystem. It is, however, | |
2300 | perfectly usable by itself on disk drives, flash drives and other block devices. | |
60a2a323 KZ |
2301 | See also |
2302 | .IR iso9660 . | |
2303 | .TP | |
bde5d1aa SK |
2304 | .B uid= |
2305 | Make all files in the filesystem belong to the given user. | |
2306 | uid=forget can be specified independently of (or usually in | |
2307 | addition to) uid=<user> and results in UDF | |
2308 | not storing uids to the media. In fact the recorded uid | |
1c4c6024 | 2309 | is the 32-bit overflow uid \-1 as defined by the UDF standard. |
bde5d1aa SK |
2310 | The value is given as either <user> which is a valid user name or the corresponding |
2311 | decimal user id, or the special string "forget". | |
2312 | .TP | |
60a2a323 | 2313 | .B gid= |
bde5d1aa SK |
2314 | Make all files in the filesystem belong to the given group. |
2315 | gid=forget can be specified independently of (or usually in | |
2316 | addition to) gid=<group> and results in UDF | |
2317 | not storing gids to the media. In fact the recorded gid | |
1c4c6024 | 2318 | is the 32-bit overflow gid \-1 as defined by the UDF standard. |
bde5d1aa SK |
2319 | The value is given as either <group> which is a valid group name or the corresponding |
2320 | decimal group id, or the special string "forget". | |
60a2a323 KZ |
2321 | .TP |
2322 | .B umask= | |
bde5d1aa | 2323 | Mask out the given permissions from all inodes read from the filesystem. |
60a2a323 KZ |
2324 | The value is given in octal. |
2325 | .TP | |
bde5d1aa SK |
2326 | .B mode= |
2327 | If mode= is set the permissions of all non-directory inodes read from the | |
2328 | filesystem will be set to the given mode. The value is given in octal. | |
2329 | .TP | |
2330 | .B dmode= | |
2331 | If dmode= is set the permissions of all directory inodes read from the | |
2332 | filesystem will be set to the given dmode. The value is given in octal. | |
2333 | .TP | |
2334 | .B bs= | |
2335 | Set the block size. Default value prior to kernel version 2.6.30 was | |
2336 | 2048. Since 2.6.30 and prior to 4.11 it was logical device block size with | |
2337 | fallback to 2048. Since 4.11 it is logical block size with fallback to | |
2338 | any valid block size between logical device block size and 4096. | |
2339 | ||
5b95d7b6 PR |
2340 | For other details see the \fBmkudffs\fP(8) 2.0+ manpage, sections |
2341 | \fBCOMPATIBILITY\fP and \fBBLOCK SIZE\fP. | |
60a2a323 KZ |
2342 | .TP |
2343 | .B unhide | |
2344 | Show otherwise hidden files. | |
2345 | .TP | |
2346 | .B undelete | |
2347 | Show deleted files in lists. | |
2348 | .TP | |
bde5d1aa SK |
2349 | .B adinicb |
2350 | Embed data in the inode. (default) | |
2351 | .TP | |
2352 | .B noadinicb | |
2353 | Don't embed data in the inode. | |
2354 | .TP | |
2355 | .B shortad | |
2356 | Use short UDF address descriptors. | |
2357 | .TP | |
2358 | .B longad | |
2359 | Use long UDF address descriptors. (default) | |
2360 | .TP | |
60a2a323 KZ |
2361 | .B nostrict |
2362 | Unset strict conformance. | |
60a2a323 | 2363 | .TP |
5b95d7b6 PR |
2364 | .B iocharset= |
2365 | Set the NLS character set. This requires kernel compiled with CONFIG_UDF_NLS option. | |
2366 | .TP | |
2367 | .B utf8 | |
2368 | Set the UTF-8 character set. | |
bde5d1aa | 2369 | .SS Mount options for debugging and disaster recovery |
60a2a323 KZ |
2370 | .TP |
2371 | .B novrs | |
bde5d1aa | 2372 | Ignore the Volume Recognition Sequence and attempt to mount anyway. |
60a2a323 KZ |
2373 | .TP |
2374 | .B session= | |
bde5d1aa | 2375 | Select the session number for multi-session recorded optical media. (default= last session) |
60a2a323 KZ |
2376 | .TP |
2377 | .B anchor= | |
bde5d1aa SK |
2378 | Override standard anchor location. (default= 256) |
2379 | .TP | |
2380 | .B lastblock= | |
2381 | Set the last block of the filesystem. | |
2382 | .SS Unused historical mount options that may be encountered and should be removed | |
2383 | .TP | |
2384 | .B uid=ignore | |
5b95d7b6 | 2385 | Ignored, use uid=<user> instead. |
bde5d1aa SK |
2386 | .TP |
2387 | .B gid=ignore | |
5b95d7b6 | 2388 | Ignored, use gid=<group> instead. |
60a2a323 KZ |
2389 | .TP |
2390 | .B volume= | |
5b95d7b6 | 2391 | Unimplemented and ignored. |
60a2a323 KZ |
2392 | .TP |
2393 | .B partition= | |
5b95d7b6 | 2394 | Unimplemented and ignored. |
60a2a323 KZ |
2395 | .TP |
2396 | .B fileset= | |
5b95d7b6 | 2397 | Unimplemented and ignored. |
60a2a323 KZ |
2398 | .TP |
2399 | .B rootdir= | |
5b95d7b6 | 2400 | Unimplemented and ignored. |
60a2a323 | 2401 | |
81421334 | 2402 | .SS "Mount options for ufs" |
60a2a323 KZ |
2403 | .TP |
2404 | .BI ufstype= value | |
2405 | UFS is a filesystem widely used in different operating systems. | |
3711f113 | 2406 | The problem are differences among implementations. Features of some |
60a2a323 KZ |
2407 | implementations are undocumented, so its hard to recognize the |
2408 | type of ufs automatically. | |
2409 | That's why the user must specify the type of ufs by mount option. | |
2410 | Possible values are: | |
2411 | .RS | |
2412 | .TP | |
2413 | .B old | |
2414 | Old format of ufs, this is the default, read only. | |
2415 | (Don't forget to give the \-r option.) | |
2416 | .TP | |
2417 | .B 44bsd | |
0d05f161 | 2418 | For filesystems created by a BSD-like system (NetBSD, FreeBSD, OpenBSD). |
60a2a323 KZ |
2419 | .TP |
2420 | .B ufs2 | |
2421 | Used in FreeBSD 5.x supported as read-write. | |
2422 | .TP | |
2423 | .B 5xbsd | |
2424 | Synonym for ufs2. | |
2425 | .TP | |
2426 | .B sun | |
2427 | For filesystems created by SunOS or Solaris on Sparc. | |
2428 | .TP | |
2429 | .B sunx86 | |
2430 | For filesystems created by Solaris on x86. | |
2431 | .TP | |
2432 | .B hp | |
2433 | For filesystems created by HP-UX, read-only. | |
2434 | .TP | |
2435 | .B nextstep | |
2436 | For filesystems created by NeXTStep (on NeXT station) (currently read only). | |
2437 | .TP | |
2438 | .B nextstep-cd | |
2439 | For NextStep CDROMs (block_size == 2048), read-only. | |
2440 | .TP | |
2441 | .B openstep | |
2442 | For filesystems created by OpenStep (currently read only). | |
2443 | The same filesystem type is also used by Mac OS X. | |
2444 | .RE | |
2445 | ||
2446 | .TP | |
2447 | .BI onerror= value | |
ee312c65 | 2448 | Set behavior on error: |
60a2a323 KZ |
2449 | .RS |
2450 | .TP | |
2451 | .B panic | |
2452 | If an error is encountered, cause a kernel panic. | |
2453 | .TP | |
2454 | .RB [ lock | umount | repair ] | |
2455 | These mount options don't do anything at present; | |
2456 | when an error is encountered only a console message is printed. | |
2457 | .RE | |
2458 | ||
81421334 | 2459 | .SS "Mount options for umsdos" |
60a2a323 KZ |
2460 | See mount options for msdos. |
2461 | The | |
2462 | .B dotsOK | |
2463 | option is explicitly killed by | |
2464 | .IR umsdos . | |
2465 | ||
81421334 | 2466 | .SS "Mount options for vfat" |
60a2a323 KZ |
2467 | First of all, the mount options for |
2468 | .I fat | |
2469 | are recognized. | |
2470 | The | |
2471 | .B dotsOK | |
2472 | option is explicitly killed by | |
2473 | .IR vfat . | |
2474 | Furthermore, there are | |
2475 | .TP | |
2476 | .B uni_xlate | |
2477 | Translate unhandled Unicode characters to special escaped sequences. | |
2478 | This lets you backup and restore filenames that are created with any | |
3711f113 BS |
2479 | Unicode characters. Without this option, a '?' is used when no |
2480 | translation is possible. The escape character is ':' because it is | |
2481 | otherwise invalid on the vfat filesystem. The escape sequence | |
2482 | that gets used, where u is the Unicode character, | |
60a2a323 KZ |
2483 | is: ':', (u & 0x3f), ((u>>6) & 0x3f), (u>>12). |
2484 | .TP | |
2485 | .B posix | |
2486 | Allow two files with names that only differ in case. | |
2487 | This option is obsolete. | |
2488 | .TP | |
2489 | .B nonumtail | |
2490 | First try to make a short name without sequence number, | |
2491 | before trying | |
0d05f161 | 2492 | .IR name\s+3~\s0num.ext . |
60a2a323 KZ |
2493 | .TP |
2494 | .B utf8 | |
2495 | UTF8 is the filesystem safe 8-bit encoding of Unicode that is used by the | |
3711f113 BS |
2496 | console. It can be enabled for the filesystem with this option or disabled |
2497 | with utf8=0, utf8=no or utf8=false. If `uni_xlate' gets set, UTF8 gets | |
60a2a323 KZ |
2498 | disabled. |
2499 | .TP | |
3711f113 | 2500 | .BI shortname= mode |
ee312c65 | 2501 | Defines the behavior for creation and display of filenames which fit into |
3711f113 BS |
2502 | 8.3 characters. If a long name for a file exists, it will always be the |
2503 | preferred one for display. There are four \fImode\fRs: | |
60a2a323 KZ |
2504 | .RS |
2505 | .TP | |
3711f113 | 2506 | .B lower |
60a2a323 KZ |
2507 | Force the short name to lower case upon display; store a long name when |
2508 | the short name is not all upper case. | |
2509 | .TP | |
3711f113 | 2510 | .B win95 |
60a2a323 KZ |
2511 | Force the short name to upper case upon display; store a long name when |
2512 | the short name is not all upper case. | |
2513 | .TP | |
3711f113 BS |
2514 | .B winnt |
2515 | Display the short name as is; store a long name when the short name is | |
60a2a323 KZ |
2516 | not all lower case or all upper case. |
2517 | .TP | |
3711f113 | 2518 | .B mixed |
60a2a323 | 2519 | Display the short name as is; store a long name when the short name is not |
3711f113 | 2520 | all upper case. This mode is the default since Linux 2.6.32. |
60a2a323 KZ |
2521 | .RE |
2522 | ||
81421334 | 2523 | .SS "Mount options for usbfs" |
60a2a323 | 2524 | .TP |
0d05f161 | 2525 | \fBdevuid=\fP\,\fIuid\fP and \fBdevgid=\fP\,\fIgid\fP and \fBdevmode=\fP\,\fImode\fP |
60a2a323 | 2526 | Set the owner and group and mode of the device files in the usbfs filesystem |
3711f113 | 2527 | (default: uid=gid=0, mode=0644). The mode is given in octal. |
60a2a323 | 2528 | .TP |
0d05f161 | 2529 | \fBbusuid=\fP\,\fIuid\fP and \fBbusgid=\fP\,\fIgid\fP and \fBbusmode=\fP\,\fImode\fP |
60a2a323 | 2530 | Set the owner and group and mode of the bus directories in the usbfs |
3711f113 | 2531 | filesystem (default: uid=gid=0, mode=0555). The mode is given in octal. |
60a2a323 | 2532 | .TP |
0d05f161 | 2533 | \fBlistuid=\fP\,\fIuid\fP and \fBlistgid=\fP\,\fIgid\fP and \fBlistmode=\fP\,\fImode\fP |
60a2a323 KZ |
2534 | Set the owner and group and mode of the file |
2535 | .I devices | |
3711f113 | 2536 | (default: uid=gid=0, mode=0444). The mode is given in octal. |
60a2a323 | 2537 | |
5a829806 | 2538 | .SH DM-VERITY SUPPORT (experimental) |
c9300c7d | 2539 | The device-mapper verity target provides read-only transparent integrity |
96e47ad0 MK |
2540 | checking of block devices using kernel crypto API. The |
2541 | .B mount | |
2542 | command can open | |
c9300c7d KZ |
2543 | the dm-verity device and do the integrity verification before on the device |
2544 | filesystem is mounted. Requires libcryptsetup with in libmount. If | |
2545 | libcryptsetup supports extracting the root hash of an already mounted device, | |
2546 | existing devices will be automatically reused in case of a match. | |
2547 | Mount options for dm-verity: | |
e6a49887 LB |
2548 | .TP |
2549 | \fBverity.hashdevice=\fP\,\fIpath\fP | |
2550 | Path to the hash tree device associated with the source volume to pass to dm-verity. | |
2551 | .TP | |
2552 | \fBverity.roothash=\fP\,\fIhex\fP | |
2553 | Hex-encoded hash of the root of | |
2554 | .I verity.hashdevice | |
141bb954 LB |
2555 | Mutually exclusive with |
2556 | .I verity.roothashfile. | |
2557 | .TP | |
2558 | \fBverity.roothashfile=\fP\,\fIpath\fP | |
2559 | Path to file containing the hex-encoded hash of the root of | |
2560 | .I verity.hashdevice. | |
2561 | Mutually exclusive with | |
2562 | .I verity.roothash. | |
e6a49887 LB |
2563 | .TP |
2564 | \fBverity.hashoffset=\fP\,\fIoffset\fP | |
2565 | If the hash tree device is embedded in the source volume, | |
2566 | .I offset | |
2567 | (default: 0) is used by dm-verity to get to the tree. | |
9835a4b6 LB |
2568 | .TP |
2569 | \fBverity.fecdevice=\fP\,\fIpath\fP | |
2570 | Path to the Forward Error Correction (FEC) device associated with the source volume to pass to dm-verity. | |
2571 | Optional. Requires kernel built with CONFIG_DM_VERITY_FEC. | |
2572 | .TP | |
2573 | \fBverity.fecoffset=\fP\,\fIoffset\fP | |
2574 | If the FEC device is embedded in the source volume, | |
2575 | .I offset | |
2576 | (default: 0) is used by dm-verity to get to the FEC area. Optional. | |
2577 | .TP | |
2578 | \fBverity.fecroots=\fP\,\fIvalue\fP | |
2579 | Parity bytes for FEC (default: 2). Optional. | |
123b1a67 LB |
2580 | .TP |
2581 | \fBverity.roothashsig=\fP\,\fIpath\fP | |
2582 | Path to pkcs7 signature of root hash hex string. Requires crypt_activate_by_signed_key() from cryptsetup and | |
2583 | kernel built with CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG. For device reuse, signatures have to be either used by all | |
2584 | mounts of a device or by none. Optional. | |
c9300c7d KZ |
2585 | .PP |
2586 | Supported since util-linux v2.35. | |
62dc77f3 KZ |
2587 | .PP |
2588 | For example commands: | |
2589 | .sp | |
2590 | .RS | |
2591 | .nf | |
2592 | .B mksquashfs /etc /tmp/etc.squashfs | |
2593 | .B dd if=/dev/zero of=/tmp/etc.hash bs=1M count=10 | |
2594 | .B veritysetup format /tmp/etc.squashfs /tmp/etc.hash | |
123b1a67 LB |
2595 | .B openssl smime \-sign \-in <hash> \-nocerts \-inkey private.key \-signer private.crt \-noattr \-binary \-outform der \-out /tmp/etc.p7 |
2596 | .B mount \-o verity.hashdevice=/tmp/etc.hash,verity.roothash=<hash>,verity.roothashsig=/tmp/etc.p7 /tmp/etc.squashfs /mnt | |
62dc77f3 KZ |
2597 | .fi |
2598 | .RE | |
2599 | .sp | |
2600 | create squashfs image from /etc directory, verity hash device | |
2601 | and mount verified filesystem image to /mnt. | |
123b1a67 | 2602 | The kernel will verify that the root hash is signed by a key from the kernel keyring if roothashsig is used. |
e6a49887 | 2603 | |
5a829806 | 2604 | .SH LOOP-DEVICE SUPPORT |
3711f113 | 2605 | One further possible type is a mount via the loop device. For example, |
60a2a323 KZ |
2606 | the command |
2607 | .RS | |
2608 | .sp | |
4b8f8336 | 2609 | .B "mount /tmp/disk.img /mnt \-t vfat \-o loop=/dev/loop3" |
60a2a323 KZ |
2610 | .sp |
2611 | .RE | |
2612 | will set up the loop device | |
2613 | .I /dev/loop3 | |
2614 | to correspond to the file | |
2615 | .IR /tmp/disk.img , | |
2616 | and then mount this device on | |
2617 | .IR /mnt . | |
2618 | ||
2619 | If no explicit loop device is mentioned | |
2620 | (but just an option `\fB\-o loop\fP' is given), then | |
2621 | .B mount | |
2622 | will try to find some unused loop device and use that, for example | |
2623 | .RS | |
2624 | .sp | |
0d05f161 | 2625 | .B "mount /tmp/disk.img /mnt \-o loop" |
60a2a323 KZ |
2626 | .sp |
2627 | .RE | |
96e47ad0 MK |
2628 | The |
2629 | .B mount | |
2630 | command | |
60a2a323 KZ |
2631 | .B automatically |
2632 | creates a loop device from a regular file if a filesystem type is | |
2633 | not specified or the filesystem is known for libblkid, for example: | |
2634 | .RS | |
2635 | .sp | |
2636 | .B "mount /tmp/disk.img /mnt" | |
2637 | .sp | |
d901e427 | 2638 | .B "mount \-t ext4 /tmp/disk.img /mnt" |
60a2a323 KZ |
2639 | .sp |
2640 | .RE | |
3711f113 BS |
2641 | This type of mount knows about three options, namely |
2642 | .BR loop ", " offset " and " sizelimit , | |
60a2a323 KZ |
2643 | that are really options to |
2644 | .BR \%losetup (8). | |
2645 | (These options can be used in addition to those specific | |
2646 | to the filesystem type.) | |
2647 | ||
3711f113 BS |
2648 | Since Linux 2.6.25 auto-destruction of loop devices is supported, |
2649 | meaning that any loop device allocated by | |
60a2a323 KZ |
2650 | .B mount |
2651 | will be freed by | |
2652 | .B umount | |
3711f113 | 2653 | independently of |
60a2a323 KZ |
2654 | .IR /etc/mtab . |
2655 | ||
3711f113 BS |
2656 | You can also free a loop device by hand, using |
2657 | .BR "losetup \-d " or " umount \-d" . | |
60a2a323 | 2658 | |
96e47ad0 MK |
2659 | Since util-linux v2.29, |
2660 | .B mount | |
2661 | re-uses the loop device rather than | |
2662 | initializing a new device if the same backing file is already used for some loop | |
03b4519b KZ |
2663 | device with the same offset and sizelimit. This is necessary to avoid |
2664 | a filesystem corruption. | |
d08b58c4 | 2665 | |
7e765c93 | 2666 | .SH EXIT STATUS |
60a2a323 | 2667 | .B mount |
a87f49f6 | 2668 | has the following exit status values (the bits can be ORed): |
60a2a323 | 2669 | .TP |
0d05f161 | 2670 | .B 0 |
60a2a323 KZ |
2671 | success |
2672 | .TP | |
0d05f161 | 2673 | .B 1 |
60a2a323 KZ |
2674 | incorrect invocation or permissions |
2675 | .TP | |
0d05f161 | 2676 | .B 2 |
60a2a323 KZ |
2677 | system error (out of memory, cannot fork, no more loop devices) |
2678 | .TP | |
0d05f161 | 2679 | .B 4 |
60a2a323 KZ |
2680 | internal |
2681 | .B mount | |
2682 | bug | |
2683 | .TP | |
0d05f161 | 2684 | .B 8 |
60a2a323 KZ |
2685 | user interrupt |
2686 | .TP | |
0d05f161 | 2687 | .B 16 |
60a2a323 KZ |
2688 | problems writing or locking /etc/mtab |
2689 | .TP | |
0d05f161 | 2690 | .B 32 |
60a2a323 KZ |
2691 | mount failure |
2692 | .TP | |
0d05f161 | 2693 | .B 64 |
60a2a323 | 2694 | some mount succeeded |
16b73aae | 2695 | |
3711f113 BS |
2696 | The command \fBmount \-a\fR returns 0 (all succeeded), 32 (all failed), or 64 (some |
2697 | failed, some succeeded). | |
60a2a323 | 2698 | |
5a829806 | 2699 | .SH EXTERNAL HELPERS |
60a2a323 | 2700 | The syntax of external mount helpers is: |
81421334 BS |
2701 | .sp |
2702 | .in +4 | |
3711f113 | 2703 | .BI /sbin/mount. suffix |
60a2a323 KZ |
2704 | .I spec dir |
2705 | .RB [ \-sfnv ] | |
c5b63d28 KZ |
2706 | .RB [ \-N |
2707 | .IR namespace ] | |
60a2a323 KZ |
2708 | .RB [ \-o |
2709 | .IR options ] | |
2710 | .RB [ \-t | |
3711f113 | 2711 | .IR type \fB. subtype ] |
81421334 BS |
2712 | .in |
2713 | .sp | |
c5b63d28 | 2714 | where the \fIsuffix\fR is the filesystem type and the \fB\-sfnvoN\fR options have |
3711f113 BS |
2715 | the same meaning as the normal mount options. The \fB\-t\fR option is used for |
2716 | filesystems with subtypes support (for example | |
2717 | .BR "/sbin/mount.fuse \-t fuse.sshfs" ). | |
60a2a323 | 2718 | |
3711f113 | 2719 | The command \fBmount\fR does not pass the mount options |
00963eac KZ |
2720 | .BR unbindable , |
2721 | .BR runbindable , | |
2722 | .BR private , | |
2723 | .BR rprivate , | |
2724 | .BR slave , | |
2725 | .BR rslave , | |
2726 | .BR shared , | |
2727 | .BR rshared , | |
2728 | .BR auto , | |
2729 | .BR noauto , | |
2730 | .BR comment , | |
0d05f161 | 2731 | .BR x-* , |
00963eac | 2732 | .BR loop , |
0d05f161 | 2733 | .B offset |
00963eac | 2734 | and |
0d05f161 | 2735 | .B sizelimit |
3711f113 | 2736 | to the mount.<suffix> helpers. All other options are used in a |
96e47ad0 | 2737 | comma-separated list as an argument to the \fB\-o\fR option. |
00963eac | 2738 | |
380fd9aa MK |
2739 | .SH ENVIRONMENT |
2740 | .IP LIBMOUNT_FSTAB=<path> | |
cfd6b4dc MK |
2741 | overrides the default location of the |
2742 | .I fstab | |
2743 | file (ignored for suid) | |
380fd9aa | 2744 | .IP LIBMOUNT_MTAB=<path> |
cfd6b4dc MK |
2745 | overrides the default location of the |
2746 | .I mtab | |
2747 | file (ignored for suid) | |
380fd9aa MK |
2748 | .IP LIBMOUNT_DEBUG=all |
2749 | enables libmount debug output | |
2750 | .IP LIBBLKID_DEBUG=all | |
2751 | enables libblkid debug output | |
2752 | .IP LOOPDEV_DEBUG=all | |
2753 | enables loop device setup debug output | |
60a2a323 | 2754 | .SH FILES |
b6cc1210 | 2755 | See also "\fBThe files /etc/fstab, /etc/mtab and /proc/mounts\fR" section above. |
60a2a323 KZ |
2756 | .TP 18n |
2757 | .I /etc/fstab | |
2758 | filesystem table | |
2759 | .TP | |
b6cc1210 KZ |
2760 | .I /run/mount |
2761 | libmount private runtime directory | |
2762 | .TP | |
60a2a323 | 2763 | .I /etc/mtab |
cfd6b4dc MK |
2764 | table of mounted filesystems or symlink to |
2765 | .I /proc/mounts | |
60a2a323 | 2766 | .TP |
0d05f161 | 2767 | .I /etc/mtab\s+3~\s0 |
96e47ad0 MK |
2768 | lock file (unused on systems with |
2769 | .I mtab | |
2770 | symlink) | |
60a2a323 KZ |
2771 | .TP |
2772 | .I /etc/mtab.tmp | |
96e47ad0 MK |
2773 | temporary file (unused on systems with |
2774 | .I mtab | |
2775 | symlink) | |
60a2a323 KZ |
2776 | .TP |
2777 | .I /etc/filesystems | |
2778 | a list of filesystem types to try | |
67e63c12 MK |
2779 | .SH HISTORY |
2780 | A | |
2781 | .B mount | |
2782 | command existed in Version 5 AT&T UNIX. | |
60a2a323 KZ |
2783 | .SH BUGS |
2784 | It is possible for a corrupted filesystem to cause a crash. | |
2785 | .PP | |
2786 | Some Linux filesystems don't support | |
96e47ad0 | 2787 | .BR "\-o sync " and " \-o dirsync" |
d901e427 | 2788 | (the ext2, ext3, ext4, fat and vfat filesystems |
60a2a323 KZ |
2789 | .I do |
2790 | support synchronous updates (a la BSD) when mounted with the | |
2791 | .B sync | |
2792 | option). | |
2793 | .PP | |
2794 | The | |
2795 | .B "\-o remount" | |
2796 | may not be able to change mount parameters (all | |
2797 | .IR ext2fs -specific | |
2798 | parameters, except | |
fb724eef | 2799 | .BR sb , |
60a2a323 KZ |
2800 | are changeable with a remount, for example, but you can't change |
2801 | .B gid | |
2802 | or | |
2803 | .B umask | |
2804 | for the | |
2805 | .IR fatfs ). | |
2806 | .PP | |
81421334 | 2807 | It is possible that the files |
0d05f161 | 2808 | .I /etc/mtab |
60a2a323 | 2809 | and |
0d05f161 | 2810 | .I /proc/mounts |
96e47ad0 MK |
2811 | don't match on systems with a regular |
2812 | .I mtab | |
2813 | file. The first file is based only on | |
06716dff | 2814 | the mount command options, but the content of the second file also depends on |
81421334 BS |
2815 | the kernel and others settings (e.g.\& on a remote NFS server -- in certain cases |
2816 | the mount command may report unreliable information about an NFS mount point | |
cfd6b4dc MK |
2817 | and the |
2818 | .I /proc/mount | |
2819 | file usually contains more reliable information.) This is | |
2820 | another reason to replace the | |
2821 | .I mtab | |
2822 | file with a symlink to the | |
06716dff KZ |
2823 | .I /proc/mounts |
2824 | file. | |
60a2a323 | 2825 | .PP |
81421334 | 2826 | Checking files on NFS filesystems referenced by file descriptors (i.e.\& the |
0d05f161 | 2827 | .B fcntl |
60a2a323 | 2828 | and |
0d05f161 | 2829 | .B ioctl |
81421334 | 2830 | families of functions) may lead to inconsistent results due to the lack of |
96e47ad0 MK |
2831 | a consistency check in the kernel even if the |
2832 | .B noac | |
2833 | mount option is used. | |
293714c0 JM |
2834 | .PP |
2835 | The | |
2836 | .B loop | |
2837 | option with the | |
2838 | .B offset | |
2839 | or | |
2840 | .B sizelimit | |
2841 | options used may fail when using older kernels if the | |
2842 | .B mount | |
2843 | command can't confirm that the size of the block device has been configured | |
3711f113 | 2844 | as requested. This situation can be worked around by using |
293714c0 JM |
2845 | the |
2846 | .B losetup | |
2847 | command manually before calling | |
2848 | .B mount | |
2849 | with the configured loop device. | |
60a2a323 KZ |
2850 | .SH AUTHORS |
2851 | .nf | |
2852 | Karel Zak <kzak@redhat.com> | |
2853 | .fi | |
ade04bb8 MK |
2854 | .SH SEE ALSO |
2855 | .na | |
f95c9776 | 2856 | .BR lsblk (1), |
ade04bb8 MK |
2857 | .BR mount (2), |
2858 | .BR umount (2), | |
f95c9776 | 2859 | .BR fileystems (5), |
ade04bb8 MK |
2860 | .BR fstab (5), |
2861 | .BR nfs (5), | |
2862 | .BR xfs (5), | |
2a425c02 | 2863 | .BR mount_namespaces (7) |
f95c9776 | 2864 | .BR xattr (7) |
ade04bb8 MK |
2865 | .BR e2label (8), |
2866 | .BR findmnt (8), | |
2867 | .BR losetup (8), | |
2868 | .BR mke2fs (8), | |
2869 | .BR mountd (8), | |
2870 | .BR nfsd (8), | |
2871 | .BR swapon (8), | |
2872 | .BR tune2fs (8), | |
f95c9776 | 2873 | .BR umount (8), |
ade04bb8 MK |
2874 | .BR xfs_admin (8) |
2875 | .ad | |
60a2a323 KZ |
2876 | .SH AVAILABILITY |
2877 | The mount command is part of the util-linux package and is available from | |
d673b74e | 2878 | https://www.kernel.org/pub/linux/utils/util-linux/. |